Exemple #1
0
        'General purpose registers',
        units=16, prefix='r',
        names='rax rcx rdx rbx rsp rbp rsi rdi'.split())

FloatRegs = RegBank(
        'FloatRegs', ISA,
        'SSE floating point registers',
        units=16, prefix='xmm')

FlagRegs = RegBank(
        'FlagRegs', ISA,
        'Flag registers',
        units=1,
        pressure_tracking=False,
        names=['rflags'])

GPR = RegClass(IntRegs)
GPR8 = GPR[0:8]
ABCD = GPR[0:4]
FPR = RegClass(FloatRegs)
FPR8 = FPR[0:8]
FLAG = RegClass(FlagRegs)

# Constraints for stack operands.

# Stack operand with a 32-bit signed displacement from either RBP or RSP.
StackGPR32 = Stack(GPR)
StackFPR32 = Stack(FPR)

RegClass.extract_names(globals())
Exemple #2
0
        ins=(GPR, GPR), outs=(),
        branch_range=(0, 13),
        emit='''
        let dest = i64::from(func.offsets[destination]);
        let disp = dest - i64::from(sink.offset());
        put_sb(bits, disp, in_reg0, in_reg1, sink);
        ''')

# SB-type branch instruction with rs2 fixed to zero.
SBzero = EncRecipe(
        'SBzero', Branch, size=4,
        ins=(GPR), outs=(),
        branch_range=(0, 13),
        emit='''
        let dest = i64::from(func.offsets[destination]);
        let disp = dest - i64::from(sink.offset());
        put_sb(bits, disp, in_reg0, 0, sink);
        ''')

# Spill of a GPR.
GPsp = EncRecipe(
        'GPsp', Unary, size=4,
        ins=GPR, outs=Stack(GPR),
        emit='unimplemented!();')

# Fill of a GPR.
GPfi = EncRecipe(
        'GPfi', Unary, size=4,
        ins=Stack(GPR), outs=GPR,
        emit='unimplemented!();')
Exemple #3
0
        ''')

# SB-type branch instruction with rs2 fixed to zero.
SBzero = EncRecipe('SBzero',
                   Branch,
                   size=4,
                   ins=(GPR),
                   outs=(),
                   branch_range=(0, 13),
                   emit='''
        let dest = i64::from(func.offsets[destination]);
        let disp = dest - i64::from(sink.offset());
        put_sb(bits, disp, in_reg0, 0, sink);
        ''')

# Spill of a GPR.
GPsp = EncRecipe('GPsp',
                 Unary,
                 size=4,
                 ins=GPR,
                 outs=Stack(GPR),
                 emit='unimplemented!();')

# Fill of a GPR.
GPfi = EncRecipe('GPfi',
                 Unary,
                 size=4,
                 ins=Stack(GPR),
                 outs=GPR,
                 emit='unimplemented!();')
Exemple #4
0
        put_sb(bits, disp, in_reg0, in_reg1, sink);
        ''')

# SB-type branch instruction with rs2 fixed to zero.
SBzero = EncRecipe(
        'SBzero', Branch, base_size=4,
        ins=(GPR), outs=(),
        branch_range=(0, 13),
        emit='''
        let dest = i64::from(func.offsets[destination]);
        let disp = dest - i64::from(sink.offset());
        put_sb(bits, disp, in_reg0, 0, sink);
        ''')

# Spill of a GPR.
GPsp = EncRecipe(
        'GPsp', Unary, base_size=4,
        ins=GPR, outs=Stack(GPR),
        emit='unimplemented!();')

# Fill of a GPR.
GPfi = EncRecipe(
        'GPfi', Unary, base_size=4,
        ins=Stack(GPR), outs=GPR,
        emit='unimplemented!();')

# Stack-slot-to-the-same-stack-slot copy, which is guaranteed to turn
# into a no-op.
stacknull = EncRecipe('stacknull', Unary, base_size=0,
                      ins=Stack(GPR), outs=Stack(GPR), emit='')