aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2011-08-23 21:30:06 +0200
committerUros Bizjak <uros@gcc.gnu.org>2011-08-23 21:30:06 +0200
commit4aabfff650b1c1209b736bb09115812f2962c300 (patch)
tree72f4a0cc141b8d3d8340d9063759d85b446a498b /libgcc
parent5c16cb7fe4f5bb53725fcd4d58baa9a77293b65f (diff)
downloadgcc-4aabfff650b1c1209b736bb09115812f2962c300.zip
gcc-4aabfff650b1c1209b736bb09115812f2962c300.tar.gz
gcc-4aabfff650b1c1209b736bb09115812f2962c300.tar.bz2
sfp-machine.h (ASM_INVALID): New define.
* config/i386/64/sfp-machine.h (ASM_INVALID): New define. (ASM_DIVZERO): Ditto. (FP_HANLDE_EXCEPTIONS): Use ASM_INVALID and ASM_DIVZERO. From-SVN: r178007
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog6
-rw-r--r--libgcc/config/i386/64/sfp-machine.h12
2 files changed, 16 insertions, 2 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index ec575f0..a976693 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/64/sfp-machine.h (ASM_INVALID): New define.
+ (ASM_DIVZERO): Ditto.
+ (FP_HANLDE_EXCEPTIONS): Use ASM_INVALID and ASM_DIVZERO.
+
2011-06-27 Release Manager
* GCC 4.6.1 released.
diff --git a/libgcc/config/i386/64/sfp-machine.h b/libgcc/config/i386/64/sfp-machine.h
index 5adf6db..5186c24 100644
--- a/libgcc/config/i386/64/sfp-machine.h
+++ b/libgcc/config/i386/64/sfp-machine.h
@@ -79,17 +79,25 @@ struct fenv
unsigned short int __unused5;
};
+#ifdef __AVX__
+ #define ASM_INVALID "vdivss %0, %0, %0"
+ #define ASM_DIVZERO "vdivss %1, %0, %0"
+#else
+ #define ASM_INVALID "divss %0, %0"
+ #define ASM_DIVZERO "divss %1, %0"
+#endif
+
#define FP_HANDLE_EXCEPTIONS \
do { \
if (_fex & FP_EX_INVALID) \
{ \
float f = 0.0; \
- __asm__ __volatile__ ("divss %0, %0 " : : "x" (f)); \
+ __asm__ __volatile__ (ASM_INVALID : : "x" (f)); \
} \
if (_fex & FP_EX_DIVZERO) \
{ \
float f = 1.0, g = 0.0; \
- __asm__ __volatile__ ("divss %1, %0" : : "x" (f), "x" (g)); \
+ __asm__ __volatile__ (ASM_DIVZERO : : "x" (f), "x" (g)); \
} \
if (_fex & FP_EX_OVERFLOW) \
{ \