Remove RSP from deref safe register class as well.

This commit is contained in:
Tyler McMullen
2018-01-29 14:12:01 -08:00
committed by Jakob Stoklund Olesen
parent 099b959d57
commit ff16583c59
2 changed files with 6 additions and 5 deletions

View File

@@ -12,8 +12,8 @@ from base.formats import Jump, Branch, BranchInt, BranchFloat
from base.formats import Ternary, FuncAddr, UnaryGlobalVar from base.formats import Ternary, FuncAddr, UnaryGlobalVar
from base.formats import RegMove, RegSpill, RegFill, CopySpecial from base.formats import RegMove, RegSpill, RegFill, CopySpecial
from .registers import GPR, ABCD, FPR, GPR_DEREF_SAFE, GPR_ZERO_DEREF_SAFE from .registers import GPR, ABCD, FPR, GPR_DEREF_SAFE, GPR_ZERO_DEREF_SAFE
from .registers import GPR8, FPR8, GPR8_ZERO_DEREF_SAFE, FLAG, StackGPR32 from .registers import GPR8, FPR8, GPR8_DEREF_SAFE, GPR8_ZERO_DEREF_SAFE, FLAG
from .registers import StackFPR32 from .registers import StackGPR32, StackFPR32
from .defs import supported_floatccs from .defs import supported_floatccs
from .settings import use_sse41 from .settings import use_sse41
@@ -105,7 +105,7 @@ def replace_put_op(emit, prefix):
# Register class mapping for no-REX instructions. # Register class mapping for no-REX instructions.
NOREX_MAP = { NOREX_MAP = {
GPR: GPR8, GPR: GPR8,
GPR_DEREF_SAFE: GPR8, GPR_DEREF_SAFE: GPR8_DEREF_SAFE,
GPR_ZERO_DEREF_SAFE: GPR8_ZERO_DEREF_SAFE, GPR_ZERO_DEREF_SAFE: GPR8_ZERO_DEREF_SAFE,
FPR: FPR8 FPR: FPR8
} }

View File

@@ -49,10 +49,11 @@ GPR = RegClass(IntRegs)
# Certain types of deref encodings cannot be used with all registers. # Certain types of deref encodings cannot be used with all registers.
# R13/RBP cannot be used with zero-offset load or store instructions. # 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. # R12 cannot be used with a non-SIB-byte encoding of all derefs.
GPR_DEREF_SAFE = GPR.without(GPR.r12) GPR_DEREF_SAFE = GPR.without(GPR.rsp, GPR.r12)
GPR_ZERO_DEREF_SAFE = GPR_DEREF_SAFE.without(GPR.rbp, GPR.r13) GPR_ZERO_DEREF_SAFE = GPR_DEREF_SAFE.without(GPR.rbp, GPR.r13)
GPR8 = GPR[0:8] GPR8 = GPR[0:8]
GPR8_ZERO_DEREF_SAFE = GPR8.without(GPR.rbp) GPR8_DEREF_SAFE = GPR8.without(GPR.rsp)
GPR8_ZERO_DEREF_SAFE = GPR8_DEREF_SAFE.without(GPR.rbp)
ABCD = GPR[0:4] ABCD = GPR[0:4]
FPR = RegClass(FloatRegs) FPR = RegClass(FloatRegs)
FPR8 = FPR[0:8] FPR8 = FPR[0:8]