def riscv_b(obj, rs1, rs2, imm1, imm2, imm3, imm4): r1 = env.x[rs1] r2 = env.x[rs2] imm = imm1 // imm2 // imm3 // imm4 imm = env.cst(imm.int(-1), 32) << 1 obj.operands = [r1, r2, imm] obj.type = type_control_flow
def riscv_jal(obj, imm1, imm2, imm3, imm4, rd): dst = env.x[rd] imm = imm1 // imm2 // imm3 // imm4 obj.operands = [dst, env.cst(imm.int(-1), 32) << 1] obj.type = type_control_flow
def riscv_ri_arithmetic2(obj, imm, rd): dst = env.x[rd] imm = env.cst(imm << 12, 32) obj.operands = [dst, imm] obj.type = type_data_processing
def riscv_ri_shifts(obj, imm, rs1, rd): src1 = env.x[rs1] imm = env.cst(imm, 32) dst = env.x[rd] obj.operands = [dst, src1, imm] obj.type = type_data_processing
def riscv_ri_arithmetic1(obj, imm, rs1, rd): src1 = env.x[rs1] imm = env.cst(imm.int(-1), 32) dst = env.x[rd] obj.operands = [dst, src1, imm] obj.type = type_data_processing
def riscv_jalr(obj, imm, rs1, rd): r1 = env.x[rs1] dst = env.x[rd] imm = env.cst(imm.int(-1), 32) obj.operands = [dst, r1, imm] obj.type = type_control_flow