Esempio n. 1
0
def sparc_ld_(obj, rd, a, op3, rs1, i, asi, rs2, simm13):
    adr = env.r[rs1]
    if i == 0:
        adr += env.r[rs2]
        src = env.ptr(adr, seg=asi)
    else:
        adr += env.cst(simm13, 13).signextend(32)
        src = env.ptr(adr)
    dst = env.r[rd]
    if op3 & 0xF == 0b0011 and rd % 1 == 1:
        raise InstructionError(obj)
    obj.operands = [src, dst]
    obj.type = type_data_processing
Esempio n. 2
0
def sparc_st_(obj, rd, a, op3, rs1, i, asi, rs2, simm13):
    adr = env.r[rs1]
    if i == 0:
        adr += env.r[rs2]
        dst = env.ptr(adr, asi)
    else:
        adr += env.cst(simm13, 13).signextend(32)
        dst = env.ptr(adr)
    src = env.r[rd]
    if obj.mnemonic == "std" and rd % 1 == 1:
        raise InstructionError(obj)
    obj.operands = [src, dst]
    obj.type = type_data_processing
Esempio n. 3
0
def sparc_st_(obj,rd,a,op3,rs1,i,asi,rs2,simm13):
    adr = env.r[rs1]
    if i==0:
        adr += env.r[rs2]
        if a==1: obj.mnemonic += 'a'
        dst = env.ptr(adr,asi)
    else:
        adr += env.cst(simm13,13).signextend(32)
        dst = env.ptr(adr)
        if a==1: raise InstructionError(obj)
    src = env.r[rd]
    if obj.mnemonic=='std' and rd%1==1: raise InstructionError(obj)
    obj.operands = [src,dst]
    obj.type = type_data_processing
Esempio n. 4
0
def sparc_ldf_ldc(obj,rd,a,op3,rs1,i,unused,rs2,simm13):
    adr = env.r[rs1]
    if i==0:
        adr += env.r[rs2]
    else:
        adr += env.cst(simm13,13).signextend(32)
    src = env.ptr(adr)
    dst = env.f[rd] if a==0 else env.c[rd]
    if op3&0xf==0b0001:
        dst = env.fsr if a==0 else env.csr
    obj.operands = [src,dst]
    obj.type = type_data_processing
Esempio n. 5
0
def sparc_stf_stc(obj, rd, a, op3, rs1, i, unused, rs2, simm13):
    adr = env.r[rs1]
    if i == 0:
        adr += env.r[rs2]
    else:
        adr += env.cst(simm13, 13).signextend(32)
    dst = env.ptr(adr)
    src = env.f[rd] if a == 0 else env.c[rd]
    if op3 & 0xF == 0b0101:
        src = env.fsr if a == 0 else env.csr
    elif op3 & 0xF == 0b0110:
        src = env.fq if a == 0 else env.cq
    obj.operands = [src, dst]
    obj.type = type_data_processing