This is the mail archive of the
mailing list for the binutils project.
Re: [MIPS] avoiding certain instruction in delay slots
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: Sven Anderson <sven at anderson dot de>, binutils at sourceware dot org
- Date: Mon, 3 Feb 2014 15:14:50 +0000 (GMT)
- Subject: Re: [MIPS] avoiding certain instruction in delay slots
- Authentication-results: sourceware.org; auth=none
- References: <52EF785C dot 7010509 at anderson dot de> <87fvo0dz1g dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com>
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.:
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.