Lines Matching refs:reg
796 sljit_s32 reg; in emit_op_imm() local
807 reg = (sljit_s32)((flags & ARG2_IMM) ? arg1 : arg2); in emit_op_imm()
828 if (IS_2_LO_REGS(reg, dst)) { in emit_op_imm()
830 return push_inst16(compiler, ADDSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
832 return push_inst16(compiler, SUBSI3 | IMM3(imm2) | RD3(dst) | RN3(reg)); in emit_op_imm()
833 if (reg == dst) { in emit_op_imm()
842 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
844 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(imm2)); in emit_op_imm()
848 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm2); in emit_op_imm()
851 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
857 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm2); in emit_op_imm()
861 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
867 if (imm == 0 && IS_2_LO_REGS(reg, dst)) in emit_op_imm()
868 return push_inst16(compiler, RSBSI | RD3(dst) | RN3(reg)); in emit_op_imm()
871 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
875 if (imm <= 0xff && reg_map[reg] <= 7) in emit_op_imm()
876 return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg)); in emit_op_imm()
879 return push_inst32(compiler, CMPI_W | RN4(reg) | imm2); in emit_op_imm()
882 return push_inst32(compiler, CMNI_W | RN4(reg) | imm); in emit_op_imm()
886 if (IS_2_LO_REGS(reg, dst)) { in emit_op_imm()
888 return push_inst16(compiler, SUBSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
890 return push_inst16(compiler, ADDSI3 | IMM3(imm2) | RD3(dst) | RN3(reg)); in emit_op_imm()
891 if (reg == dst) { in emit_op_imm()
900 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
902 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(imm2)); in emit_op_imm()
906 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm2); in emit_op_imm()
909 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
917 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm2); in emit_op_imm()
920 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
925 …piler, ((flags & UNUSED_RETURN) ? TSTI : ANDI) | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm2); in emit_op_imm()
928 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
933 return push_inst32(compiler, ORRI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm2); in emit_op_imm()
936 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
940 if (IS_2_LO_REGS(dst, reg)) in emit_op_imm()
941 return push_inst16(compiler, MVNS | RD3(dst) | RN3(reg)); in emit_op_imm()
942 return push_inst32(compiler, MVN_W | (flags & SET_FLAGS) | RD4(dst) | RM4(reg)); in emit_op_imm()
946 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
962 return push_inst16(compiler, MOV | SET_REGS44(dst, reg)); in emit_op_imm()
963 if (IS_2_LO_REGS(dst, reg)) in emit_op_imm()
964 return push_inst16(compiler, MOVS | RD3(dst) | RN3(reg)); in emit_op_imm()
965 return push_inst32(compiler, MOV_W | SET_FLAGS | RD4(dst) | RM4(reg)); in emit_op_imm()
971 if (IS_2_LO_REGS(dst, reg)) in emit_op_imm()
972 return push_inst16(compiler, LSLSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
973 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
976 if (IS_2_LO_REGS(dst, reg)) in emit_op_imm()
977 return push_inst16(compiler, LSRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
978 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
981 if (IS_2_LO_REGS(dst, reg)) in emit_op_imm()
982 return push_inst16(compiler, ASRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
983 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
988 return push_inst32(compiler, ROR_WI | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
1100 reg = (dst == TMP_REG2) ? TMP_REG1 : TMP_REG2; in emit_op_imm()
1101 FAIL_IF(push_inst32(compiler, SMULL | RT4(dst) | RD4(reg) | RN4(arg1) | RM4(arg2))); in emit_op_imm()
1103 return push_inst32(compiler, CMP_W | RN4(reg) | 0x70e0 | RM4(dst)); in emit_op_imm()
1119 reg = (arg2 == TMP_REG1) ? TMP_REG1 : TMP_REG2; in emit_op_imm()
1120 FAIL_IF(push_inst32(compiler, ANDI | RD4(reg) | RN4(arg2) | 0x1f)); in emit_op_imm()
1121 arg2 = (sljit_uw)reg; in emit_op_imm()
1128 reg = (arg2 == TMP_REG1) ? TMP_REG1 : TMP_REG2; in emit_op_imm()
1129 FAIL_IF(push_inst32(compiler, ANDI | RD4(reg) | RN4(arg2) | 0x1f)); in emit_op_imm()
1130 arg2 = (sljit_uw)reg; in emit_op_imm()
1137 reg = (arg2 == TMP_REG1) ? TMP_REG1 : TMP_REG2; in emit_op_imm()
1138 FAIL_IF(push_inst32(compiler, ANDI | RD4(reg) | RN4(arg2) | 0x1f)); in emit_op_imm()
1139 arg2 = (sljit_uw)reg; in emit_op_imm()
1146 reg = (arg2 == TMP_REG1) ? TMP_REG1 : TMP_REG2; in emit_op_imm()
1147 FAIL_IF(push_inst32(compiler, RSB_WI | RD4(reg) | RN4(arg2) | 0)); in emit_op_imm()
1148 arg2 = (sljit_uw)reg; in emit_op_imm()
1245 static sljit_s32 emit_set_delta(struct sljit_compiler *compiler, sljit_s32 dst, sljit_s32 reg, slji… in emit_set_delta() argument
1251 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(value)); in emit_set_delta()
1254 return push_inst32(compiler, ADD_WI | RD4(dst) | RN4(reg) | imm); in emit_set_delta()
1259 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(value)); in emit_set_delta()
1262 return push_inst32(compiler, SUB_WI | RD4(dst) | RN4(reg) | imm); in emit_set_delta()
1267 …SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, in emit_op_mem() argument
1280 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg) | (argw & 0x… in emit_op_mem()
1284 if (IS_2_LO_REGS(reg, tmp_reg) && sljit_mem16_imm5[flags]) in emit_op_mem()
1285 return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(tmp_reg)); in emit_op_mem()
1286 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg)); in emit_op_mem()
1294 if (!argw && IS_3_LO_REGS(reg, arg, other_r)) in emit_op_mem()
1295 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)); in emit_op_mem()
1296 …return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | ((sljit_ins… in emit_op_mem()
1324 if (IS_2_LO_REGS(reg, arg) && sljit_mem16_imm5[flags]) { in emit_op_mem()
1342 …return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | ((sljit_ins)argw << (… in emit_op_mem()
1344 …IKELY(arg == SLJIT_SP) && IS_WORD_SIZE(flags) && ALIGN_CHECK(argw, 0xff, 2) && reg_map[reg] <= 7) { in emit_op_mem()
1346 …return push_inst16(compiler, STR_SP | (sljit_ins)((flags & STORE) ? 0 : 0x800) | RDN3(reg) | ((slj… in emit_op_mem()
1350 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | (sljit_ins)arg… in emit_op_mem()
1352 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | (sljit_ins)-arg… in emit_op_mem()
1357 if (IS_3_LO_REGS(reg, arg, tmp_reg)) in emit_op_mem()
1358 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(tmp_reg)); in emit_op_mem()
1359 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(tmp_reg)); in emit_op_mem()
2197 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_register_index(sljit_s32 type, sljit_s32 reg) in sljit_get_register_index() argument
2199 CHECK_REG_INDEX(check_sljit_get_register_index(type, reg)); in sljit_get_register_index()
2202 return reg_map[reg]; in sljit_get_register_index()
2205 return freg_map[reg]; in sljit_get_register_index()
2208 return freg_map[reg] & ~0x1; in sljit_get_register_index()
2230 static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, slji… in emit_fop_mem() argument
2246 …return push_inst32(compiler, inst | 0x800000 | RN4(arg & REG_MASK) | VD4(reg) | ((sljit_uw)argw >>… in emit_fop_mem()
2248 return push_inst32(compiler, inst | RN4(arg & REG_MASK) | VD4(reg) | ((sljit_uw)-argw >> 2)); in emit_fop_mem()
2254 return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | VD4(reg)); in emit_fop_mem()
2260 …return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | VD4(reg) | (((sljit_uw)argw & 0x3fc… in emit_fop_mem()
2267 return push_inst32(compiler, inst | RN4(TMP_REG1) | VD4(reg) | (((sljit_uw)argw & 0x3fc) >> 2)); in emit_fop_mem()
2274 return push_inst32(compiler, inst | 0x800000 | RN4(TMP_REG1) | VD4(reg)); in emit_fop_mem()
2528 sljit_s32 freg, sljit_s32 reg) in sljit_emit_fcopy() argument
2534 CHECK(check_sljit_emit_fcopy(compiler, op, freg, reg)); in sljit_emit_fcopy()
2536 if (reg & REG_PAIR_MASK) { in sljit_emit_fcopy()
2537 reg2 = REG_PAIR_SECOND(reg); in sljit_emit_fcopy()
2538 reg = REG_PAIR_FIRST(reg); in sljit_emit_fcopy()
2540 inst = VMOV2 | RN4(reg) | RT4(reg2) | VM4(freg); in sljit_emit_fcopy()
2542 inst = VMOV | VN4(freg) | RT4(reg); in sljit_emit_fcopy()
3208 sljit_s32 reg, in sljit_emit_mem() argument
3215 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
3217 if (!(reg & REG_PAIR_MASK)) in sljit_emit_mem()
3218 return sljit_emit_mem_unaligned(compiler, type, reg, mem, memw); in sljit_emit_mem()
3297 } else if (REG_PAIR_FIRST(reg) == (mem & REG_MASK)) { in sljit_emit_mem()
3298 …FAIL_IF(emit_op_mem(compiler, WORD_SIZE, REG_PAIR_SECOND(reg), mem, memw + SSIZE_OF(sw), TMP_REG2)… in sljit_emit_mem()
3299 return emit_op_mem(compiler, WORD_SIZE, REG_PAIR_FIRST(reg), mem, memw, TMP_REG2); in sljit_emit_mem()
3302 FAIL_IF(emit_op_mem(compiler, flags, REG_PAIR_FIRST(reg), mem, memw, TMP_REG2)); in sljit_emit_mem()
3303 return emit_op_mem(compiler, flags, REG_PAIR_SECOND(reg), mem, memw + SSIZE_OF(sw), TMP_REG2); in sljit_emit_mem()
3379 … (sljit_ins)flags | RN4(mem & REG_MASK) | RT4(REG_PAIR_FIRST(reg)) | RD4(REG_PAIR_SECOND(reg)) | (… in sljit_emit_mem()
3383 sljit_s32 reg, in sljit_emit_mem_update() argument
3390 CHECK(check_sljit_emit_mem_update(compiler, type, reg, mem, memw)); in sljit_emit_mem_update()
3437 return push_inst32(compiler, inst | RT4(reg) | RN4(mem & REG_MASK) | (sljit_ins)memw); in sljit_emit_mem_update()