(storehi): Use match_operand for operand 0.
authorTorbjorn Granlund <tege@gnu.org>
Sat, 5 Sep 1992 20:36:46 +0000 (20:36 +0000)
committerTorbjorn Granlund <tege@gnu.org>
Sat, 5 Sep 1992 20:36:46 +0000 (20:36 +0000)
Use gen_lowpart to change mode of operand 0.
(storeinthi): Use match_operand for operand 0.
Change output code to reassign operand 0.
(truncsihi2, truncsiqi2, trunchiqi2): Remove these patterns.

From-SVN: r2057

gcc/config/arm/arm.md

index ef4bf87fcc22c1300fb28f67525a084042e5f724..46d43f068bcc1cf641968b70c669b3d24c5a7968 100644 (file)
   "*
   return (arm_output_asm_insn (\"fltd\\t%0, %1\", operands));
 ")
-\f
-;; Truncation insns
-
-(define_insn "truncsiqi2"
-  [(set (match_operand:QI 0 "general_operand" "=mr")
-        (truncate:QI (match_operand:SI 1 "register_operand" "r")))]
-  ""
-  "*
-  if (GET_CODE (operands[0]) == MEM)
-    return (arm_output_asm_insn (\"strb\\t%1, %0\\t@ truncsiqi2\", operands));
-  else
-    return (arm_output_asm_insn (\"and\\t%0, %1, #255\\t@ truncsiqi2\", operands));
-")
 
-(define_insn "trunchiqi2"
-  [(set (match_operand:QI 0 "general_operand" "=mr")
-        (truncate:QI (match_operand:HI 1 "register_operand" "r")))]
-  ""
-  "*
-  if (GET_CODE(operands[0]) == MEM)
-    return (arm_output_asm_insn (\"strb\\t%1, %0\\t@ trunchiqi2\", operands));
-  else
-    return (arm_output_asm_insn (\"and\\t%0, %1, #255\\t@ trunchiqi2\", operands));
-")
-
-;; Mode is changed to SI below
-
-(define_expand "truncsihi2"
-  [(set (match_operand:SI 0 "register_operand" "")
-        (ashift:SI (match_operand:HI 1 "register_operand" "")
-                   (const_int 16)))
-   (set (match_dup 0)
-        (ashiftrt:SI (match_dup 0) (const_int 16)))]
-  ""
-  "
-  if (GET_CODE (operands[1]) == SUBREG)
-      operands[1] = gen_rtx (SUBREG, SImode, SUBREG_REG (operands[1]),
-                             SUBREG_WORD (operands[1]));
-  else
-      operands[1] = gen_rtx(SUBREG, SImode, operands[1], 0);
-")
+;; Truncation insns
 
 (define_insn "truncdfsf2"
   [(set (match_operand:SF 0 "register_operand" "=f")
 ;; Operand 2 is a temporary (SImode).
 ;; Operand 3 is a temporary (SImode).
 ;; Operand 4 is a temporary (SImode).
-;; Operand 5 is a local temporary (SImode).
 
 (define_expand "storehi"
   [;; compute the address into a register
         (match_operand:SI 1 "address_operand" ""))
    ;; get the half word into a full word register
    (set (match_operand:SI 3 "register_operand" "")
-        (match_dup 5))
+        (match_operand:HI 0 "register_operand" ""))
    ;; store the low byte
    (set (mem:QI (match_dup 2))
         (truncate:QI (match_dup 3)))
         (truncate:QI (match_dup 4)))]
   ""
   "
-  if (GET_CODE(operands[0]) == SUBREG)
-    operands[5] = gen_rtx(SUBREG, SImode, SUBREG_REG(operands[0]),
-              SUBREG_WORD(operands[0]));
-  else
-    operands[5] = gen_rtx(SUBREG, SImode, operands[0], 0);
-  
+  operands[0] = gen_lowpart (SImode, operands[0]);
 ")
 
 ;; Subroutine to store a half word integer constant into memory.
 ;; Operand 3 is a temporary (QImode).
 ;; Operand 4 is a temporary (QImode).
 ;; Operand 5 is a local CONST_INT.
-;; Operand 6 is a local CONST_INT.
 
 (define_expand "storeinthi"
   [;; compute the address into a register
         (match_operand:SI 1 "address_operand" ""))
    ;; load the low byte
    (set (match_operand:QI 3 "register_operand" "")
-        (match_dup 5))
+        (match_operand:SI 0 "" ""))
    ;; store the low byte
    (set (mem:QI (match_dup 2))
         (match_dup 3))
    ;; load the high byte
    (set (match_operand:QI 4 "register_operand" "")
-        (match_dup 6))
+        (match_dup 5))
    ;; store the high byte
    (set (mem:QI (plus (match_dup 2) (const_int 1)))
         (match_dup 4))]
     {
       int value = INTVAL(operands[0]);
 
-      operands[5] = gen_rtx(CONST_INT, VOIDmode, value & 255);
-      operands[6] = gen_rtx(CONST_INT, VOIDmode,(value>>8) & 255);
+      operands[0] = gen_rtx(CONST_INT, VOIDmode, value & 255);
+      operands[5] = gen_rtx(CONST_INT, VOIDmode,(value>>8) & 255);
     }
 ")