OSDN Git Service

* config/c4x/c4x.c (dst_operand): New.
authorm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Oct 1999 04:32:37 +0000 (04:32 +0000)
committerm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Oct 1999 04:32:37 +0000 (04:32 +0000)
(PREDICATE_CODES): Update.
* config/c4x/c4x.h (dst_operand): Declare it.
* config/c4x/c4x.md:  Define mode for each unspec usage.
(move patterns):  Use dst_operand predicate instead of src_operand.
(movqi_update, movqf_update): Delete.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29996 138bc75d-0d04-0410-961f-82ee72b054a4

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

index a796dd2..2acb906 100644 (file)
@@ -1,3 +1,12 @@
+Fri Oct 15 17:27:17 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * config/c4x/c4x.c (dst_operand): New.
+       (PREDICATE_CODES): Update.
+       * config/c4x/c4x.h (dst_operand): Declare it.
+       * config/c4x/c4x.md:  Define mode for each unspec usage.
+       (move patterns):  Use dst_operand predicate instead of src_operand.
+       (movqi_update, movqf_update): Delete.
+
 Thu Oct 14 18:48:54 1999  Richard Henderson  <rth@cygnus.com>
 
        * recog.c (pmode_register_operand): New.
index cee08a1..a731fbd 100644 (file)
@@ -3060,8 +3060,24 @@ symbolic_address_operand (op, mode)
 }
 
 
-/* Check src operand of two operand arithmetic instructions.  */
+/* Check dst operand of a move instruction.  */
+int
+dst_operand (op, mode)
+     rtx op;
+     enum machine_mode mode;
+{
+  if (GET_CODE (op) == SUBREG
+      && mixed_subreg_operand (op, mode))
+    return 0;
 
+  if (REG_P (op))
+    return reg_operand (op, mode);
+
+  return memory_operand (op, mode);
+}
+
+
+/* Check src operand of two operand arithmetic instructions.  */
 int
 src_operand (op, mode)
      rtx op;
index 559e9c4..3a4e13f 100644 (file)
@@ -2594,6 +2594,7 @@ if (final_sequence != NULL_RTX)           \
   {"st_reg_operand", {REG}},                                   \
   {"rc_reg_operand", {REG}},                                   \
   {"call_address_operand", {REG, SYMBOL_REF, LABEL_REF, CONST}}, \
+  {"dst_operand", {SUBREG, REG, MEM}}, \
   {"src_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE}}, \
   {"src_hi_operand", {SUBREG, REG, MEM, CONST_DOUBLE}},        \
   {"lsrc_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE}}, \
@@ -2674,6 +2675,8 @@ extern int ext_reg_operand ();
 
 extern int std_reg_operand ();
 
+extern int dst_operand ();
+
 extern int src_operand ();
 
 extern int src_hi_operand ();
index 39d7153..a2bb7c2 100644 (file)
    && ! IS_INT16_CONST (INTVAL (operands[1]))
    && ! IS_HIGH_CONST (INTVAL (operands[1]))
    && reload_completed
-   && (TARGET_C3X && c4x_shiftable_constant (operands[1]) < 0
+   && ((TARGET_C3X && c4x_shiftable_constant (operands[1]) < 0)
        || ! std_reg_operand (operands[0], QImode))"
   [(set (match_dup 0) (match_dup 2))
    (use (match_dup 1))]
 ; We must provide an alternative to store to memory in case we have to
 ; spill a register.
 (define_insn "movqi_noclobber"
-  [(set (match_operand:QI 0 "src_operand" "=d,*c,m,r")
+  [(set (match_operand:QI 0 "dst_operand" "=d,*c,m,r")
         (match_operand:QI 1 "src_hi_operand" "rIm,rIm,r,O"))]
   "(REG_P (operands[0]) || REG_P (operands[1])
     || GET_CODE (operands[0]) == SUBREG
     DONE;
 }")
 
-(define_insn "*movqi_update"
-  [(set (match_operand:QI 0 "reg_operand" "=r") 
-        (mem:QI (plus:QI (match_operand:QI 1 "addr_reg_operand" "a")
-                         (match_operand:QI 2 "index_reg_operand" "x"))))
-   (set (match_dup 1)
-        (plus:QI (match_dup 1) (match_dup 2)))]
-  ""
-  "ldiu\\t*%1++(%2),%0"
-  [(set_attr "type" "unary")
-   (set_attr "data" "int16")])
 
 (define_insn "movqi_parallel"
   [(set (match_operand:QI 0 "parallel_operand" "=q,S<>,q,S<>")
 ; may be allocated to reload the PLUS and thus gen_reload will
 ; emit an add insn that may clobber CC.
 (define_insn "*addqi3_noclobber_reload"
-  [(set (match_operand:QI 0 "general_operand" "=c,c,c")
+  [(set (match_operand:QI 0 "dst_operand" "=c,c,c")
         (plus:QI (match_operand:QI 1 "src_operand" "%0,rR,rS<>")
                  (match_operand:QI 2 "src_operand" "rIm,JR,rS<>")))]
   "reload_in_progress"
 ; This can generate invalid stack slot displacements
 (define_split
  [(set (match_operand:QI 0 "reg_operand" "=r")
-       (unspec [(match_operand:QF 1 "reg_operand" "f")] 12))]
+       (unspec:QI [(match_operand:QF 1 "reg_operand" "f")] 12))]
   "reload_completed"
   [(set (match_dup 3) (match_dup 1))
    (set (match_dup 0) (match_dup 2))]
 
 (define_insn "storeqf_int"
  [(set (match_operand:QI 0 "reg_operand" "=r")
-       (unspec [(match_operand:QF 1 "reg_operand" "f")] 12))]
+       (unspec:QI [(match_operand:QF 1 "reg_operand" "f")] 12))]
  ""
  "#"
   [(set_attr "type" "multi")])
 
 (define_split
  [(parallel [(set (match_operand:QI 0 "reg_operand" "=r")
-                  (unspec [(match_operand:QF 1 "reg_operand" "f")] 12))
+                  (unspec:QI [(match_operand:QF 1 "reg_operand" "f")] 12))
              (clobber (reg:CC 21))])]
   "reload_completed"
   [(set (mem:QF (pre_inc:QI (reg:QI 20)))
 
 (define_insn "storeqf_int_clobber"
  [(parallel [(set (match_operand:QI 0 "reg_operand" "=r")
-                  (unspec [(match_operand:QF 1 "reg_operand" "f")] 12))
+                  (unspec:QI [(match_operand:QF 1 "reg_operand" "f")] 12))
              (clobber (reg:CC 21))])]
  ""
  "#"
 ; This can generate invalid stack slot displacements
 (define_split
  [(set (match_operand:QF 0 "reg_operand" "=f")
-       (unspec [(match_operand:QI 1 "reg_operand" "r")] 11))]
+       (unspec:QF [(match_operand:QI 1 "reg_operand" "r")] 11))]
   "reload_completed"
   [(set (match_dup 2) (match_dup 1))
    (set (match_dup 0) (match_dup 3))]
 
 (define_insn "loadqf_int"
  [(set (match_operand:QF 0 "reg_operand" "=f")
-       (unspec [(match_operand:QI 1 "reg_operand" "r")] 11))]
+       (unspec:QF [(match_operand:QI 1 "reg_operand" "r")] 11))]
  ""
  "#"
   [(set_attr "type" "multi")])
 
 (define_split
  [(parallel [(set (match_operand:QF 0 "reg_operand" "=f")
-                  (unspec [(match_operand:QI 1 "reg_operand" "r")] 11))
+                  (unspec:QF [(match_operand:QI 1 "reg_operand" "r")] 11))
              (clobber (reg:CC 21))])]
   "reload_completed"
   [(set (mem:QI (pre_inc:QI (reg:QI 20)))
 
 (define_insn "loadqf_int_clobber"
  [(parallel [(set (match_operand:QF 0 "reg_operand" "=f")
-                  (unspec [(match_operand:QI 1 "reg_operand" "r")] 11))
+                  (unspec:QF [(match_operand:QI 1 "reg_operand" "r")] 11))
              (clobber (reg:CC 21))])]
  ""
  "#"
 ; We must provide an alternative to store to memory in case we have to
 ; spill a register.
 (define_insn "movqf_noclobber"
- [(set (match_operand:QF 0 "src_operand" "=f,m")
+ [(set (match_operand:QF 0 "dst_operand" "=f,m")
        (match_operand:QF 1 "src_operand" "fHm,f"))]
  "REG_P (operands[0]) || REG_P (operands[1])"
  "@
  "ldf\\t%1,%0"
   [(set_attr "type" "unarycc")])
 
-(define_insn "*movqf_update"
-  [(set (match_operand:QF 0 "reg_operand" "=r") 
-        (mem:QF (plus:QI (match_operand:QI 1 "addr_reg_operand" "a")
-                         (match_operand:QI 2 "index_reg_operand" "x"))))
-   (set (match_dup 1)
-        (plus:QI (match_dup 1) (match_dup 2)))]
-  ""
-  "ldfu\\t*%1++(%2),%0"
-  [(set_attr "type" "unary")])
 
 (define_insn "*movqf_parallel"
  [(set (match_operand:QF 0 "parallel_operand" "=q,S<>,q,S<>")
 ;
 (define_insn "*rcpfqf_clobber"
   [(set (match_operand:QF 0 "reg_operand" "=f")
-        (unspec [(match_operand:QF 1 "src_operand" "fHm")] 5))
+        (unspec:QF [(match_operand:QF 1 "src_operand" "fHm")] 5))
    (clobber (reg:CC_NOOV 21))]
   "! TARGET_C3X"
   "rcpf\\t%1,%0"
 ;
 (define_insn "*rsqrfqf_clobber"
   [(set (match_operand:QF 0 "reg_operand" "=f")
-        (unspec [(match_operand:QF 1 "src_operand" "fHm")] 10))
+        (unspec:QF [(match_operand:QF 1 "src_operand" "fHm")] 10))
    (clobber (reg:CC_NOOV 21))]
   "! TARGET_C3X"
   "rsqrf\\t%1,%0"
 ;
 (define_insn "*rndqf_clobber"
   [(set (match_operand:QF 0 "reg_operand" "=f")
-        (unspec [(match_operand:QF 1 "src_operand" "fHm")] 6))
+        (unspec:QF [(match_operand:QF 1 "src_operand" "fHm")] 6))
    (clobber (reg:CC_NOOV 21))]
   "! TARGET_C3X"
   "rnd\\t%1,%0"
 
 (define_split
   [(set (match_operand:QI 0 "reg_operand" "")
-        (match_operator 1 "comparison_operator" [(reg:CC 21) (const_int 0)]))]
+        (match_operator:QI 1 "comparison_operator" [(reg:CC 21) (const_int 0)]))]
   "reload_completed"
   [(set (match_dup 0) (const_int 0))
    (set (match_dup 0)
 
 (define_split
   [(set (match_operand:QI 0 "reg_operand" "")
-        (match_operator 1 "comparison_operator" [(reg:CC_NOOV 21) (const_int 0)]))]
+        (match_operator:QI 1 "comparison_operator" [(reg:CC_NOOV 21) (const_int 0)]))]
   "reload_completed"
   [(set (match_dup 0) (const_int 0))
    (set (match_dup 0)
   [(set_attr "type" "unary")])
 
 (define_insn "*movhf_noclobber"
- [(set (match_operand:HF 0 "src_operand" "=h,m")
+ [(set (match_operand:HF 0 "dst_operand" "=h,m")
        (match_operand:HF 1 "src_operand" "Hm,h"))]
  "reg_operand (operands[0], HFmode) ^ reg_operand (operands[1], HFmode)"
  "#"
 
 (define_insn "*loadhf_int"
  [(set (match_operand:HF 0 "reg_operand" "=h")
-       (unspec[(subreg:QI (match_dup 0) 0)
+       (unspec:HF [(subreg:QI (match_dup 0) 0)
                (match_operand:QI 1 "src_operand" "rIm")] 8))]
  ""
  "@
 
 (define_insn "*storehf_int"
  [(set (match_operand:QI 0 "memory_operand" "=m")
-       (unspec [(match_operand:HF 1 "reg_operand" "h")] 9))]
+       (unspec:QI [(match_operand:HF 1 "reg_operand" "h")] 9))]
  ""
  "@
   sti\\t%1,%0"
 
 (define_insn "pushhf_int"
   [(set (mem:QI (pre_inc:QI (reg:QI 20)))
-        (unspec [(match_operand:HF 0 "reg_operand" "h")] 9))]
+        (unspec:QI [(match_operand:HF 0 "reg_operand" "h")] 9))]
  ""
  "push\\t%0"
  [(set_attr "type" "push")])
 
 (define_insn "*pophf_int"
  [(set (match_operand:HF 0 "reg_operand" "=h")
-       (unspec[(subreg:QI (match_dup 0) 0)
+       (unspec:HF [(subreg:QI (match_dup 0) 0)
                (mem:QI (post_dec:QI (reg:QI 20)))] 8))
   (clobber (reg:CC 21))]
  ""
 ;
 (define_insn "*rcpfhf_clobber"
   [(set (match_operand:HF 0 "reg_operand" "=h")
-        (unspec [(match_operand:HF 1 "reg_or_const_operand" "hH")] 5))
+        (unspec:HF [(match_operand:HF 1 "reg_or_const_operand" "hH")] 5))
    (clobber (reg:CC_NOOV 21))]
   "! TARGET_C3X"
   "rcpf\\t%1,%0"
 ;
 (define_insn "*rsqrfhf_clobber"
   [(set (match_operand:HF 0 "reg_operand" "=h")
-        (unspec [(match_operand:HF 1 "reg_or_const_operand" "hH")] 10))
+        (unspec:HF [(match_operand:HF 1 "reg_or_const_operand" "hH")] 10))
    (clobber (reg:CC_NOOV 21))]
   "! TARGET_C3X"
   "rsqrf\\t%1,%0"
 ;
 (define_insn "*rndhf_clobber"
   [(set (match_operand:HF 0 "reg_operand" "=h")
-        (unspec [(match_operand:HF 1 "reg_or_const_operand" "hH")] 6))
+        (unspec:HF [(match_operand:HF 1 "reg_or_const_operand" "hH")] 6))
    (clobber (reg:CC_NOOV 21))]
   "! TARGET_C3X"
   "rnd\\t%1,%0"
 ; we can get RC, R8 allocated as a pair.  We want more
 ; votes for FP_REGS so we use dr as the constraints.
 (define_insn "*movhi_noclobber"
-  [(set (match_operand:HI 0 "src_operand" "=dr,m")
+  [(set (match_operand:HI 0 "dst_operand" "=dr,m")
         (match_operand:HI 1 "src_operand" "drIm,r"))]
   "reg_operand (operands[0], HImode)
    || reg_operand (operands[1], HImode)"
 ; However, things are likely to be very screwed up if we get this.
 
 (define_split
-  [(set (match_operand:HI 0 "src_operand" "")
+  [(set (match_operand:HI 0 "dst_operand" "")
        (match_operand:HI 1 "src_operand" ""))]
   "reload_completed
    && (reg_operand (operands[0], HImode)
  
 (define_insn "cmphi_cc"
   [(set (reg:CC 21)
-        (unspec [(compare:CC (match_operand:HI 0 "src_operand" "rR,rS<>")
+        (unspec:CC [(compare:CC (match_operand:HI 0 "src_operand" "rR,rS<>")
                              (match_operand:HI 1 "src_operand" "R,rS<>"))] 4))
    (clobber (match_scratch:QI 2 "=&d,&d"))
    (clobber (match_scratch:QI 3 "=&c,&c"))]
 
 (define_insn "cmphi_cc_noov"
   [(set (reg:CC_NOOV 21)
-        (unspec [(compare:CC_NOOV (match_operand:HI 0 "src_operand" "rR,rS<>")
-                                  (match_operand:HI 1 "src_operand" "R,rS<>"))] 4))
+        (unspec:CC_NOOV [
+          (compare:CC_NOOV (match_operand:HI 0 "src_operand" "rR,rS<>")
+                           (match_operand:HI 1 "src_operand" "R,rS<>"))] 4))
    (clobber (match_scratch:QI 2 "=&d,&d"))
    (clobber (match_scratch:QI 3 "=&c,&c"))]
   "valid_operands (COMPARE, operands, HImode)"