Add RISC-V encodings for spill and fill.
Add a Stack() class for specifying operand constraints for values on the stack. Add encoding recipes for RISC-V spill and fill instructions. Don't implement the encoding recipe functions yet since we don't have the stack slot layout yet.
This commit is contained in:
@@ -6,8 +6,9 @@ from base import instructions as base
|
||||
from base.immediates import intcc
|
||||
from .defs import RV32, RV64
|
||||
from .recipes import OPIMM, OPIMM32, OP, OP32, LUI, BRANCH, JALR, JAL
|
||||
from .recipes import LOAD, STORE
|
||||
from .recipes import R, Rshamt, Ricmp, I, Iicmp, Iret
|
||||
from .recipes import U, UJ, UJcall, SB, SBzero
|
||||
from .recipes import U, UJ, UJcall, SB, SBzero, GPsp, GPfi
|
||||
from .settings import use_m
|
||||
from cdsl.ast import Var
|
||||
|
||||
@@ -114,3 +115,11 @@ for inst, f3 in [
|
||||
# is added by legalize_signature().
|
||||
RV32.enc(base.x_return, Iret, JALR())
|
||||
RV64.enc(base.x_return, Iret, JALR())
|
||||
|
||||
# Spill and fill.
|
||||
RV32.enc(base.spill.i32, GPsp, STORE(0b010))
|
||||
RV64.enc(base.spill.i32, GPsp, STORE(0b010))
|
||||
RV64.enc(base.spill.i64, GPsp, STORE(0b011))
|
||||
RV32.enc(base.fill.i32, GPfi, LOAD(0b010))
|
||||
RV64.enc(base.fill.i32, GPfi, LOAD(0b010))
|
||||
RV64.enc(base.fill.i64, GPfi, LOAD(0b011))
|
||||
|
||||
Reference in New Issue
Block a user