diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2013-01-16 04:07:20 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2013-01-16 04:07:20 +0000 |
commit | c851c76cdf52884dd5e0c7befd3c809e9d174a73 (patch) | |
tree | 6416ec3c4f8c8125bba80173a8b0b23cbb57939b /fixincludes/inclhack.def | |
parent | 0133a2aa7dc2ccd0fac2edbc6dabc8536fa58688 (diff) | |
download | gcc-c851c76cdf52884dd5e0c7befd3c809e9d174a73.zip gcc-c851c76cdf52884dd5e0c7befd3c809e9d174a73.tar.gz gcc-c851c76cdf52884dd5e0c7befd3c809e9d174a73.tar.bz2 |
inclhack.def (feraiseexcept_nosse_invalid): New.
* inclhack.def (feraiseexcept_nosse_invalid): New.
(feraiseexcept_nosse_divbyzero): Likewise.
* fixincl.x: Rebuilt.
* tests/base/bits/fenv.h: New.
From-SVN: r195226
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 09eac7c..2406920 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*/ |