AArch64Address.lea missed BASE_REGISTER_ONLY case

Andrew Dinn adinn at redhat.com
Wed Feb 28 10:21:00 UTC 2018


Hi Dimitry,

On 27/02/18 18:45, Dmitry Samersoff wrote:
> Is it a bug? If yes, I'll create a pull requires with the fix.
Sorry, but no. lea means load effective address. It is there to compute
an address from a base address provided in some given register combined
with an offset. The latter is provided either via another register or as
a constant which can be encoded as an immediate. Essentially, it does an
add.

If you just have a base register with no offset to add then lea would
simply reduce to a register copy. In which case . . . this is not the
instruction you were looking for. Throwing a Graal shouldNotReachHere
error is the correct response.

At present the only place where AArch64ddress.lea gets called in from
MacroAssembler.lea and that only ever gets called from
AArch64ArrayEqualsOp with either a register offset address or an
unscaled immediate address. So, all is well.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the graal-dev mailing list