Further restrict Intel register classes to prevent incorrect encoding of R12 derefs.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
584a33bca7
commit
21f0fc39ad
@@ -46,10 +46,13 @@ FlagRegs = RegBank(
|
||||
names=['eflags'])
|
||||
|
||||
GPR = RegClass(IntRegs)
|
||||
# Certain types of deref encodings cannot be used with all registers.
|
||||
# R13/RBP cannot be used with zero-offset load or store instructions.
|
||||
# R12 cannot be used with a non-SIB-byte encoding of all derefs.
|
||||
GPR_DEREF_SAFE = GPR.without(GPR.r12)
|
||||
GPR_ZERO_DEREF_SAFE = GPR_DEREF_SAFE.without(GPR.rbp, GPR.r13)
|
||||
GPR8 = GPR[0:8]
|
||||
# In certain instructions, RBP and R13 are interpreted as RIP-relative.
|
||||
GPR_NORIP = GPR.without(GPR.rbp, GPR.r13)
|
||||
GPR8_NORIP = GPR8.without(GPR.rbp)
|
||||
GPR8_ZERO_DEREF_SAFE = GPR8.without(GPR.rbp)
|
||||
ABCD = GPR[0:4]
|
||||
FPR = RegClass(FloatRegs)
|
||||
FPR8 = FPR[0:8]
|
||||
|
||||
Reference in New Issue
Block a user