Example #1
0
def arm64_stp(ctx, i):
    a = operand.get(ctx, i, 0)
    b = operand.get(ctx, i, 1)

    value = ctx.tmp(a.size + b.size)
    ctx.emit(  str_  (a, value))
    ctx.emit(  lshl_ (value, b.size, value))
    ctx.emit(  or_   (b, value, value))

    operand.set(ctx, i, 2, value, i.writeback)
Example #2
0
def arm64_stp(ctx, i):
    a = operand.get(ctx, i, 0)
    b = operand.get(ctx, i, 1)

    value = ctx.tmp(a.size + b.size)
    ctx.emit(str_(a, value))
    ctx.emit(lshl_(value, b.size, value))
    ctx.emit(or_(b, value, value))

    operand.set(ctx, i, 2, value, i.writeback)
Example #3
0
def arm64_sub(ctx, i):
    if len(i.operands) == 3:
        dst_idx = 0
        a_idx = 1
        b_idx = 2
    else:
        dst_idx = 0
        a_idx = 0
        b_idx = 1

    a = operand.get(ctx, i, a_idx)
    b = operand.get(ctx, i, b_idx, a.size)

    result = ctx.tmp(a.size * 2)

    ctx.emit(sub_(a, b, result))

    if i.update_flags:
        _sub_set_flags(ctx, a, b, result)

    operand.set(ctx, i, dst_idx, result)
Example #4
0
def arm64_sub(ctx, i):
    if len(i.operands) == 3:
        dst_idx = 0
        a_idx = 1
        b_idx = 2
    else:
        dst_idx = 0
        a_idx = 0
        b_idx = 1

    a = operand.get(ctx, i, a_idx)
    b = operand.get(ctx, i, b_idx, a.size)

    result = ctx.tmp(a.size * 2)

    ctx.emit(  sub_  (a, b, result))

    if i.update_flags:
        _sub_set_flags(ctx, a, b, result)

    operand.set(ctx, i, dst_idx, result)
Example #5
0
def arm64_b(ctx, i):
    a = operand.get(ctx, i, 0)
    cond = conditional.condition(ctx, i.cc)
    ctx.emit(jcc_(cond, a))
Example #6
0
def arm64_mov(ctx, i):
    value = operand.get(ctx, i, 1)
    operand.set(ctx, i, 0, value, i.writeback)
Example #7
0
def arm64_mov(ctx, i):
    value = operand.get(ctx, i, 1)
    operand.set(ctx, i, 0, value, i.writeback)
Example #8
0
def arm64_b(ctx, i):
    a = operand.get(ctx, i, 0)
    cond = conditional.condition(ctx, i.cc)
    ctx.emit(  jcc_  (cond, a))