sfp-machine.h (ASM_INVALID): New define.
authorUros Bizjak <ubizjak@gmail.com>
Mon, 22 Aug 2011 23:13:57 +0000 (01:13 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 22 Aug 2011 23:13:57 +0000 (01:13 +0200)
* config/i386/64/sfp-machine.h (ASM_INVALID): New define.
(ASM_DIVZERO): Ditto.
(FP_HANLDE_EXCEPTIONS): Use ASM_INVALID and ASM_DIVZERO.

From-SVN: r177978

libgcc/ChangeLog
libgcc/config/i386/64/sfp-machine.h

index 828f2c2e8f2f34a2c90ad1bf42ad32adeaa6e380..98f85ad3281afe916d311bad3ee60908de2a7a92 100644 (file)
@@ -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-08-18  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * config/arm/bpabi-lib.h (RENAME_LIBRARY_SET): Delete.
index 5debf5ae44ab32a895f16cef9541312c36160d42..7a2a4beaaaf416ef9c70da01e4b5e408ca0f8a06 100644 (file)
@@ -73,17 +73,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)                                         \
       {                                                                        \