i386.c (output_387_ffreep): Create output from a template string for !HAVE_AS_IX86_FF...
authorUros Bizjak <uros@kss-loka.si>
Sat, 28 Oct 2006 09:20:23 +0000 (11:20 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sat, 28 Oct 2006 09:20:23 +0000 (11:20 +0200)
        * config/i386/i386.c (output_387_ffreep): Create output from a
        template string for !HAVE_AS_IX86_FFREEP.

From-SVN: r118101

gcc/ChangeLog
gcc/config/i386/i386.c

index 855dccbbcf3f5fd97162ead600e0cba1b718e865..d1d2e4e421d360b1659818353784fa15f206cbe0 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-28 Uros Bizjak <uros@kss-loka.si>
+
+       * config/i386/i386.c (output_387_ffreep): Create output from a
+       template string for !HAVE_AS_IX86_FFREEP.
+       
 2006-10-27  Eric Christopher  <echristo@apple.com>
 
        * config/darwin.c: Fix formatting and grammar.
index 41d76c3689f03310490504ece344293d57bf7766..14974ff1481eef1c7ec1bb3ecd27d669f080085d 100644 (file)
@@ -8698,17 +8698,15 @@ output_387_ffreep (rtx *operands ATTRIBUTE_UNUSED, int opno)
 #if HAVE_AS_IX86_FFREEP
     return opno ? "ffreep\t%y1" : "ffreep\t%y0";
 #else
-    switch (REGNO (operands[opno]))
-      {
-      case FIRST_STACK_REG + 0: return ".word\t0xc0df";
-      case FIRST_STACK_REG + 1: return ".word\t0xc1df";
-      case FIRST_STACK_REG + 2: return ".word\t0xc2df";
-      case FIRST_STACK_REG + 3: return ".word\t0xc3df";
-      case FIRST_STACK_REG + 4: return ".word\t0xc4df";
-      case FIRST_STACK_REG + 5: return ".word\t0xc5df";
-      case FIRST_STACK_REG + 6: return ".word\t0xc6df";
-      case FIRST_STACK_REG + 7: return ".word\t0xc7df";
-      }
+    {
+      static char retval[] = ".word\t0xc_df";
+      int regno = REGNO (operands[opno]);
+      
+      gcc_assert (FP_REGNO_P (regno));
+
+      retval[9] = '0' + (regno - FIRST_STACK_REG);
+      return retval;
+    }
 #endif
 
   return opno ? "fstp\t%y1" : "fstp\t%y0";