diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 13:12:43 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 13:12:43 (GMT) |
commit | a548deeb29badee88dc6fc7a2853b6f56558347f (patch) | |
tree | 251259e69e252458eb55b3d92491355b9e0a937f /configure.in | |
parent | 009ae861f2a3ffcc3d6586fb1bcfdbd99547855a (diff) | |
download | cpython-a548deeb29badee88dc6fc7a2853b6f56558347f.zip cpython-a548deeb29badee88dc6fc7a2853b6f56558347f.tar.gz cpython-a548deeb29badee88dc6fc7a2853b6f56558347f.tar.bz2 |
Issue #5792: Extend short float repr support to x86 platforms using suncc or icc.
Many thanks Stefan Krah for help and OpenSolaris testing.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/configure.in b/configure.in index 6c5add3..18555ee 100644 --- a/configure.in +++ b/configure.in @@ -3320,25 +3320,24 @@ fi # correctly-rounded string <-> double conversion functions from # Python/dtoa.c, which in turn require that the FPU uses 53-bit # rounding; this is a problem on x86, where the x87 FPU has a default -# rounding precision of 64 bits. For gcc/x86, we try to fix this by +# rounding precision of 64 bits. For gcc/x86, we can fix this by # using inline assembler to get and set the x87 FPU control word. -if test "$GCC" = yes && test -n "`$CC -dM -E - </dev/null | grep i386`" -then - # Check that it's okay to use gcc inline assembler to get and set - # x87 control word. It should be, but you never know... - AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 control word) - AC_TRY_COMPILE([], [ - unsigned short cw; - __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); - __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); - ], - [have_gcc_asm_for_x87=yes], [have_gcc_asm_for_x87=no]) - AC_MSG_RESULT($have_gcc_asm_for_x87) - if test "$have_gcc_asm_for_x87" = yes - then - AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1, - [Define if we can use gcc inline assembler to get and set x87 control word]) - fi + +# This inline assembler syntax may also work for suncc and icc, +# so we try it on all platforms. + +AC_MSG_CHECKING(whether we can use gcc inline assembler to get and set x87 control word) +AC_TRY_COMPILE([], [ + unsigned short cw; + __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); + __asm__ __volatile__ ("fldcw %0" : : "m" (cw)); +], +[have_gcc_asm_for_x87=yes], [have_gcc_asm_for_x87=no]) +AC_MSG_RESULT($have_gcc_asm_for_x87) +if test "$have_gcc_asm_for_x87" = yes +then + AC_DEFINE(HAVE_GCC_ASM_FOR_X87, 1, + [Define if we can use gcc inline assembler to get and set x87 control word]) fi # Detect whether system arithmetic is subject to x87-style double |