i386.h (X87_FLOAT_MODE_P): Check for TARGET_80387.
authorUros Bizjak <ubizjak@gmail.com>
Fri, 13 Apr 2007 08:14:57 +0000 (10:14 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 13 Apr 2007 08:14:57 +0000 (10:14 +0200)
        * config/i386/i386.h (X87_FLOAT_MODE_P): Check for TARGET_80387.
        * config/i386/i386.md (*cmpfp0): Remove check for TARGET_80387, this
        check is now implied in X87_FLOAT_MODE_P.
        (*cmpfp_u, *cmpfp_<mode>, *cmpfp_i_i387): Ditto.
        (*cmpfp_iu_387, fix_trunc<mode>_fisttp_i386_1): Ditto.
        (fix_trunc<mode>_i386_fisttp): Ditto.
        (fix_trunc<mode>_i387_fisttp_with_temp): Ditto.
        (*fix_trunc<mode>_i387_1, fix_truncdi_i387): Ditto.
        (fix_truncdi_i387_with_temp, fix_trunc<mode>_i387): Ditto.
        (fix_trunc<mode>_i387_with_temp, *fp_jcc_1_387): Ditto.
        (*fp_jcc_2_387, *fp_jcc_5_387, *fp_jcc_6_387): Ditto.
        (*fp_jcc_7_387, *fp_jcc_8<mode>_387): Ditto.
        (unnamed_splitters): Ditto.
        * config/i386/i386.c (function_value_32): Generate FIRST_FLOAT_REG
        for X87_FLOAT_MODE_P mode.  Override FIRST_FLOAT_REG with
        FIRST_SSE_REG for local functions when SSE math is enabled or
        for functions with sseregparm attribute.
        (standard_80387_constant_p): Return -1 if mode is not
        X87_FLOAT_MODE_P.
        (ix86_cc_mode): Assert that scalar mode is not DECIMAL_FLOAT_MODE_P.
        (ix86_expand_compare): Ditto.
        (ix86_expand_carry_flag_compare): Ditto.
        (ix86_expand_int_movcc): Check for SCALAR_FLOAT_MODE_P instead
        of FLOAT_MODE_P for cmp_mode and assert that cmp_mode is not
        DECIMAL_FLOAT_MODE_P.
        (ix86_preferred_output_reload_class): Use X87_FLOAT_MODE_P instead
        of SCALAR_FLOAT_MODE_P.
        (ix86_rtx_costs) [PLUS] Remove FLOAT_MODE_P and fall through to ...
        [MINUS]: ... here.  Add SSE_FLOAT_MODE_P and X87_FLOAT_MODE_P
        checks before FLOAT_MODE_P.
        [MULT]: Add SSE_FLOAT_MODE_P and X87_FLOAT_MODE_P checks
        before FLOAT_MODE_P.
        [DIV]: Ditto.
        [NEG]: Ditto.
        [ABS]: Ditto.
        [SQRT]: Ditto.
        [FLOAT_EXTEND]: Use SSE_FLOAT_MODE_P.

From-SVN: r123777

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md

index 86b2990..fb9a733 100644 (file)
@@ -1,3 +1,43 @@
+2007-04-13  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/i386.h (X87_FLOAT_MODE_P): Check for TARGET_80387.
+       * config/i386/i386.md (*cmpfp0): Remove check for TARGET_80387, this
+       check is now implied in X87_FLOAT_MODE_P.
+       (*cmpfp_u, *cmpfp_<mode>, *cmpfp_i_i387): Ditto.
+       (*cmpfp_iu_387, fix_trunc<mode>_fisttp_i386_1): Ditto.
+       (fix_trunc<mode>_i386_fisttp): Ditto.
+       (fix_trunc<mode>_i387_fisttp_with_temp): Ditto.
+       (*fix_trunc<mode>_i387_1, fix_truncdi_i387): Ditto.
+       (fix_truncdi_i387_with_temp, fix_trunc<mode>_i387): Ditto.
+       (fix_trunc<mode>_i387_with_temp, *fp_jcc_1_387): Ditto.
+       (*fp_jcc_2_387, *fp_jcc_5_387, *fp_jcc_6_387): Ditto.
+       (*fp_jcc_7_387, *fp_jcc_8<mode>_387): Ditto.
+       (unnamed_splitters): Ditto.
+       * config/i386/i386.c (function_value_32): Generate FIRST_FLOAT_REG
+       for X87_FLOAT_MODE_P mode.  Override FIRST_FLOAT_REG with
+       FIRST_SSE_REG for local functions when SSE math is enabled or
+       for functions with sseregparm attribute.
+       (standard_80387_constant_p): Return -1 if mode is not
+       X87_FLOAT_MODE_P.
+       (ix86_cc_mode): Assert that scalar mode is not DECIMAL_FLOAT_MODE_P.
+       (ix86_expand_compare): Ditto.
+       (ix86_expand_carry_flag_compare): Ditto.
+       (ix86_expand_int_movcc): Check for SCALAR_FLOAT_MODE_P instead
+       of FLOAT_MODE_P for cmp_mode and assert that cmp_mode is not
+       DECIMAL_FLOAT_MODE_P.
+       (ix86_preferred_output_reload_class): Use X87_FLOAT_MODE_P instead
+       of SCALAR_FLOAT_MODE_P.
+       (ix86_rtx_costs) [PLUS] Remove FLOAT_MODE_P and fall through to ...
+       [MINUS]: ... here.  Add SSE_FLOAT_MODE_P and X87_FLOAT_MODE_P
+       checks before FLOAT_MODE_P.
+       [MULT]: Add SSE_FLOAT_MODE_P and X87_FLOAT_MODE_P checks
+       before FLOAT_MODE_P.
+       [DIV]: Ditto.
+       [NEG]: Ditto.
+       [ABS]: Ditto.
+       [SQRT]: Ditto.
+       [FLOAT_EXTEND]: Use SSE_FLOAT_MODE_P.
+
 2007-04-12  Paolo Bonzini  <bonzini@gnu.org>
             Charles Wilson  <libtool@cwilson.fastmail.fm>
 
index 1acca3b..a964b6a 100644 (file)
@@ -4181,27 +4181,21 @@ function_value_32 (enum machine_mode orig_mode, enum machine_mode mode,
           || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16))
     regno = TARGET_SSE ? FIRST_SSE_REG : 0;
 
-  /* Decimal floating point values can go in %eax, unlike other float modes.  */
-  else if (DECIMAL_FLOAT_MODE_P (mode))
-    regno = 0;
-
-  /* Most things go in %eax, except (unless -mno-fp-ret-in-387) fp values.  */
-  else if (!SCALAR_FLOAT_MODE_P (mode) || !TARGET_FLOAT_RETURNS_IN_80387)
+  /* Floating point return values in %st(0) (unless -mno-fp-ret-in-387).  */
+  else if (X87_FLOAT_MODE_P (mode) && TARGET_FLOAT_RETURNS_IN_80387)
+    regno = FIRST_FLOAT_REG;
+  else
+    /* Most things go in %eax.  */
     regno = 0;
-
-  /* Floating point return values in %st(0), except for local functions when
+  
+  /* Override FP return register with %xmm0 for local functions when
      SSE math is enabled or for functions with sseregparm attribute.  */
-  else
+  if ((fn || fntype) && (mode == SFmode || mode == DFmode))
     {
-      regno = FIRST_FLOAT_REG;
-
-      if ((fn || fntype) && (mode == SFmode || mode == DFmode))
-       {
-         int sse_level = ix86_function_sseregparm (fntype, fn);
-         if ((sse_level >= 1 && mode == SFmode)
-             || (sse_level == 2 && mode == DFmode))
-           regno = FIRST_SSE_REG;
-       }
+      int sse_level = ix86_function_sseregparm (fntype, fn);
+      if ((sse_level >= 1 && mode == SFmode)
+         || (sse_level == 2 && mode == DFmode))
+       regno = FIRST_SSE_REG;
     }
 
   return gen_rtx_REG (orig_mode, regno);
@@ -4976,21 +4970,23 @@ init_ext_80387_constants (void)
 int
 standard_80387_constant_p (rtx x)
 {
+  enum machine_mode mode = GET_MODE (x);
+
   REAL_VALUE_TYPE r;
 
-  if (GET_CODE (x) != CONST_DOUBLE || !FLOAT_MODE_P (GET_MODE (x)))
+  if (!(X87_FLOAT_MODE_P (mode) && (GET_CODE (x) == CONST_DOUBLE)))
     return -1;
 
-  if (x == CONST0_RTX (GET_MODE (x)))
+  if (x == CONST0_RTX (mode))
     return 1;
-  if (x == CONST1_RTX (GET_MODE (x)))
+  if (x == CONST1_RTX (mode))
     return 2;
 
   REAL_VALUE_FROM_CONST_DOUBLE (r, x);
 
   /* For XFmode constants, try to find a special 80387 instruction when
      optimizing for size or on those CPUs that benefit from them.  */
-  if (GET_MODE (x) == XFmode
+  if (mode == XFmode
       && (optimize_size || TARGET_EXT_80387_CONSTANTS))
     {
       int i;
@@ -10683,8 +10679,14 @@ ix86_fp_compare_mode (enum rtx_code code ATTRIBUTE_UNUSED)
 enum machine_mode
 ix86_cc_mode (enum rtx_code code, rtx op0, rtx op1)
 {
-  if (SCALAR_FLOAT_MODE_P (GET_MODE (op0)))
-    return ix86_fp_compare_mode (code);
+  enum machine_mode mode = GET_MODE (op0);
+
+  if (SCALAR_FLOAT_MODE_P (mode))
+    {
+      gcc_assert (!DECIMAL_FLOAT_MODE_P (mode));
+      return ix86_fp_compare_mode (code);
+    }
+
   switch (code)
     {
       /* Only zero flag is needed.  */
@@ -11269,8 +11271,11 @@ ix86_expand_compare (enum rtx_code code, rtx *second_test, rtx *bypass_test)
       ix86_compare_emitted = NULL_RTX;
     }
   else if (SCALAR_FLOAT_MODE_P (GET_MODE (op0)))
-    ret = ix86_expand_fp_compare (code, op0, op1, NULL_RTX,
-                                 second_test, bypass_test);
+    {
+      gcc_assert (!DECIMAL_FLOAT_MODE_P (GET_MODE (op0)));
+      ret = ix86_expand_fp_compare (code, op0, op1, NULL_RTX,
+                                   second_test, bypass_test);
+    }
   else
     ret = ix86_expand_int_compare (code, op0, op1);
 
@@ -11631,16 +11636,20 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop)
   enum machine_mode mode =
     GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
 
-  /* Do not handle DImode compares that go through special path.  Also we can't
-     deal with FP compares yet.  This is possible to add.  */
+  /* Do not handle DImode compares that go through special path.
+     Also we can't deal with FP compares yet.  This is possible to add.  */
   if (mode == (TARGET_64BIT ? TImode : DImode))
     return false;
-  if (FLOAT_MODE_P (mode))
+
+  if (SCALAR_FLOAT_MODE_P (mode))
     {
       rtx second_test = NULL, bypass_test = NULL;
       rtx compare_op, compare_seq;
 
-      /* Shortcut:  following common codes never translate into carry flag compares.  */
+      gcc_assert (!DECIMAL_FLOAT_MODE_P (mode));
+
+      /* Shortcut:  following common codes never translate
+        into carry flag compares.  */
       if (code == EQ || code == NE || code == UNEQ || code == LTGT
          || code == ORDERED || code == UNORDERED)
        return false;
@@ -11929,11 +11938,16 @@ ix86_expand_int_movcc (rtx operands[])
 
       if (diff < 0)
        {
+         enum machine_mode cmp_mode = GET_MODE (ix86_compare_op0);
+
          HOST_WIDE_INT tmp;
          tmp = ct, ct = cf, cf = tmp;
          diff = -diff;
-         if (FLOAT_MODE_P (GET_MODE (ix86_compare_op0)))
+
+         if (SCALAR_FLOAT_MODE_P (cmp_mode))
            {
+             gcc_assert (!DECIMAL_FLOAT_MODE_P (cmp_mode));
+
              /* We may be reversing unordered compare to normal compare, that
                 is not valid in general (we may convert non-trapping condition
                 to trapping one), however on i386 we currently emit all
@@ -12082,14 +12096,21 @@ ix86_expand_int_movcc (rtx operands[])
        {
          if (cf == 0)
            {
+             enum machine_mode cmp_mode = GET_MODE (ix86_compare_op0);
+
              cf = ct;
              ct = 0;
-             if (FLOAT_MODE_P (GET_MODE (ix86_compare_op0)))
-               /* We may be reversing unordered compare to normal compare,
-                  that is not valid in general (we may convert non-trapping
-                  condition to trapping one), however on i386 we currently
-                  emit all comparisons unordered.  */
-               code = reverse_condition_maybe_unordered (code);
+
+             if (SCALAR_FLOAT_MODE_P (cmp_mode))
+               {
+                 gcc_assert (!DECIMAL_FLOAT_MODE_P (cmp_mode));
+
+                 /* We may be reversing unordered compare to normal compare,
+                    that is not valid in general (we may convert non-trapping
+                    condition to trapping one), however on i386 we currently
+                    emit all comparisons unordered.  */
+                 code = reverse_condition_maybe_unordered (code);
+               }
              else
                {
                  code = reverse_condition (code);
@@ -18863,7 +18884,7 @@ ix86_preferred_output_reload_class (rtx x, enum reg_class class)
   if (TARGET_SSE_MATH && SSE_FLOAT_MODE_P (mode))
     return MAYBE_SSE_CLASS_P (class) ? SSE_REGS : NO_REGS;
 
-  if (TARGET_80387 && SCALAR_FLOAT_MODE_P (mode))
+  if (X87_FLOAT_MODE_P (mode))
     {
       if (class == FP_TOP_SSE_REGS)
        return FP_TOP_REG;
@@ -19348,8 +19369,20 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
       return false;
 
     case MULT:
-      if (FLOAT_MODE_P (mode))
+      if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
+       {
+         /* ??? SSE scalar cost should be used here.  */
+         *total = ix86_cost->fmul;
+         return false;
+       }
+      else if (X87_FLOAT_MODE_P (mode))
+       {
+         *total = ix86_cost->fmul;
+         return false;
+       }
+      else if (FLOAT_MODE_P (mode))
        {
+         /* ??? SSE vector cost should be used here.  */
          *total = ix86_cost->fmul;
          return false;
        }
@@ -19402,16 +19435,20 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
     case UDIV:
     case MOD:
     case UMOD:
-      if (FLOAT_MODE_P (mode))
+      if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
+       /* ??? SSE cost should be used here.  */
+       *total = ix86_cost->fdiv;
+      else if (X87_FLOAT_MODE_P (mode))
+       *total = ix86_cost->fdiv;
+      else if (FLOAT_MODE_P (mode))
+       /* ??? SSE vector cost should be used here.  */
        *total = ix86_cost->fdiv;
       else
        *total = ix86_cost->divide[MODE_INDEX (mode)];
       return false;
 
     case PLUS:
-      if (FLOAT_MODE_P (mode))
-       *total = ix86_cost->fadd;
-      else if (GET_MODE_CLASS (mode) == MODE_INT
+      if (GET_MODE_CLASS (mode) == MODE_INT
               && GET_MODE_BITSIZE (mode) <= GET_MODE_BITSIZE (Pmode))
        {
          if (GET_CODE (XEXP (x, 0)) == PLUS
@@ -19454,11 +19491,23 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
       /* FALLTHRU */
 
     case MINUS:
-      if (FLOAT_MODE_P (mode))
+      if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
+       {
+         /* ??? SSE cost should be used here.  */
+         *total = ix86_cost->fadd;
+         return false;
+       }
+      else if (X87_FLOAT_MODE_P (mode))
        {
          *total = ix86_cost->fadd;
          return false;
        }
+      else if (FLOAT_MODE_P (mode))
+       {
+         /* ??? SSE vector cost should be used here.  */
+         *total = ix86_cost->fadd;
+         return false;
+       }
       /* FALLTHRU */
 
     case AND:
@@ -19476,8 +19525,20 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
       /* FALLTHRU */
 
     case NEG:
-      if (FLOAT_MODE_P (mode))
+      if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
+       {
+         /* ??? SSE cost should be used here.  */
+         *total = ix86_cost->fchs;
+         return false;
+       }
+      else if (X87_FLOAT_MODE_P (mode))
+       {
+         *total = ix86_cost->fchs;
+         return false;
+       }
+      else if (FLOAT_MODE_P (mode))
        {
+         /* ??? SSE vector cost should be used here.  */
          *total = ix86_cost->fchs;
          return false;
        }
@@ -19506,19 +19567,29 @@ ix86_rtx_costs (rtx x, int code, int outer_code, int *total)
       return false;
 
     case FLOAT_EXTEND:
-      if (!TARGET_SSE_MATH
-         || mode == XFmode
-         || (mode == DFmode && !TARGET_SSE2))
+      if (!(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH))
        *total = 0;
       return false;
 
     case ABS:
-      if (FLOAT_MODE_P (mode))
+      if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
+       /* ??? SSE cost should be used here.  */
+       *total = ix86_cost->fabs;
+      else if (X87_FLOAT_MODE_P (mode))
+       *total = ix86_cost->fabs;
+      else if (FLOAT_MODE_P (mode))
+       /* ??? SSE vector cost should be used here.  */
        *total = ix86_cost->fabs;
       return false;
 
     case SQRT:
-      if (FLOAT_MODE_P (mode))
+      if (SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)
+       /* ??? SSE cost should be used here.  */
+       *total = ix86_cost->fsqrt;
+      else if (X87_FLOAT_MODE_P (mode))
+       *total = ix86_cost->fsqrt;
+      else if (FLOAT_MODE_P (mode))
+       /* ??? SSE vector cost should be used here.  */
        *total = ix86_cost->fsqrt;
       return false;
 
index 859bcee..0ed9c12 100644 (file)
@@ -1363,9 +1363,7 @@ enum reg_class
 #define ANY_FP_REGNO_P(N) (FP_REGNO_P (N) || SSE_REGNO_P (N))
 
 #define X87_FLOAT_MODE_P(MODE) \
-  ((MODE) == SFmode            \
-   || (MODE) == DFmode         \
-   || (MODE) == XFmode)
+  (TARGET_80387 && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode))
 
 #define SSE_REG_P(N) (REG_P (N) && SSE_REGNO_P (REGNO (N)))
 #define SSE_REGNO_P(N)                                         \
index 6aa4843..b306e05 100644 (file)
             (match_operand 1 "register_operand" "f")
             (match_operand 2 "const0_operand" "X"))]
        UNSPEC_FNSTSW))]
-  "TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])"
   "* return output_fp_compare (insn, operands, 0, 0);"
   [(set_attr "type" "multi")
             (match_operand 1 "register_operand" "f")
             (match_operand 2 "register_operand" "f"))]
          UNSPEC_FNSTSW))]
-  "TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])"
   "* return output_fp_compare (insn, operands, 0, 1);"
   [(set_attr "type" "multi")
             (match_operator 3 "float_operator"
               [(match_operand:X87MODEI12 2 "memory_operand" "m")]))]
          UNSPEC_FNSTSW))]
-  "TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && TARGET_USE_<MODE>MODE_FIOP
    && (GET_MODE (operands [3]) == GET_MODE (operands[1]))"
   "* return output_fp_compare (insn, operands, 0, 0);"
   [(set_attr "type" "multi")
   [(set (reg:CCFP FLAGS_REG)
        (compare:CCFP (match_operand 0 "register_operand" "f")
                      (match_operand 1 "register_operand" "f")))]
-  "TARGET_80387 && TARGET_CMOVE
+  "X87_FLOAT_MODE_P (GET_MODE (operands[0]))
+   && TARGET_CMOVE
    && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0])))
-   && X87_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
   "* return output_fp_compare (insn, operands, 1, 0);"
   [(set_attr "type" "fcmp")
   [(set (reg:CCFPU FLAGS_REG)
        (compare:CCFPU (match_operand 0 "register_operand" "f")
                       (match_operand 1 "register_operand" "f")))]
-  "TARGET_80387 && TARGET_CMOVE
+  "X87_FLOAT_MODE_P (GET_MODE (operands[0]))
+   && TARGET_CMOVE
    && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0])))
-   && X87_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
   "* return output_fp_compare (insn, operands, 1, 1);"
   [(set_attr "type" "fcmp")
 (define_insn_and_split "fix_trunc<mode>_fisttp_i387_1"
   [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r")
        (fix:X87MODEI (match_operand 1 "register_operand" "f,f")))]
-  "TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && TARGET_FISTTP
    && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1]))
         && (TARGET_64BIT || <MODE>mode != DImode))
        && TARGET_SSE_MATH)
   [(set (match_operand:X87MODEI 0 "memory_operand" "=m")
        (fix:X87MODEI (match_operand 1 "register_operand" "f")))
    (clobber (match_scratch:XF 2 "=&1f"))]
-  "TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && TARGET_FISTTP
    && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1]))
         && (TARGET_64BIT || <MODE>mode != DImode))
        && TARGET_SSE_MATH)"
        (fix:X87MODEI (match_operand 1 "register_operand" "f,f")))
    (clobber (match_operand:X87MODEI 2 "memory_operand" "=m,m"))
    (clobber (match_scratch:XF 3 "=&1f,&1f"))]
-  "TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && TARGET_FISTTP
    && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1]))
        && (TARGET_64BIT || <MODE>mode != DImode))
        && TARGET_SSE_MATH)"
   [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r")
        (fix:X87MODEI (match_operand 1 "register_operand" "f,f")))
    (clobber (reg:CC FLAGS_REG))]
-  "TARGET_80387 && !TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && !TARGET_FISTTP
    && !(SSE_FLOAT_MODE_P (GET_MODE (operands[1]))
         && (TARGET_64BIT || <MODE>mode != DImode))
    && !(reload_completed || reload_in_progress)"
    (use (match_operand:HI 2 "memory_operand" "m"))
    (use (match_operand:HI 3 "memory_operand" "m"))
    (clobber (match_scratch:XF 4 "=&1f"))]
-  "TARGET_80387 && !TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && !TARGET_FISTTP
    && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))"
   "* return output_fix_trunc (insn, operands, 0);"
   [(set_attr "type" "fistp")
    (use (match_operand:HI 3 "memory_operand" "m,m"))
    (clobber (match_operand:DI 4 "memory_operand" "=m,m"))
    (clobber (match_scratch:XF 5 "=&1f,&1f"))]
-  "TARGET_80387 && !TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && !TARGET_FISTTP
    && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))"
   "#"
   [(set_attr "type" "fistp")
        (fix:X87MODEI12 (match_operand 1 "register_operand" "f")))
    (use (match_operand:HI 2 "memory_operand" "m"))
    (use (match_operand:HI 3 "memory_operand" "m"))]
-  "TARGET_80387 && !TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && !TARGET_FISTTP
    && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))"
   "* return output_fix_trunc (insn, operands, 0);"
   [(set_attr "type" "fistp")
    (use (match_operand:HI 2 "memory_operand" "m,m"))
    (use (match_operand:HI 3 "memory_operand" "m,m"))
    (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))]
-  "TARGET_80387 && !TARGET_FISTTP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && !TARGET_FISTTP
    && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))"
   "#"
   [(set_attr "type" "fistp")
   [(set (match_operand 0 "fp_register_operand" "")
        (float (match_operand 1 "register_operand" "")))]
   "reload_completed
-   && TARGET_80387
    && X87_FLOAT_MODE_P (GET_MODE (operands[0]))"
   [(const_int 0)]
 {
          (pc)))
    (clobber (reg:CCFP FPSR_REG))
    (clobber (reg:CCFP FLAGS_REG))]
-  "TARGET_CMOVE && TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && TARGET_CMOVE
    && GET_MODE (operands[1]) == GET_MODE (operands[2])
    && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))"
   "#")
          (label_ref (match_operand 3 "" ""))))
    (clobber (reg:CCFP FPSR_REG))
    (clobber (reg:CCFP FLAGS_REG))]
-  "TARGET_CMOVE && TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+   && TARGET_CMOVE
    && GET_MODE (operands[1]) == GET_MODE (operands[2])
    && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))"
   "#")
    (clobber (reg:CCFP FPSR_REG))
    (clobber (reg:CCFP FLAGS_REG))
    (clobber (match_scratch:HI 4 "=a"))]
-  "TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])
    && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))"
   "#")
    (clobber (reg:CCFP FPSR_REG))
    (clobber (reg:CCFP FLAGS_REG))
    (clobber (match_scratch:HI 4 "=a"))]
-  "TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])
    && ix86_fp_jump_nontrivial_p (GET_CODE (operands[0]))"
   "#")
    (clobber (reg:CCFP FPSR_REG))
    (clobber (reg:CCFP FLAGS_REG))
    (clobber (match_scratch:HI 4 "=a"))]
-  "TARGET_80387
-   && X87_FLOAT_MODE_P (GET_MODE (operands[1]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])
    && !ix86_use_fcomi_compare (GET_CODE (operands[0]))
    && SELECT_CC_MODE (GET_CODE (operands[0]),
    (clobber (reg:CCFP FPSR_REG))
    (clobber (reg:CCFP FLAGS_REG))
    (clobber (match_scratch:HI 5 "=a,a"))]
-  "TARGET_80387 && TARGET_USE_<MODE>MODE_FIOP
-   && X87_FLOAT_MODE_P (GET_MODE (operands[3]))
+  "X87_FLOAT_MODE_P (GET_MODE (operands[3]))
+   && TARGET_USE_<MODE>MODE_FIOP
    && GET_MODE (operands[1]) == GET_MODE (operands[3])
    && !ix86_use_fcomi_compare (swap_condition (GET_CODE (operands[0])))
    && ix86_fp_compare_mode (swap_condition (GET_CODE (operands[0]))) == CCFPmode
        (match_operator 3 "binary_fp_operator"
           [(float (match_operand:X87MODEI12 1 "register_operand" ""))
            (match_operand 2 "register_operand" "")]))]
-  "TARGET_80387 && reload_completed
+  "reload_completed
    && X87_FLOAT_MODE_P (GET_MODE (operands[0]))"
   [(const_int 0)]
 {
        (match_operator 3 "binary_fp_operator"
           [(match_operand 1 "register_operand" "")
            (float (match_operand:X87MODEI12 2 "register_operand" ""))]))]
-  "TARGET_80387 && reload_completed
+  "reload_completed
    && X87_FLOAT_MODE_P (GET_MODE (operands[0]))"
   [(const_int 0)]
 {