mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-17 15:44:18 +08:00
refactor(arm64): use symbolic constants in arm64_spoff
This commit is contained in:
parent
c15dff2e5a
commit
c6e3606fae
@ -299,11 +299,10 @@ static void arm64_spoff(int reg, uint64_t off)
|
||||
if (sub)
|
||||
off = -off;
|
||||
if (off < 4096)
|
||||
o(0x910003e0 | sub << 30 | reg | off << 10);
|
||||
// (add|sub) x(reg),sp,#(off)
|
||||
o(ARM64_ADD_IMM | ARM64_SF(1) | ARM64_RN(31) | ARM64_RD(reg) | ARM64_IMM12(off));
|
||||
else {
|
||||
arm64_movimm(30, off); // use x30 for offset
|
||||
o(0x8b3e63e0 | sub << 30 | reg); // (add|sub) x(reg),sp,x30
|
||||
arm64_movimm(30, off);
|
||||
o(ARM64_ADD_REG | ARM64_SF(1) | ARM64_RM(30) | ARM64_RN(31) | ARM64_RD(reg) | (sub << 31));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user