AArch64: make use of reg-reg-extend amode.
When a load/store instruction needs an address of the form `v0 + uextend(v1)` or `v0 + sextend(v1)` (or the commuted forms thereof), we currently generate a separate zero/sign-extend operation and then use a plain `[rA, rB]` addressing mode. This patch extends `lower_address()` to look at both addends of an address if it has two addends and a zero offset, recognize extension operations, and incorporate them directly into a `[rA, rB, UXTW]` or `[rA, rB, SXTW]` form. This should improve our performence on WebAssembly workloads, at least, because we often see a 64-bit linear memory base indexed by a 32-bit (Wasm) pointer value.
This commit is contained in:
@@ -1281,6 +1281,15 @@ fn test_aarch64_binemit() {
|
||||
"41D863F8",
|
||||
"ldr x1, [x2, w3, SXTW #3]",
|
||||
));
|
||||
insns.push((
|
||||
Inst::ULoad64 {
|
||||
rd: writable_xreg(1),
|
||||
mem: MemArg::RegExtended(xreg(2), xreg(3), ExtendOp::SXTW),
|
||||
srcloc: None,
|
||||
},
|
||||
"41C863F8",
|
||||
"ldr x1, [x2, w3, SXTW]",
|
||||
));
|
||||
insns.push((
|
||||
Inst::ULoad64 {
|
||||
rd: writable_xreg(1),
|
||||
@@ -1474,6 +1483,15 @@ fn test_aarch64_binemit() {
|
||||
"415823F8",
|
||||
"str x1, [x2, w3, UXTW #3]",
|
||||
));
|
||||
insns.push((
|
||||
Inst::Store64 {
|
||||
rd: xreg(1),
|
||||
mem: MemArg::RegExtended(xreg(2), xreg(3), ExtendOp::UXTW),
|
||||
srcloc: None,
|
||||
},
|
||||
"414823F8",
|
||||
"str x1, [x2, w3, UXTW]",
|
||||
));
|
||||
insns.push((
|
||||
Inst::Store64 {
|
||||
rd: xreg(1),
|
||||
|
||||
Reference in New Issue
Block a user