public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Marcus Shawcroft <marcus.shawcroft@arm.com>
To: "libffi-discuss@sourceware.org" <libffi-discuss@sourceware.org>
Subject: Set -ffp-contract=off for libffi.call/many.c
Date: Fri, 11 Oct 2013 10:51:00 -0000	[thread overview]
Message-ID: <5257D80D.605@arm.com> (raw)

[-- 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)

                 reply	other threads:[~2013-10-11 10:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5257D80D.605@arm.com \
    --to=marcus.shawcroft@arm.com \
    --cc=libffi-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).