constraints.md (Yf): New constraint.
authorUros Bizjak <uros@gcc.gnu.org>
Thu, 24 Jan 2013 13:03:40 +0000 (14:03 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 24 Jan 2013 13:03:40 +0000 (14:03 +0100)
* config/i386/constraints.md (Yf): New constraint.
* config/i386/i386.md (*movdf_internal_rex64): Use Yf*f instead
of f constraint to conditionaly disable x87 register preferences.
(*movdf_internal): Ditto.
(*movsf_internal): Ditto.

testsuite/ChangeLog:

* gcc.target/i386/movsd.c: New test.

From-SVN: r195423

gcc/ChangeLog
gcc/config/i386/constraints.md
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/movsd.c [new file with mode: 0644]

index eedd4d6d8dc97aa5e21de3830eff0ccfa877c093..6bacddc2de5d03ddce556f082a746202d48d17cc 100644 (file)
@@ -1,3 +1,11 @@
+2013-01-24  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/constraints.md (Yf): New constraint.
+       * config/i386/i386.md (*movdf_internal_rex64): Use Yf*f instead
+       of f constraint to conditionaly disable x87 register preferences.
+       (*movdf_internal): Ditto.
+       (*movsf_internal): Ditto.
+
 2013-01-24  Steven Bosscher  <steven@gcc.gnu.org>
 
        PR inline-asm/55934
@@ -8,11 +16,6 @@
        selected from constraints on asms is valid for the operand mode.
        (curr_insn_transform): Remove incorrect comment.
 
-2013-01-23  Uros Bizjak  <ubizjak@gmail.com>
-
-       * config/i386/i386.md (*movdf_internal_rex64): Disparage alternatives
-       involving stack registers slightly.
-
 2013-01-23  David Edelsohn  <dje.gcc@gmail.com>
 
        * config/rs6000/rs6000.c (rs6000_delegitimize_address): Check that
index c6e21f73d06d14e48df11d081717e1e32a53b532..d567fd786933afb747fef569c25d9e50e3324ad5 100644 (file)
@@ -93,6 +93,7 @@
 ;;  p  Integer register when TARGET_PARTIAL_REG_STALL is disabled
 ;;  d  Integer register when integer DFmode moves are enabled
 ;;  x  Integer register when integer XFmode moves are enabled
+;;  f  x87 register when 80387 floating point arithmetic is enabled
 
 (define_register_constraint "Yz" "TARGET_SSE ? SSE_FIRST_REG : NO_REGS"
  "First SSE register (@code{%xmm0}).")
  "optimize_function_for_speed_p (cfun) ? GENERAL_REGS : NO_REGS"
  "@internal Any integer register when integer XFmode moves are enabled.")
 
+(define_register_constraint "Yf"
+ "(ix86_fpmath & FPMATH_387) ? FLOAT_REGS : NO_REGS"
+ "@internal Any x87 register when 80387 FP arithmetic is enabled.")
+
 (define_constraint "z"
   "@internal Constant call address operand."
   (match_operand 0 "constant_call_address_operand"))
index f08229c9e1cbfb7ed8f3251fe7ae2cf9b9f4ab12..f09f769190d76e557e79da38c91fe6d02d3f40ba 100644 (file)
 
 (define_insn "*movdf_internal_rex64"
   [(set (match_operand:DF 0 "nonimmediate_operand"
-               "=?f,?m,?f,?r,?m,?r,x,x,x,m,Yi,r ")
+               "=Yf*f,m   ,Yf*f,?r ,?m,?r,x,x,x,m,Yi,r ")
        (match_operand:DF 1 "general_operand"
-               "fm ,f ,G ,rm,r ,F ,C,x,m,x,r ,Yi"))]
+               "Yf*fm,Yf*f,G   ,rmC,rC,F ,C,x,m,x,r ,Yi"))]
   "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
    && (!can_create_pseudo_p ()
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
 ;; Possible store forwarding (partial memory) stall in alternative 4.
 (define_insn "*movdf_internal"
   [(set (match_operand:DF 0 "nonimmediate_operand"
-               "=f,m,f,?Yd*r ,!o   ,x,x,x,m,*x,*x,*x,m")
+               "=Yf*f,m   ,Yf*f,?Yd*r ,!o   ,x,x,x,m,*x,*x,*x,m")
        (match_operand:DF 1 "general_operand"
-               "fm,f,G,Yd*roF,FYd*r,C,x,m,x,C ,*x,m ,*x"))]
+               "Yf*fm,Yf*f,G   ,Yd*roF,Yd*rF,C,x,m,x,C ,*x,m ,*x"))]
   "!TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
    && (!can_create_pseudo_p ()
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
 
 (define_insn "*movsf_internal"
   [(set (match_operand:SF 0 "nonimmediate_operand"
-         "=f,m,f,?r ,?m,x,x,x,m,!*y,!m,!*y,?Yi,?r,!*Ym,!r")
+         "=Yf*f,m   ,Yf*f,?r ,?m,x,x,x,m,!*y,!m,!*y,?Yi,?r,!*Ym,!r")
        (match_operand:SF 1 "general_operand"
-         "fm,f,G,rmF,Fr,C,x,m,x,m  ,*y,*y ,r  ,Yi,r   ,*Ym"))]
+         "Yf*fm,Yf*f,G   ,rmF,rF,C,x,m,x,m  ,*y,*y ,r  ,Yi,r   ,*Ym"))]
   "!(MEM_P (operands[0]) && MEM_P (operands[1]))
    && (!can_create_pseudo_p ()
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
index 9dda502e093228cfd5bc61031ac025b7112e9e4b..a2d07aecff366b4b04ce1bb26d8ee834a715f3e2 100644 (file)
@@ -1,3 +1,7 @@
+2013-01-24  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.target/i386/movsd.c: New test.
+
 2013-01-24  Steven Bosscher  <steven@gcc.gnu.org>
 
        PR inline-asm/55934
@@ -8,9 +12,10 @@
        PR fortran/56081
        * gfortran.dg/select_8.f90: New.
 
-2013-01-23  David Holsgrove <david.holsgrove@xilinx.com>
+2013-01-23  David Holsgrove  <david.holsgrove@xilinx.com>
 
-       * gcc.target/microblaze/microblaze.exp: Remove target_config_cflags check
+       * gcc.target/microblaze/microblaze.exp: Remove
+       target_config_cflags check.
 
 2013-01-23  Jakub Jelinek  <jakub@redhat.com>
 
diff --git a/gcc/testsuite/gcc.target/i386/movsd.c b/gcc/testsuite/gcc.target/i386/movsd.c
new file mode 100644 (file)
index 0000000..32a19e7
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse2 -mfpmath=sse" } */
+
+volatile double y;
+
+void
+test ()
+{
+  int z;
+
+  for (z = 0; z < 1000; z++)
+    y = 1.23;
+}
+
+/* { dg-final { scan-assembler-not "(fld|fst)" } } */