diff options
author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-16 04:07:20 +0000 |
---|---|---|
committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-01-16 04:07:20 +0000 |
commit | c65a66ea5856277dcf4defdb6dfe9c8ef6361aef (patch) | |
tree | 6416ec3c4f8c8125bba80173a8b0b23cbb57939b /fixincludes/inclhack.def | |
parent | a8d0810bd41d6d0414093ebb629cb8f856d32fbf (diff) | |
download | gcc-c65a66ea5856277dcf4defdb6dfe9c8ef6361aef.tar.gz |
* inclhack.def (feraiseexcept_nosse_invalid): New.
(feraiseexcept_nosse_divbyzero): Likewise.
* fixincl.x: Rebuilt.
* tests/base/bits/fenv.h: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes/inclhack.def')
-rw-r--r-- | fixincludes/inclhack.def | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 09eac7c6254..24069201d12 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -4815,4 +4815,53 @@ fix = { test_text = "extern char *\tsprintf();"; }; +/* + * Incorrect feraiseexcept extern inline in bits/fenv.h on x86_64 + * that fails when compiling for SSE-less 32-bit x86. + */ +fix = { + hackname = feraiseexcept_nosse_invalid; + mach = 'i[34567]86-*-linux*', 'x86*-linux*', 'amd64-*-linux*'; + files = bits/fenv.h; + select = "^([\t ]*)__asm__ __volatile__ \\(\"divss %0, %0 *\" : " + ": \"x\" \\(__f\\)\\);$"; + bypass = "\"fdiv .*; fwait\""; + + c_fix = format; + c_fix_arg = <<- _EOText_ + # ifdef __SSE_MATH__ + %0 + # else + %1__asm__ __volatile__ ("fdiv %%%%st, %%%%st(0); fwait" + %1 : "=t" (__f) : "0" (__f)); + # endif + _EOText_; + + test_text = <<- _EOText_ + __asm__ __volatile__ ("divss %0, %0" : : "x" (__f)); + _EOText_; +}; +fix = { + hackname = feraiseexcept_nosse_divbyzero; + mach = 'i[34567]86-*-linux*', 'x86*-linux*', 'amd64-*-linux*'; + files = bits/fenv.h; + select = "^([\t ]*)__asm__ __volatile__ \\(\"divss %1, %0 *\" : " + ": \"x\" \\(__f\\), \"x\" \\(__g\\)\\);$"; + bypass = "\"fdivp .*; fwait\""; + + c_fix = format; + c_fix_arg = <<- _EOText_ + # ifdef __SSE_MATH__ + %0 + # else + %1__asm__ __volatile__ ("fdivp %%%%st, %%%%st(1); fwait" + %1 : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)"); + # endif + _EOText_; + + test_text = <<- _EOText_ + __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g)); + _EOText_; +}; + /*EOF*/ |