*** empty log message ***
authorJ"orn Rennecke <joern.rennecke@superh.com>
Fri, 13 Dec 2002 20:20:28 +0000 (20:20 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 13 Dec 2002 20:20:28 +0000 (20:20 +0000)
From-SVN: r60103

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

index a1ca49b6517d6cdb2c23fee41a28a00f3c150f1c..a966a291b6262810d9a46b7fac8472bdd18af6c5 100644 (file)
@@ -1,3 +1,14 @@
+Fri Dec 13 16:02:27 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * sh.c (sh_register_operand): New function.
+       (prepare_move_operands): Use it.
+       * sh.h (PREDICATE_CODES): Add entry for sh_register_operand.
+       * sh.md (movsi_media, movsi_media_nofpu): Allow stores of 0.
+       (movqi_media, movhi_media, movdi_media, movdi_media_nofpu): Likewise.
+       (movdf_media, movdf_media_nofpu, movv4sf_i, movsf_media): Likewise.
+       (movsf_media_nofpu, movv2hi_i, movv4hi_i, movv8qi_i): Likewise.
+       (movv2si_i): Likewise.
+
 2002-12-13  Jim Wilson  <wilson@redhat.com>
 
        * doc/extend.texi (Complex Numbers): Update info on debug info.
index 824914c42d2232106525983d504d4a91c4c2312f..75c9d263bfa575b3c140f0497d909e4f8b2b13ff 100644 (file)
@@ -724,7 +724,7 @@ prepare_move_operands (operands, mode)
     {
       /* Copy the source to a register if both operands aren't registers.  */
       if (! register_operand (operands[0], mode)
-         && ! register_operand (operands[1], mode))
+         && ! sh_register_operand (operands[1], mode))
        operands[1] = copy_to_mode_reg (mode, operands[1]);
 
       /* This case can happen while generating code to move the result
@@ -7838,4 +7838,16 @@ sh_register_move_cost (mode, srcclass, dstclass)
   return 2 * ((GET_MODE_SIZE (mode) + 3) / 4U);
 }
 
+/* Like register_operand, but take into account that SHMEDIA can use
+   the constant zero like a general register.  */
+int
+sh_register_operand (op, mode)
+     rtx op;
+     enum machine_mode mode;
+{
+  if (op == CONST0_RTX (mode) && TARGET_SHMEDIA)
+    return 1;
+  return register_operand (op, mode);
+}
+
 #include "gt-sh.h"
index f84e6fb8956f13ed4949ac143c7d082b75bd9aa9..57ebbb311aff3c0ddb38310c690d914a6f85e3d8 100644 (file)
@@ -3227,6 +3227,7 @@ extern int rtx_equal_function_value_matters;
   {"mextr_bit_offset", {CONST_INT}},                                   \
   {"noncommutative_float_operator", {MINUS, DIV}},                     \
   {"shmedia_6bit_operand", {SUBREG, REG, CONST_INT}},                  \
+  {"sh_register_operand", {REG, SUBREG, CONST_INT}},                   \
   {"target_reg_operand", {SUBREG, REG}},                               \
   {"target_operand", {SUBREG, REG, LABEL_REF, SYMBOL_REF, CONST, UNSPEC}},\
   {"trunc_hi_operand", {SUBREG, REG, TRUNCATE}},                       \
index 1df69d194958d47dbec803f223efa32827876efa..4dbda27e4b9c1714b89b73f29f9c10127067d582 100644 (file)
 
 (define_insn "*movsi_media"
   [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,r,r,m,f,m,f,r,f,*b,r,b")
-       (match_operand:SI 1 "general_movsrc_operand" "r,JS,ns,m,r,m,f,rU,f,f,r,*b,T"))]
+       (match_operand:SI 1 "general_movsrc_operand" "r,JS,ns,m,rU,m,f,rU,f,f,r,*b,T"))]
   "TARGET_SHMEDIA_FPU
    && (register_operand (operands[0], SImode)
-       || register_operand (operands[1], SImode))"
+       || sh_register_operand (operands[1], SImode))"
   "@
        add.l   %1, r63, %0
        movi    %1, %0
        #
        ld%M1.l %m1, %0
-       st%M0.l %m0, %1
+       st%M0.l %m0, %N1
        fld%M1.s        %m1, %0
        fst%M0.s        %m0, %1
        fmov.ls %N1, %0
 
 (define_insn "*movsi_media_nofpu"
   [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,r,r,m,*b,r,b")
-       (match_operand:SI 1 "general_movsrc_operand" "r,JS,ns,m,r,r,*b,T"))]
+       (match_operand:SI 1 "general_movsrc_operand" "r,JS,ns,m,rU,r,*b,T"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], SImode)
-       || register_operand (operands[1], SImode))"
+       || sh_register_operand (operands[1], SImode))"
   "@
        add.l   %1, r63, %0
        movi    %1, %0
        #
        ld%M1.l %m1, %0
-       st%M0.l %m0, %1
+       st%M0.l %m0, %N1
        ptabs   %1, %0
        gettr   %1, %0
        pt      %1, %0"
 
 (define_insn "*movqi_media"
   [(set (match_operand:QI 0 "general_movdst_operand" "=r,r,r,m")
-       (match_operand:QI 1 "general_movsrc_operand" "r,JS,m,r"))]
+       (match_operand:QI 1 "general_movsrc_operand" "r,JS,m,rU"))]
   "TARGET_SHMEDIA
    && (arith_reg_operand (operands[0], QImode)
-       || arith_reg_operand (operands[1], QImode))"
+       || arith_reg_or_0_operand (operands[1], QImode))"
   "@
        add.l   %1, r63, %0
        movi    %1, %0
        ld%M1.ub        %m1, %0
-       st%M0.b %m0, %1"
+       st%M0.b %m0, %N1"
   [(set_attr "type" "arith_media,arith_media,load_media,store_media")])
 
 (define_expand "movqi"
 
 (define_insn "*movhi_media"
   [(set (match_operand:HI 0 "general_movdst_operand" "=r,r,r,r,m")
-       (match_operand:HI 1 "general_movsrc_operand" "r,JS,n,m,r"))]
+       (match_operand:HI 1 "general_movsrc_operand" "r,JS,n,m,rU"))]
   "TARGET_SHMEDIA
    && (arith_reg_operand (operands[0], HImode)
-       || arith_reg_operand (operands[1], HImode))"
+       || arith_reg_or_0_operand (operands[1], HImode))"
   "@
        add.l   %1, r63, %0
        movi    %1, %0
        #
        ld%M1.w %m1, %0
-       st%M0.w %m0, %1"
+       st%M0.w %m0, %N1"
   [(set_attr "type" "arith_media,arith_media,*,load_media,store_media")])
 
 (define_split
 
 (define_insn "*movdi_media"
   [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,rl,m,f,m,f,r,f,*b,r,b")
-       (match_operand:DI 1 "general_movsrc_operand" "r,JS,iF,m,rl,m,f,rU,f,f,r,*b,T"))]
+       (match_operand:DI 1 "general_movsrc_operand" "r,JS,iF,m,rlU,m,f,rU,f,f,r,*b,T"))]
   "TARGET_SHMEDIA_FPU
    && (register_operand (operands[0], DImode)
-       || register_operand (operands[1], DImode))"
+       || sh_register_operand (operands[1], DImode))"
   "@
        add     %1, r63, %0
        movi    %1, %0
        #
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1
+       st%M0.q %m0, %N1
        fld%M1.d        %m1, %0
        fst%M0.d        %m0, %1
        fmov.qd %N1, %0
 
 (define_insn "*movdi_media_nofpu"
   [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,rl,m,*b,r,b")
-       (match_operand:DI 1 "general_movsrc_operand" "r,JS,iF,m,rl,r,*b,T"))]
+       (match_operand:DI 1 "general_movsrc_operand" "r,JS,iF,m,rlU,r,*b,T"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], DImode)
-       || register_operand (operands[1], DImode))"
+       || sh_register_operand (operands[1], DImode))"
   "@
        add     %1, r63, %0
        movi    %1, %0
        #
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1
+       st%M0.q %m0, %N1
        ptabs   %1, %0
        gettr   %1, %0
        pt      %1, %0"
 
 (define_insn "movdf_media"
   [(set (match_operand:DF 0 "general_movdst_operand" "=f,f,r,r,r,f,m,r,m")
-       (match_operand:DF 1 "general_movsrc_operand" "f,rU,f,r,F,m,f,m,r"))]
+       (match_operand:DF 1 "general_movsrc_operand" "f,rU,f,r,F,m,f,m,rU"))]
   "TARGET_SHMEDIA_FPU
    && (register_operand (operands[0], DFmode)
-       || register_operand (operands[1], DFmode))"
+       || sh_register_operand (operands[1], DFmode))"
   "@
        fmov.d  %1, %0
        fmov.qd %N1, %0
        fld%M1.d        %m1, %0
        fst%M0.d        %m0, %1
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1"
+       st%M0.q %m0, %N1"
   [(set_attr "type" "fmove_media,fload_media,dfpconv_media,arith_media,*,fload_media,fstore_media,load_media,store_media")])
 
 (define_insn "movdf_media_nofpu"
   [(set (match_operand:DF 0 "general_movdst_operand" "=r,r,r,m")
-       (match_operand:DF 1 "general_movsrc_operand" "r,F,m,r"))]
+       (match_operand:DF 1 "general_movsrc_operand" "r,F,m,rU"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], DFmode)
-       || register_operand (operands[1], DFmode))"
+       || sh_register_operand (operands[1], DFmode))"
   "@
        add     %1, r63, %0
        #
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1"
+       st%M0.q %m0, %N1"
   [(set_attr "type" "arith_media,*,load_media,store_media")])
 
 (define_split
 
 (define_insn_and_split "*movv4sf_i"
   [(set (match_operand:V4SF 0 "nonimmediate_operand" "=f,f,m")
-       (match_operand:V4SF 1 "general_operand" "fU,m,f"))]
+       (match_operand:V4SF 1 "general_operand" "fU,m,fU"))]
   "TARGET_SHMEDIA_FPU"
   "#"
   "&& reload_completed"
 
 (define_insn "movsf_media"
   [(set (match_operand:SF 0 "general_movdst_operand" "=f,f,r,r,r,f,m,r,m")
-       (match_operand:SF 1 "general_movsrc_operand" "f,rU,f,r,F,m,f,m,r"))]
+       (match_operand:SF 1 "general_movsrc_operand" "f,rU,f,r,F,m,f,m,rU"))]
   "TARGET_SHMEDIA_FPU
    && (register_operand (operands[0], SFmode)
-       || register_operand (operands[1], SFmode))"
+       || sh_register_operand (operands[1], SFmode))"
   "@
        fmov.s  %1, %0
        fmov.ls %N1, %0
        fld%M1.s        %m1, %0
        fst%M0.s        %m0, %1
        ld%M1.l %m1, %0
-       st%M0.l %m0, %1"
+       st%M0.l %m0, %N1"
   [(set_attr "type" "fmove_media,fload_media,fpconv_media,arith_media,*,fload_media,fstore_media,load_media,store_media")])
 
 (define_insn "movsf_media_nofpu"
   [(set (match_operand:SF 0 "general_movdst_operand" "=r,r,r,m")
-       (match_operand:SF 1 "general_movsrc_operand" "r,F,m,r"))]
+       (match_operand:SF 1 "general_movsrc_operand" "r,F,m,rU"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], SFmode)
-       || register_operand (operands[1], SFmode))"
+       || sh_register_operand (operands[1], SFmode))"
   "@
        add.l   %1, r63, %0
        #
        ld%M1.l %m1, %0
-       st%M0.l %m0, %1"
+       st%M0.l %m0, %N1"
   [(set_attr "type" "arith_media,*,load_media,store_media")])
 
 (define_split
 
 (define_insn "movv8qi_i"
   [(set (match_operand:V8QI 0 "general_movdst_operand" "=r,r,r,rl,m")
-       (match_operand:V8QI 1 "general_movsrc_operand" "r,JSU,nW,m,rl"))]
+       (match_operand:V8QI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], V8QImode)
-       || register_operand (operands[1], V8QImode))"
+       || sh_register_operand (operands[1], V8QImode))"
   "@
        add     %1, r63, %0
        movi    %1, %0
        #
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1"
+       st%M0.q %m0, %N1"
   [(set_attr "type"   "arith_media,arith_media,*,load_media,store_media")
    (set_attr "length" "4,4,16,4,4")])
 
 
 (define_insn "movv2hi_i"
   [(set (match_operand:V2HI 0 "general_movdst_operand" "=r,r,r,rl,m")
-       (match_operand:V2HI 1 "general_movsrc_operand" "r,JSU,nW,m,rl"))]
+       (match_operand:V2HI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], V2HImode)
-       || register_operand (operands[1], V2HImode))"
+       || sh_register_operand (operands[1], V2HImode))"
   "@
        addz.l  %1, r63, %0
        movi    %1, %0
        #
        ld%M1.l %m1, %0
-       st%M0.l %m0, %1"
+       st%M0.l %m0, %N1"
   [(set_attr "type"   "arith_media,arith_media,*,load_media,store_media")
    (set_attr "length" "4,4,16,4,4")])
 
 
 (define_insn "movv4hi_i"
   [(set (match_operand:V4HI 0 "general_movdst_operand" "=r,r,r,rl,m")
-       (match_operand:V4HI 1 "general_movsrc_operand" "r,JSU,nW,m,rl"))]
+       (match_operand:V4HI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], V4HImode)
-       || register_operand (operands[1], V4HImode))"
+       || sh_register_operand (operands[1], V4HImode))"
   "@
        add     %1, r63, %0
        movi    %1, %0
        #
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1"
+       st%M0.q %m0, %N1"
   [(set_attr "type"   "arith_media,arith_media,*,load_media,store_media")
    (set_attr "length" "4,4,16,4,4")])
 
 
 (define_insn "movv2si_i"
   [(set (match_operand:V2SI 0 "general_movdst_operand" "=r,r,r,rl,m")
-       (match_operand:V2SI 1 "general_movsrc_operand" "r,JSU,nW,m,rl"))]
+       (match_operand:V2SI 1 "general_movsrc_operand" "r,JSU,nW,m,rlU"))]
   "TARGET_SHMEDIA
    && (register_operand (operands[0], V2SImode)
-       || register_operand (operands[1], V2SImode))"
+       || sh_register_operand (operands[1], V2SImode))"
   "@
        add     %1, r63, %0
        #
        #
        ld%M1.q %m1, %0
-       st%M0.q %m0, %1"
+       st%M0.q %m0, %N1"
   [(set_attr "type"   "arith_media,arith_media,*,load_media,store_media")
    (set_attr "length" "4,4,16,4,4")])