From d3a57ec0b550e84d08213177b85b5e53fdb9f51b Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 25 Feb 2017 14:07:55 +1100 Subject: [PATCH] or1k: Allow reload to regenerate arbitrary constants If we don't, it will prefer to spill them to .rodata and then we'll be forced to read them from memory instead. --- gcc/config/or1k/or1k.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gcc/config/or1k/or1k.md b/gcc/config/or1k/or1k.md index 3fe2bf84ebbf..0f12060d90e0 100644 --- a/gcc/config/or1k/or1k.md +++ b/gcc/config/or1k/or1k.md @@ -194,8 +194,8 @@ }) (define_insn "*movsi_insn" - [(set (match_operand:SI 0 "nonimmediate_operand" "=m,r,r,r,r,r") - (match_operand:SI 1 "input_operand" "rO,M,K,I,r,m"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=m,r,r,r,r,r,?r") + (match_operand:SI 1 "input_operand" "rO,M,K,I,r,m,i"))] "register_operand (operands[0], SImode) || reg_or_0_operand (operands[1], SImode)" "@ @@ -204,8 +204,19 @@ l.ori\t%0,r0,%1 l.xori\t%0,r0,%1 l.ori\t%0,%1,0 - l.lwz\t%0,%1" - [(set_attr "type" "store,move,logic,logic,logic,load")]) + l.lwz\t%0,%1 + #" + [(set_attr "type" "store,move,logic,logic,logic,load,unknown")]) + +(define_split + [(set (match_operand:SI 0 "register_operand") + (match_operand:SI 1 "immediate_operand"))] + "!input_operand (operands[1], SImode)" + [(const_int 0)] +{ + or1k_expand_move (SImode, operands[0], operands[1]); + DONE; +}) (define_insn "*movsi_lo_sum" [(set (match_operand:SI 0 "register_operand" "=r")