[aarch64-port-dev ] RFR: Fix for large frame size adjusts

Edward Nevill edward.nevill at linaro.org
Tue Aug 6 03:47:44 PDT 2013


On Tue, 2013-08-06 at 11:20 +0100, Andrew Haley wrote:
> On 08/02/2013 06:20 PM, edward.nevill at linaro.org wrote:
> > Hi,
> > 
> > The following fixes failures when the frame size is greater than 1<<12.
> > 

> I think you need to explain "S flag not set".
> Why is it only allowed for sp?

Sorry, I mean S bit, not S flag, IE bit 29 of the add/sub instruction.

The S bit is never set for ADD/SUB sp, sp, #N.

Therefore it is safe to do

SUB Rd, Rn, #<large N>

as two subtracts only when Rd == Rn == sp.

Otherwise the flags could be set incorrectly.

If we knew that the S bit was not set then this could be applied more generally. However, this information is not readily available in 'wrap_add_sub_imm' and would need to be derived, or passed in.

In general, would it be better to transpose

ADD/SUB Rd, Rn, #<large N>

to two ADD/SUB instructions where possible, rather than

MOV Rd, #<large N>
ADD/SUB Rd, Rn, Rd

?

All the best,
Ed.





More information about the aarch64-port-dev mailing list