Exemplo n.º 1
0
def _(op, block):
    src1 = gen(op[0], block)
    src2 = gen(op[1], block)
    dst = VReg()
    block.append(('move', dst, src1))
    block.append(('sub', dst, src2))
    return dst
def _(op, block):
    src1 = gen(op[0], block)
    src2 = gen(op[1], block)
    dst = VReg()
    block.append(Motion(dst, src1))
    block.append(Code(
        ('sub {}, {}', dst, src2),
        uses={dst, src2},
        defs={dst}))
    return dst
Exemplo n.º 3
0
def _(op, block):
    src1 = gen(op[0], block)
    src2 = op[1].value
    dst = VReg()
    block.append(('move', dst, src1))
    block.append(('add', dst, src2))
    return dst
def _(op, block):
    src1 = gen(op[0], block)
    src2 = op[1].value
    dst = VReg()
    block.append(Motion(dst, src1))
    block.append(Code(
        ('add {}, {}', dst, src2),
        uses={dst},
        defs={dst}))
    return dst