[MIPS] avoiding certain instruction in delay slots
Maciej W. Rozycki
macro@linux-mips.org
Mon Feb 3 15:14:00 GMT 2014
On Mon, 3 Feb 2014, Richard Sandiford wrote:
> If this particular errata applies specifically to delay slots though,
> you'd need to handle it differently from -mfix-24k. You'd need to teach
> both GCC and GAS about the restrictions. In the GCC case this would be
> by setting the "can_delay" attribute to "no" for the problem cases,
> while for GAS it would be making can_swap_branch_p return false.
You'd have to teach GAS to bail out on delay slots already scheduled
manually in handcoded assembly too, e.g.:
.set noreorder
beqz $2, foo
lw $2, 8($sp)
cannot be resolved automatically (the two instructions cannot be swapped
and NOP inserted in the delay slot instead; not that GAS already supports
it anyway) because of a data dependency on $2 and you do want to make the
user aware of this issue so that they can rewrite code instead.
Maciej
More information about the Binutils
mailing list