[aarch64-port-dev ] Fix to addmw

Andrew Haley aph at redhat.com
Fri Dec 27 07:03:15 PST 2013


On 12/27/2013 11:18 AM, Edward Nevill wrote:
> Hi,
> 
> addmw immediate currently does
> 
> void addmw(Address a, int imm, Register scratch) {
>     lea(scratch, a);
>     ldrw(scratch, Address(scratch));
>      if (imm > 0)
>        addw(scratch, scratch, (unsigned)imm);
>      else
>        subw(scratch, scratch, (unsigned)-imm);
>     lea(scratch, a);
>     strw(scratch, Address(scratch));  /// <<<< Write address into itself
> }
> 
> Unfortunately this does not have the desired effect, but instead writes the address of the memory word into itself.

D'oh!  Thank you.

Andrew.


More information about the aarch64-port-dev mailing list