Skip to content

Commit

Permalink
or1k: Allow reload to regenerate arbitrary constants
Browse files Browse the repository at this point in the history
If we don't, it will prefer to spill them to .rodata and
then we'll be forced to read them from memory instead.
  • Loading branch information
Richard Henderson authored and stffrdhrn committed Dec 3, 2017
1 parent 0dc5c5c commit d3a57ec
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions gcc/config/or1k/or1k.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
"@
Expand All @@ -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")
Expand Down

0 comments on commit d3a57ec

Please sign in to comment.