OSDN Git Service

* config/sh/sh.md (ashlhi3): Rename to *ashlhi3_n and add a new
authorkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Mar 2005 00:14:52 +0000 (00:14 +0000)
committerkkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Mar 2005 00:14:52 +0000 (00:14 +0000)
ashlhi3 expander.

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

gcc/ChangeLog
gcc/config/sh/sh.md

index 9473dc1..2f7a329 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-22  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * config/sh/sh.md (ashlhi3): Rename to *ashlhi3_n and add a new
+       ashlhi3 expander.
+
 2005-03-22  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
 
        * tree.h (DECL_IGNORED_P, DECL_IN_SYSTEM_HEADER): Clarify comments.
index e367d60..bb799fb 100644 (file)
     FAIL;
 }")
 
-(define_insn "ashlhi3"
+(define_insn "*ashlhi3_n"
   [(set (match_operand:HI 0 "arith_reg_operand" "=r")
        (ashift:HI (match_operand:HI 1 "arith_reg_operand" "0")
                   (match_operand:HI 2 "const_int_operand" "n")))
              (const_string "6")))
    (set_attr "type" "arith")])
 
+(define_expand "ashlhi3"
+  [(parallel [(set (match_operand:HI 0 "arith_reg_operand" "")
+                  (ashift:HI (match_operand:HI 1 "arith_reg_operand" "")
+                             (match_operand:SI 2 "nonmemory_operand" "")))
+             (clobber (reg:SI T_REG))])]
+  "TARGET_SH1"
+  "
+{
+  if (GET_CODE (operands[2]) != CONST_INT)
+    FAIL;
+  /* It may be possible to call gen_ashlhi3 directly with more generic
+     operands.  Make sure operands[1] is a HImode register here.  */
+  if (!arith_reg_operand (operands[1], HImode))
+    operands[1] = copy_to_mode_reg (HImode, operands[1]);
+}")
+
 (define_split
   [(set (match_operand:HI 0 "arith_reg_operand" "")
        (ashift:HI (match_operand:HI 1 "arith_reg_operand" "")