Skip to content

Commit d3a57ec

Browse files
Richard Hendersonstffrdhrn
Richard Henderson
authored andcommitted
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.
1 parent 0dc5c5c commit d3a57ec

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

gcc/config/or1k/or1k.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@
194194
})
195195

196196
(define_insn "*movsi_insn"
197-
[(set (match_operand:SI 0 "nonimmediate_operand" "=m,r,r,r,r,r")
198-
(match_operand:SI 1 "input_operand" "rO,M,K,I,r,m"))]
197+
[(set (match_operand:SI 0 "nonimmediate_operand" "=m,r,r,r,r,r,?r")
198+
(match_operand:SI 1 "input_operand" "rO,M,K,I,r,m,i"))]
199199
"register_operand (operands[0], SImode)
200200
|| reg_or_0_operand (operands[1], SImode)"
201201
"@
@@ -204,8 +204,19 @@
204204
l.ori\t%0,r0,%1
205205
l.xori\t%0,r0,%1
206206
l.ori\t%0,%1,0
207-
l.lwz\t%0,%1"
208-
[(set_attr "type" "store,move,logic,logic,logic,load")])
207+
l.lwz\t%0,%1
208+
#"
209+
[(set_attr "type" "store,move,logic,logic,logic,load,unknown")])
210+
211+
(define_split
212+
[(set (match_operand:SI 0 "register_operand")
213+
(match_operand:SI 1 "immediate_operand"))]
214+
"!input_operand (operands[1], SImode)"
215+
[(const_int 0)]
216+
{
217+
or1k_expand_move (SImode, operands[0], operands[1]);
218+
DONE;
219+
})
209220

210221
(define_insn "*movsi_lo_sum"
211222
[(set (match_operand:SI 0 "register_operand" "=r")

0 commit comments

Comments
 (0)