You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We might want to investigate a R_ADDRARM64 relocation that would not
require pool literals.
Right now MOV g(SB), R is
MOV pool(PC), TMP
MOV (TMP), R
...
DWORD g(SB)
So it uses 8 bytes of instructions and 8 bytes of pool. Note that the
pool literals are not coalesced (perhaps this can be implemented). We
can say that the cost of using R_ADDR is:
Cost(n * R_ADDR) = {2n+2n bytes, 2n loads}
A potential R_ADDRARM64 might do this instead:
ADRP g(SB), TMP
MOV off(TMP), R
The ADRP instruction calculates the 4k page which holds g(SB), the final
MOV can just encode an immediate offset since it's in C_ADDCON0 class.
For MOV g(SB), R the generated code is:
ADRP g(SB), R
ADR g(SB), R
Note that we don't even need the temporary register, and we don't even do any loads.
In both cases we don't need pool literals at all, and they only do one
or zero loads!
We might want to investigate a R_ADDRARM64 relocation that would not
require pool literals.
Right now
MOV g(SB), R
isSo it uses 8 bytes of instructions and 8 bytes of pool. Note that the
pool literals are not coalesced (perhaps this can be implemented). We
can say that the cost of using R_ADDR is:
A potential R_ADDRARM64 might do this instead:
The ADRP instruction calculates the 4k page which holds g(SB), the final
MOV can just encode an immediate offset since it's in C_ADDCON0 class.
For
MOV g(SB), R
the generated code is:Note that we don't even need the temporary register, and we don't even do any loads.
In both cases we don't need pool literals at all, and they only do one
or zero loads!
Related to issue #10108.
Replaces 4ad/go#66.
The text was updated successfully, but these errors were encountered: