sh.md (mov<mode>): Replace movQIHI.

2014-04-22  Christian Bruel  <christian.bruel@st.com>

        * config/sh/sh.md (mov<mode>): Replace movQIHI.
         Force immediates to SImode.

From-SVN: r209671
This commit is contained in:
Christian Bruel 2014-04-23 09:30:12 +02:00 committed by Christian Bruel
parent aa22156410
commit 5e66b2e564
4 changed files with 42 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2014-04-22 Christian Bruel <christian.bruel@st.com>
* config/sh/sh.md (mov<mode>): Replace movQIHI.
Force immediates to SImode.
2014-04-22 Sandra Loosemore <sandra@codesourcery.com>
* config/nios2/nios2.md (UNSPEC_ROUND): New.

View File

@ -6978,20 +6978,20 @@ label:
[(set_attr "type" "sfunc")
(set_attr "needs_delay_slot" "yes")])
(define_expand "movhi"
[(set (match_operand:HI 0 "general_movdst_operand" "")
(match_operand:HI 1 "general_movsrc_operand" ""))]
(define_expand "mov<mode>"
[(set (match_operand:QIHI 0 "general_movdst_operand")
(match_operand:QIHI 1 "general_movsrc_operand"))]
""
{
prepare_move_operands (operands, HImode);
})
if (can_create_pseudo_p () && CONST_INT_P (operands[1])
&& REG_P (operands[0]) && REGNO (operands[0]) != R0_REG)
{
rtx reg = gen_reg_rtx(SImode);
emit_move_insn (reg, operands[1]);
operands[1] = gen_lowpart (<MODE>mode, reg);
}
(define_expand "movqi"
[(set (match_operand:QI 0 "general_operand" "")
(match_operand:QI 1 "general_operand" ""))]
""
{
prepare_move_operands (operands, QImode);
prepare_move_operands (operands, <MODE>mode);
})
;; Specifying the displacement addressing load / store patterns separately

View File

@ -1,3 +1,7 @@
2014-04-22 Christian Bruel <christian.bruel@st.com>
* gcc.target/sh/hiconst.c: New test.
2014-04-22 Sandra Loosemore <sandra@codesourcery.com>
* gcc.target/nios2/custom-fp-conversion.c: Adjust to test that

View File

@ -0,0 +1,22 @@
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O1" } */
char a;
int b;
foo(char *pt, int *pti)
{
a = 0;
b = 0;
*pt = 0;
*pti = 0;
}
rab(char *pt, int *pti)
{
pt[2] = 0;
pti[3] = 0;
}
/* { dg-final { scan-assembler-times "mov\t#0" 2 } } */