about summary refs log tree commit diff
path: root/sysdeps/i386/fpu/bits/mathinline.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/fpu/bits/mathinline.h')
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index 9917316f7a..77b6cd5e51 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -39,36 +39,36 @@
    better code.  */
 #  define isgreater(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucomip; seta %%al"					      \
+	__asm__ ("fucomip %%st(1), %%st; seta %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
 	__result; })
 #  define isgreaterequal(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucomip; setae %%al"					      \
+	__asm__ ("fucomip %%st(1), %%st; setae %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
 	__result; })
 
 #  define isless(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucomip; setb %%al"					      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__asm__ ("fucomip %%st(1), %%st; seta %%al"			      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");	      \
 	__result; })
 
 #  define islessequal(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucomip; setbe %%al"					      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
+	__asm__ ("fucomip %%st(1), %%st; setae %%al"			      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st");	      \
 	__result; })
 
 #  define islessgreater(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucomip; setne %%al"					      \
+	__asm__ ("fucomip %%st(1), %%st; setne %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
 	__result; })
 
 #  define isunordered(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucomip; setp %%al"					      \
+	__asm__ ("fucomip %%st(1), %%st; setp %%al"			      \
 		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st");	      \
 	__result; })
 # else
@@ -87,14 +87,14 @@
 
 #  define isless(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; sahf; setb %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+	__asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
 	__result; })
 
 #  define islessequal(x, y) \
      ({ register char __result;						      \
-	__asm__ ("fucompp; fnstsw; sahf; setbe %%al"			      \
-		 : "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
+	__asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al"	      \
+		 : "=a" (__result) : "u" (x), "t" (y) : "cc", "st", "st(1)"); \
 	__result; })
 
 #  define islessgreater(x, y) \