If e.g. -march=haswell is set in CFLAGS, GCC generates FMAs by default, which is inconsistent with the microkernels, none of which use FMAs. These inconsistencies cause a few failures in the LAPACK testcases, where eigenvalue results with/without eigenvectors are compared. Moreover using FMAs for multiplication of complex numbers can give surprising results, seetags/v0.3.22^222aa81ffor more information. This uses the same syntax as used in22aa81ffor zarch (s390x).
| @@ -25,6 +25,19 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||||
| USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| *****************************************************************************/ | *****************************************************************************/ | ||||
| /* | |||||
| * Avoid contraction of floating point operations, specifically fused | |||||
| * multiply-add, because they can cause unexpected results in complex | |||||
| * multiplication. | |||||
| */ | |||||
| #if defined(__GNUC__) && !defined(__clang__) | |||||
| #pragma GCC optimize ("fp-contract=off") | |||||
| #endif | |||||
| #if defined(__clang__) | |||||
| #pragma clang fp contract(off) | |||||
| #endif | |||||
| #include "common.h" | #include "common.h" | ||||
| @@ -25,6 +25,19 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | |||||
| USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| *****************************************************************************/ | *****************************************************************************/ | ||||
| /* | |||||
| * Avoid contraction of floating point operations, specifically fused | |||||
| * multiply-add, because they can cause unexpected results in complex | |||||
| * multiplication. | |||||
| */ | |||||
| #if defined(__GNUC__) && !defined(__clang__) | |||||
| #pragma GCC optimize ("fp-contract=off") | |||||
| #endif | |||||
| #if defined(__clang__) | |||||
| #pragma clang fp contract(off) | |||||
| #endif | |||||
| #include "common.h" | #include "common.h" | ||||