]> gcc.gnu.org Git - gcc.git/commitdiff
i386.md (attribute mode): Add "TI".
authorJan Hubicka <jh@suse.cz>
Wed, 28 Feb 2001 18:19:23 +0000 (19:19 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 28 Feb 2001 18:19:23 +0000 (18:19 +0000)
* i386.md (attribute mode): Add "TI".
(movsf_1): Add pxor support; remove constant propagation splitter.
(movdf_integer): Likewise.
(movdf_nointeger): Likewise.
(movxf constant prop splitter): Handle all modes; update for SSE.
* i386.h (CONST_DOUBLE_OK_FOR_LETTER): Add 'H' for SSE constants.
* i386.c (standard_80387_constant_p): Rewrite.
(standard_sse_constant_p): New.
* i386-protos.h (standard_sse_constant_p): New.

From-SVN: r40132

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

index 193ed5a925274ee2348f53d71fc5d82bb67373cd..e42a4063e4e97fe79278773e77cef88e1cc4ac7a 100644 (file)
@@ -1,3 +1,15 @@
+Wed Feb 28 19:18:23 CET 2001  Jan Hubicka  <jh@suse.cz>
+
+       * i386.md (attribute mode): Add "TI".
+       (movsf_1): Add pxor support; remove constant propagation splitter.
+       (movdf_integer): Likewise.
+       (movdf_nointeger): Likewise.
+       (movxf constant prop splitter): Handle all modes; update for SSE.
+       * i386.h (CONST_DOUBLE_OK_FOR_LETTER): Add 'H' for SSE constants.
+       * i386.c (standard_80387_constant_p): Rewrite.
+       (standard_sse_constant_p): New.
+       * i386-protos.h (standard_sse_constant_p): New.
+
 Wed Feb 28 19:05:37 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (sse_setccsf, sse_setccdf): New.
index df3fb5a364e5ec9e460efc724aa4ee83671fda6d..60b2998100e88d74bd1d9cc1fdc457cd6d089848 100644 (file)
@@ -40,6 +40,7 @@ extern void ix86_output_block_profiler PARAMS ((FILE *, int));
 extern int ix86_aligned_p PARAMS ((rtx));
 
 extern int standard_80387_constant_p PARAMS ((rtx));
+extern int standard_sse_constant_p PARAMS ((rtx));
 extern int symbolic_reference_mentioned_p PARAMS ((rtx));
 
 extern int const_int_1_operand PARAMS ((rtx, enum machine_mode));
index 7ae13f9cd141262157f306b39d7acdc061ca3621..88ba6d1e42fe80f12888aaeb9144fc0caa60df2c 100644 (file)
@@ -1644,40 +1644,29 @@ int
 standard_80387_constant_p (x)
      rtx x;
 {
-  if (GET_CODE (x) != CONST_DOUBLE)
+  if (GET_CODE (x) != CONST_DOUBLE || !FLOAT_MODE_P (GET_MODE (x)))
     return -1;
-
-#if ! defined (REAL_IS_NOT_DOUBLE) || defined (REAL_ARITHMETIC)
-  {
-    REAL_VALUE_TYPE d;
-    jmp_buf handler;
-    int is0, is1;
-
-    if (setjmp (handler))
-      return 0;
-
-    set_float_handler (handler);
-    REAL_VALUE_FROM_CONST_DOUBLE (d, x);
-    is0 = REAL_VALUES_EQUAL (d, dconst0) && !REAL_VALUE_MINUS_ZERO (d);
-    is1 = REAL_VALUES_EQUAL (d, dconst1);
-    set_float_handler (NULL_PTR);
-
-    if (is0)
-      return 1;
-
-    if (is1)
-      return 2;
-
-    /* Note that on the 80387, other constants, such as pi,
-       are much slower to load as standard constants
-       than to load from doubles in memory!  */
-    /* ??? Not true on K6: all constants are equal cost.  */
-  }
-#endif
-
+  /* Note that on the 80387, other constants, such as pi, that we should support
+     too.  On some machines, these are much slower to load as standard constant,
+     than to load from doubles in memory.  */
+  if (x == CONST0_RTX (GET_MODE (x)))
+    return 1;
+  if (x == CONST1_RTX (GET_MODE (x)))
+    return 2;
   return 0;
 }
 
+/* Return 1 if X is FP constant we can load to SSE register w/o using memory.
+ */
+int
+standard_sse_constant_p (x)
+     rtx x;
+{
+  if (GET_CODE (x) != CONST_DOUBLE)
+    return -1;
+  return (x == CONST0_RTX (GET_MODE (x)));
+}
+
 /* Returns 1 if OP contains a symbol reference */
 
 int
index 1ba6118bdeba8c76b27a8c28ee44c1274dbed2d7..1086757b5300338bed067e7d43c8e25c6da5084d 100644 (file)
@@ -1136,7 +1136,8 @@ enum reg_class
    load 0.0 into the function value register.  */
 
 #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C)  \
-  ((C) == 'G' ? standard_80387_constant_p (VALUE) : 0)
+  ((C) == 'G' ? standard_80387_constant_p (VALUE) \
+   : ((C) == 'H' ? standard_sse_constant_p (VALUE) : 0))
 
 /* Place additional restrictions on the register class to use when it
    is necessary to be able to hold a value of mode MODE in a reload
index 38d035efea36b12114f8bd12daf278689d013062..d6a751e1299d562e84b1ad609c8f7d611ce791b6 100644 (file)
   (const_string "other"))
 
 ;; Main data type used by the insn
-(define_attr "mode" "unknown,none,QI,HI,SI,DI,unknownfp,SF,DF,XF"
+(define_attr "mode" "unknown,none,QI,HI,SI,DI,unknownfp,SF,DF,XF,TI"
   (const_string "unknown"))
 
 ;; Set for i387 operations.
    (set (mem:SF (reg:SI 7)) (match_dup 1))])
 
 (define_insn "*movsf_1"
-  [(set (match_operand:SF 0 "nonimmediate_operand" "=f#xr,m,f#xr,r#xf,m,x#rf,m")
-       (match_operand:SF 1 "general_operand" "fm#rx,f#rx,G,rmF#fx,Fr#fx,xm#rf,x#rf"))]
+  [(set (match_operand:SF 0 "nonimmediate_operand" "=f#xr,m,f#xr,r#xf,m,x#rf,x#rf,x#rf,m")
+       (match_operand:SF 1 "general_operand" "fm#rx,f#rx,G,rmF#fx,Fr#fx,H,x,xm#rf,x#rf"))]
   "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
    && (reload_in_progress || reload_completed
        || GET_CODE (operands[1]) != CONST_DOUBLE
     case 4:
       return \"mov{l}\\t{%1, %0|%0, %1}\";
     case 5:
+      return \"pxor\\t%0, %0\";
     case 6:
-      if (TARGET_PARTIAL_REG_DEPENDENCY
-         && register_operand (operands[0], VOIDmode)
-         && register_operand (operands[1], VOIDmode))
+      if (TARGET_PARTIAL_REG_DEPENDENCY)
        return \"movaps\\t{%1, %0|%0, %1}\";
+      else
+       return \"movss\\t{%1, %0|%0, %1}\";
+    case 7:
+    case 8:
       return \"movss\\t{%1, %0|%0, %1}\";
 
     default:
       abort();
     }
 }"
-  [(set_attr "type" "fmov,fmov,fmov,imov,imov,sse,sse")
-   (set_attr "mode" "SF,SF,SF,SI,SI,SF,SF")])
-
-(define_split
-  [(set (match_operand:SF 0 "nonimmediate_operand" "")
-       (match_operand:SF 1 "memory_operand" ""))]
-  "reload_completed
-   && GET_CODE (operands[1]) == MEM
-   && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
-   && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))
-   && !(SSE_REG_P (operands[0]) 
-        || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))
-   && (!(FP_REG_P (operands[0]) || 
-        (GET_CODE (operands[0]) == SUBREG
-         && FP_REG_P (SUBREG_REG (operands[0]))))
-       || standard_80387_constant_p (get_pool_constant (XEXP (operands[1], 0))))"
-  [(set (match_dup 0)
-       (match_dup 1))]
-  "operands[1] = get_pool_constant (XEXP (operands[1], 0));")
+  [(set_attr "type" "fmov,fmov,fmov,imov,imov,sse,sse,sse,sse")
+   (set_attr "mode" "SF,SF,SF,SI,SI,TI,SF,SF,SF")])
 
 (define_insn "*swapsf"
   [(set (match_operand:SF 0 "register_operand" "+f")
 ;; when optimizing for size.
 
 (define_insn "*movdf_nointeger"
-  [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Y,m,f#Y,*r,o,Y#f,m")
-       (match_operand:DF 1 "general_operand" "fm#Y,f#Y,G,*roF,F*r,Ym#f,Y#f"))]
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Y,m,f#Y,*r,o,Y#f,Y#f,Y#f,m")
+       (match_operand:DF 1 "general_operand" "fm#Y,f#Y,G,*roF,F*r,H,Y#f,YHm#f,Y#f"))]
   "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
    && (optimize_size || !TARGET_INTEGER_DFMODE_MOVES)
    && (reload_in_progress || reload_completed
     case 4:
       return \"#\";
     case 5:
+      return \"pxor\\t%0, %0\";
     case 6:
-      if (TARGET_PARTIAL_REG_DEPENDENCY
-         && register_operand (operands[0], VOIDmode)
-         && register_operand (operands[1], VOIDmode))
+      if (TARGET_PARTIAL_REG_DEPENDENCY)
        return \"movapd\\t{%1, %0|%0, %1}\";
-      return \"movsd\\t{%1, %0|%0, %1}\";
+      else
+       return \"movsd\\t{%1, %0|%0, %1}\";
+    case 7:
+    case 8:
+        return \"movsd\\t{%1, %0|%0, %1}\";
 
     default:
       abort();
     }
 }"
-  [(set_attr "type" "fmov,fmov,fmov,multi,multi,sse,sse")
-   (set_attr "mode" "DF,DF,DF,SI,SI,DF,DF")])
+  [(set_attr "type" "fmov,fmov,fmov,multi,multi,sse,sse,sse,sse")
+   (set_attr "mode" "DF,DF,DF,SI,SI,TI,DF,DF,DF")])
 
 (define_insn "*movdf_integer"
-  [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Yr,m,f#Yr,r#Yf,o,Y#rf,m")
-       (match_operand:DF 1 "general_operand" "fm#Yr,f#Yr,G,roF#Yf,Fr#Yf,Ym#rf,Y#rf"))]
+  [(set (match_operand:DF 0 "nonimmediate_operand" "=f#Yr,m,f#Yr,r#Yf,o,Y#rf,Y#rf,Y#rf,m")
+       (match_operand:DF 1 "general_operand" "fm#Yr,f#Yr,G,roF#Yf,Fr#Yf,H,Y#rf,Ym#rf,Y#rf"))]
   "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
    && !optimize_size && TARGET_INTEGER_DFMODE_MOVES
    && (reload_in_progress || reload_completed
       return \"#\";
 
     case 5:
+      return \"pxor\\t%0, %0\";
     case 6:
+      if (TARGET_PARTIAL_REG_DEPENDENCY)
+       return \"movapd\\t{%1, %0|%0, %1}\";
+      else
+       return \"movsd\\t{%1, %0|%0, %1}\";
+    case 7:
+    case 8:
       return \"movsd\\t{%1, %0|%0, %1}\";
 
     default:
       abort();
     }
 }"
-  [(set_attr "type" "fmov,fmov,fmov,multi,multi,sse,sse")
-   (set_attr "mode" "DF,DF,DF,SI,SI,DF,DF")])
+  [(set_attr "type" "fmov,fmov,fmov,multi,multi,sse,sse,sse,sse")
+   (set_attr "mode" "DF,DF,DF,SI,SI,TI,DF,DF,DF")])
 
 (define_split
   [(set (match_operand:DF 0 "nonimmediate_operand" "")
    (set (match_dup 3) (match_dup 6))]
   "if (ix86_split_long_move (operands)) DONE;")
 
-(define_split
-  [(set (match_operand:DF 0 "register_operand" "")
-       (match_operand:DF 1 "memory_operand" ""))]
-  "reload_completed
-   && GET_CODE (operands[1]) == MEM
-   && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
-   && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))
-   && !(SSE_REG_P (operands[0]) 
-        || (GET_CODE (operands[0]) == SUBREG && SSE_REG_P (operands[0])))
-   && standard_80387_constant_p (get_pool_constant (XEXP (operands[1], 0)))"
-  [(set (match_dup 0)
-       (match_dup 1))]
-  "operands[1] = get_pool_constant (XEXP (operands[1], 0));")
-
 (define_insn "*swapdf"
   [(set (match_operand:DF 0 "register_operand" "+f")
        (match_operand:DF 1 "register_operand" "+f"))
        (match_operand 1 "memory_operand" ""))]
   "reload_completed
    && GET_CODE (operands[1]) == MEM
-   && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == TFmode)
+   && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == TFmode
+       || GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
    && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
    && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))
-   && standard_80387_constant_p (get_pool_constant (XEXP (operands[1], 0)))"
+   && (!(SSE_REG_P (operands[0]) || 
+        (GET_CODE (operands[0]) == SUBREG
+         && SSE_REG_P (SUBREG_REG (operands[0]))))
+       || standard_sse_constant_p (get_pool_constant (XEXP (operands[1], 0))))
+   && (!(FP_REG_P (operands[0]) || 
+        (GET_CODE (operands[0]) == SUBREG
+         && FP_REG_P (SUBREG_REG (operands[0]))))
+       || standard_80387_constant_p (get_pool_constant (XEXP (operands[1], 0))))"
   [(set (match_dup 0)
        (match_dup 1))]
   "operands[1] = get_pool_constant (XEXP (operands[1], 0));")
This page took 0.101246 seconds and 5 git commands to generate.