Altera_Forum
Honored Contributor
16 years agogcc optimisation for movsi_internal
The gcc sources (9.0 b141) seem to be missing the pattern that would load a 32bit values whose low bits are all zero into a register (ie a single movhi instruction), the patterns for orhi and andhi are present.
Adding 'K' as below (about line 290 of nios2.md)
(define_insn "movsi_internal"
"(register_operand (operands, SImode)
|| reg_or_0_operand (operands, SImode))"
"@
stw%o0\\t%z1, %0
ldw%o1\\t%0, %1
mov\\t%0, %z1
movi\\t%0, %1
movui\\t%0, %1
movhi\\t%0, %U1
addi\\t%0, gp, %%gprel(%1)
movhi\\t%0, %H1\;addi\\t%0, %0, %L1"
)
seems to have the desired effect. I can't see any reason why this wasn't done - except, perhaps, oversight. What is the best way of feeding these sort of changes back?