public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* Set -ffp-contract=off for libffi.call/many.c
@ 2013-10-11 10:51 Marcus Shawcroft
  0 siblings, 0 replies; only message in thread
From: Marcus Shawcroft @ 2013-10-11 10:51 UTC (permalink / raw)
  To: libffi-discuss

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

Hi,

The review of this patch ran out of stream:

https://sourceware.org/ml/libffi-discuss/2013/msg00128.html

The proposed solution would not work when testing with a none GCC 
compiler.  Constraining the dg-option was tricky because the mechanism 
available allows matching against the target triple not the compiler and 
in this particular scenario the issue was the compiler, not the target.

The purpose of the test is to ensure that the arguments are correctly 
passed via two alternative mechanisms.  The actual sequence of 
operations used to combine all the arguments into a return value is 
largely irrelevant.

Therefore the other route here is to adjust the computation used to 
remove the opportunity for the compiler to choose a fused multiply.

Proposed patch attached.

OK?

2013-10-11  Marcus Shawcroft  <marcus.shawcroft@arm.com>

         * testsuite/libffi.call/many.c (many): Replace * with +.

Thanks
/Marcus

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libffi-many.patch --]
[-- Type: text/x-patch; name=libffi-many.patch, Size: 422 bytes --]

diff --git a/testsuite/libffi.call/many.c b/testsuite/libffi.call/many.c
index 67a367f..11818e6 100644
--- a/testsuite/libffi.call/many.c
+++ b/testsuite/libffi.call/many.c
@@ -32,7 +32,7 @@ static float many(float f1,
 	 (double) f11, (double) f12, (double) f13);
 #endif
 
-  return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13);
+  return f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12+f13;
 }
 
 int main (void)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-11 10:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 10:51 Set -ffp-contract=off for libffi.call/many.c Marcus Shawcroft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).