(movsf...
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 31 Oct 1994 21:18:02 +0000 (16:18 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 31 Oct 1994 21:18:02 +0000 (16:18 -0500)
(movsf, movdf, movxf): If we are moving floating point constants to a
non-memory location that aren't 0 or 1, assume we need the pic
register if -fpic.

From-SVN: r8372

gcc/config/i386/i386.md

index 89dca03941623447f53dd0b737718fa1e1709f0a..a4cfff591f527912f433e6cd7b253ab6011ac441 100644 (file)
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
     }
+
+  /* If we are loading a floating point constant that isn't 0 or 1 into a register,
+     indicate we need the pic register loaded.  This could be optimized into stores
+     of constants if the target eventually moves to memory, but better safe than
+     sorry.  */
+  if (flag_pic
+      && GET_CODE (operands[0]) != MEM
+      && GET_CODE (operands[1]) == CONST_DOUBLE
+      && !standard_80387_constant_p (operands[1]))
+    {
+      current_function_uses_pic_offset_table = 1;
+    }
 }")
 
 (define_insn "movsf_push_nomove"
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
     }
+
+  /* If we are loading a floating point constant that isn't 0 or 1 into a register,
+     indicate we need the pic register loaded.  This could be optimized into stores
+     of constants if the target eventually moves to memory, but better safe than
+     sorry.  */
+  if (flag_pic
+      && GET_CODE (operands[0]) != MEM
+      && GET_CODE (operands[1]) == CONST_DOUBLE
+      && !standard_80387_constant_p (operands[1]))
+    {
+      current_function_uses_pic_offset_table = 1;
+    }
 }")
 
 (define_insn "movdf_push_nomove"
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
     }
+
+  /* If we are loading a floating point constant that isn't 0 or 1 into a register,
+     indicate we need the pic register loaded.  This could be optimized into stores
+     of constants if the target eventually moves to memory, but better safe than
+     sorry.  */
+  if (flag_pic
+      && GET_CODE (operands[0]) != MEM
+      && GET_CODE (operands[1]) == CONST_DOUBLE
+      && !standard_80387_constant_p (operands[1]))
+    {
+      current_function_uses_pic_offset_table = 1;
+    }
 }")