Lines Matching refs:compiler

152 static sljit_s32 push_cpool(struct sljit_compiler *compiler)  in push_cpool()  argument
161 if (compiler->last_label && compiler->last_label->size == compiler->size) in push_cpool()
162 compiler->last_label->size += compiler->cpool_fill + (CONST_POOL_ALIGNMENT - 1) + 1; in push_cpool()
164 SLJIT_ASSERT(compiler->cpool_fill > 0 && compiler->cpool_fill <= CPOOL_SIZE); in push_cpool()
165 inst = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_cpool()
167 compiler->size++; in push_cpool()
168 *inst = 0xff000000 | compiler->cpool_fill; in push_cpool()
171 inst = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_cpool()
173 compiler->size++; in push_cpool()
177 cpool_ptr = compiler->cpool; in push_cpool()
178 cpool_end = cpool_ptr + compiler->cpool_fill; in push_cpool()
180 inst = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_cpool()
182 compiler->size++; in push_cpool()
185 compiler->cpool_diff = CONST_POOL_EMPTY; in push_cpool()
186 compiler->cpool_fill = 0; in push_cpool()
190 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_uw inst) in push_inst() argument
194 …if (SLJIT_UNLIKELY(compiler->cpool_diff != CONST_POOL_EMPTY && compiler->size - compiler->cpool_di… in push_inst()
195 FAIL_IF(push_cpool(compiler)); in push_inst()
197 ptr = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_inst()
199 compiler->size++; in push_inst()
204 static sljit_s32 push_inst_with_literal(struct sljit_compiler *compiler, sljit_uw inst, sljit_uw li… in push_inst_with_literal() argument
212 …if (SLJIT_UNLIKELY(compiler->cpool_diff != CONST_POOL_EMPTY && compiler->size - compiler->cpool_di… in push_inst_with_literal()
213 FAIL_IF(push_cpool(compiler)); in push_inst_with_literal()
214 else if (compiler->cpool_fill > 0) { in push_inst_with_literal()
215 cpool_ptr = compiler->cpool; in push_inst_with_literal()
216 cpool_end = cpool_ptr + compiler->cpool_fill; in push_inst_with_literal()
217 cpool_unique_ptr = compiler->cpool_unique; in push_inst_with_literal()
220 cpool_index = (sljit_uw)(cpool_ptr - compiler->cpool); in push_inst_with_literal()
230 if (compiler->cpool_fill < CPOOL_SIZE) { in push_inst_with_literal()
231 cpool_index = compiler->cpool_fill; in push_inst_with_literal()
232 compiler->cpool_fill++; in push_inst_with_literal()
235 FAIL_IF(push_cpool(compiler)); in push_inst_with_literal()
237 compiler->cpool_fill = 1; in push_inst_with_literal()
242 ptr = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_inst_with_literal()
244 compiler->size++; in push_inst_with_literal()
247 compiler->cpool[cpool_index] = literal; in push_inst_with_literal()
248 compiler->cpool_unique[cpool_index] = 0; in push_inst_with_literal()
249 if (compiler->cpool_diff == CONST_POOL_EMPTY) in push_inst_with_literal()
250 compiler->cpool_diff = compiler->size; in push_inst_with_literal()
254 static sljit_s32 push_inst_with_unique_literal(struct sljit_compiler *compiler, sljit_uw inst, slji… in push_inst_with_unique_literal() argument
257 …(SLJIT_UNLIKELY((compiler->cpool_diff != CONST_POOL_EMPTY && compiler->size - compiler->cpool_diff… in push_inst_with_unique_literal()
258 FAIL_IF(push_cpool(compiler)); in push_inst_with_unique_literal()
260 SLJIT_ASSERT(compiler->cpool_fill < CPOOL_SIZE && (inst & 0xfff) == 0); in push_inst_with_unique_literal()
261 ptr = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_inst_with_unique_literal()
263 compiler->size++; in push_inst_with_unique_literal()
264 *ptr = inst | compiler->cpool_fill; in push_inst_with_unique_literal()
266 compiler->cpool[compiler->cpool_fill] = literal; in push_inst_with_unique_literal()
267 compiler->cpool_unique[compiler->cpool_fill] = 1; in push_inst_with_unique_literal()
268 compiler->cpool_fill++; in push_inst_with_unique_literal()
269 if (compiler->cpool_diff == CONST_POOL_EMPTY) in push_inst_with_unique_literal()
270 compiler->cpool_diff = compiler->size; in push_inst_with_unique_literal()
274 static SLJIT_INLINE sljit_s32 prepare_blx(struct sljit_compiler *compiler) in prepare_blx() argument
277 …if (SLJIT_UNLIKELY(compiler->cpool_diff != CONST_POOL_EMPTY && compiler->size - compiler->cpool_di… in prepare_blx()
278 return push_cpool(compiler); in prepare_blx()
282 static SLJIT_INLINE sljit_s32 emit_blx(struct sljit_compiler *compiler) in emit_blx() argument
285 …SLJIT_ASSERT(compiler->cpool_diff == CONST_POOL_EMPTY || compiler->size - compiler->cpool_diff < M… in emit_blx()
288 return push_inst(compiler, BLX | RM(TMP_REG1)); in emit_blx()
343 static sljit_s32 resolve_const_pool_index(struct sljit_compiler *compiler, struct future_patch **fi… in resolve_const_pool_index() argument
348 SLJIT_UNUSED_ARG(compiler); in resolve_const_pool_index()
367 SLJIT_FREE(curr_patch, compiler->allocator_data); in resolve_const_pool_index()
377 …curr_patch = (struct future_patch*)SLJIT_MALLOC(sizeof(struct future_patch), compiler->allocator_d… in resolve_const_pool_index()
382 SLJIT_FREE(curr_patch, compiler->allocator_data); in resolve_const_pool_index()
398 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_uw inst) in push_inst() argument
402 ptr = (sljit_uw*)ensure_buf(compiler, sizeof(sljit_uw)); in push_inst()
404 compiler->size++; in push_inst()
409 static SLJIT_INLINE sljit_s32 emit_imm(struct sljit_compiler *compiler, sljit_s32 reg, sljit_sw imm) in emit_imm() argument
411 FAIL_IF(push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | ((sljit_u32)imm & 0xfff))); in emit_imm()
412 …return push_inst(compiler, MOVT | RD(reg) | ((imm >> 12) & 0xf0000) | (((sljit_u32)imm >> 16) & 0x… in emit_imm()
570 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 reg, sljit_uw imm);
571 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, sljit…
665 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
692 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
693 reverse_buf(compiler); in sljit_generate_code()
697 size = compiler->size + (compiler->patches << 1); in sljit_generate_code()
698 if (compiler->cpool_fill > 0) in sljit_generate_code()
699 size += compiler->cpool_fill + CONST_POOL_ALIGNMENT - 1; in sljit_generate_code()
701 size = compiler->size; in sljit_generate_code()
703 code = (sljit_uw*)SLJIT_MALLOC_EXEC(size * sizeof(sljit_uw), compiler->exec_allocator_data); in sljit_generate_code()
705 buf = compiler->buf; in sljit_generate_code()
721 label = compiler->labels; in sljit_generate_code()
722 jump = compiler->jumps; in sljit_generate_code()
723 const_ = compiler->consts; in sljit_generate_code()
724 put_label = compiler->put_labels; in sljit_generate_code()
743 …if (SLJIT_UNLIKELY(resolve_const_pool_index(compiler, &first_patch, cpool_current_index, cpool_sta… in sljit_generate_code()
744 SLJIT_FREE_EXEC(code, compiler->exec_allocator_data); in sljit_generate_code()
745 compiler->error = SLJIT_ERR_ALLOC_FAILED; in sljit_generate_code()
836 if (compiler->cpool_fill > 0) { in sljit_generate_code()
838 …ndex = patch_pc_relative_loads(last_pc_patch, code_ptr, cpool_start_address, compiler->cpool_fill); in sljit_generate_code()
842 buf_ptr = compiler->cpool; in sljit_generate_code()
843 buf_end = buf_ptr + compiler->cpool_fill; in sljit_generate_code()
846 …if (SLJIT_UNLIKELY(resolve_const_pool_index(compiler, &first_patch, cpool_current_index, cpool_sta… in sljit_generate_code()
847 SLJIT_FREE_EXEC(code, compiler->exec_allocator_data); in sljit_generate_code()
848 compiler->error = SLJIT_ERR_ALLOC_FAILED; in sljit_generate_code()
858 jump = compiler->jumps; in sljit_generate_code()
902 const_ = compiler->consts; in sljit_generate_code()
921 put_label = compiler->put_labels; in sljit_generate_code()
939 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
940 compiler->executable_offset = executable_offset; in sljit_generate_code()
941 compiler->executable_size = (sljit_uw)(code_ptr - code) * sizeof(sljit_uw); in sljit_generate_code()
1054 static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 inp_flags,
1059 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
1075 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
1076 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
1093 FAIL_IF(push_inst(compiler, PUSH | (1 << 14) | imm)); in sljit_emit_enter()
1095 FAIL_IF(push_inst(compiler, 0xe52d0004 | RD(TMP_REG2))); in sljit_emit_enter()
1102 FAIL_IF(push_inst(compiler, SUB | RD(SLJIT_SP) | RN(SLJIT_SP) | SRC2_IMM | sizeof(sljit_sw))); in sljit_emit_enter()
1107 …FAIL_IF(push_inst(compiler, VPUSH | VD(SLJIT_FS0) | ((sljit_uw)SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTE… in sljit_emit_enter()
1110 FAIL_IF(push_inst(compiler, VPUSH | VD(SLJIT_FS0) | ((sljit_uw)fsaveds << 1))); in sljit_emit_enter()
1112 …FAIL_IF(push_inst(compiler, VPUSH | VD(fscratches) | ((sljit_uw)(fscratches - (SLJIT_FIRST_SAVED_F… in sljit_emit_enter()
1117 compiler->local_size = local_size; in sljit_emit_enter()
1138 …FAIL_IF(push_inst(compiler, VMOV2 | (offset << 10) | ((offset + sizeof(sljit_sw)) << 14) | float_a… in sljit_emit_enter()
1140 FAIL_IF(push_inst(compiler, VLDR_F32 | 0x800100 | RN(SLJIT_SP) in sljit_emit_enter()
1147 FAIL_IF(push_inst(compiler, VMOV | (float_arg_count << 16) | (offset << 10))); in sljit_emit_enter()
1149 FAIL_IF(push_inst(compiler, VLDR_F32 | 0x800000 | RN(SLJIT_SP) in sljit_emit_enter()
1165 FAIL_IF(push_inst(compiler, MOV | RD(tmp) | (offset >> 2))); in sljit_emit_enter()
1167 …FAIL_IF(push_inst(compiler, LDR | 0x800000 | RN(SLJIT_SP) | RD(tmp) | (offset + (sljit_uw)size - 4… in sljit_emit_enter()
1175 compiler->args_size = offset; in sljit_emit_enter()
1203 …FAIL_IF(push_inst(compiler, MOV | RD(SLJIT_S0 - saved_arg_count) | RM(SLJIT_R0 + word_arg_count))); in sljit_emit_enter()
1216 FAIL_IF(push_inst(compiler, *(--remap_ptr))); in sljit_emit_enter()
1220 FAIL_IF(emit_op(compiler, SLJIT_SUB, ALLOW_IMM, SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, local_size)); in sljit_emit_enter()
1225 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1232 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
1233 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
1240 compiler->local_size = ((size + local_size + 0x7) & ~0x7) - size; in sljit_set_context()
1244 static sljit_s32 emit_add_sp(struct sljit_compiler *compiler, sljit_uw imm) in emit_add_sp() argument
1252 FAIL_IF(push_inst(compiler, ADD | SRC2_IMM | RD(SLJIT_SP) | RN(SLJIT_SP) | 0xb00 | imm2)); in emit_add_sp()
1253 return push_inst(compiler, ADD | SRC2_IMM | RD(SLJIT_SP) | RN(SLJIT_SP) | 0xf00 | (imm & 0xff)); in emit_add_sp()
1256 return push_inst(compiler, ADD | RD(SLJIT_SP) | RN(SLJIT_SP) | imm2); in emit_add_sp()
1259 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_s32 frame_size) in emit_stack_frame_release() argument
1268 local_size = compiler->local_size; in emit_stack_frame_release()
1269 fscratches = compiler->fscratches; in emit_stack_frame_release()
1270 fsaveds = compiler->fsaveds; in emit_stack_frame_release()
1274 FAIL_IF(emit_add_sp(compiler, (sljit_uw)local_size)); in emit_stack_frame_release()
1277 …FAIL_IF(push_inst(compiler, VPOP | VD(SLJIT_FS0) | ((sljit_uw)SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTER… in emit_stack_frame_release()
1280 …FAIL_IF(push_inst(compiler, VPOP | VD(fscratches) | ((sljit_uw)(fscratches - (SLJIT_FIRST_SAVED_FL… in emit_stack_frame_release()
1282 FAIL_IF(push_inst(compiler, VPOP | VD(SLJIT_FS0) | ((sljit_uw)fsaveds << 1))); in emit_stack_frame_release()
1285 local_size = GET_SAVED_REGISTERS_SIZE(compiler->scratches, compiler->saveds, 1) & 0x7; in emit_stack_frame_release()
1300 tmp = SLJIT_S0 - compiler->saveds; in emit_stack_frame_release()
1301 i = SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options); in emit_stack_frame_release()
1309 i = compiler->scratches; in emit_stack_frame_release()
1331 return push_inst(compiler, LDR_POST | RN(SLJIT_SP) | RD(restored_reg) | 0x800008); in emit_stack_frame_release()
1333 …return push_inst(compiler, LDR_POST | RN(SLJIT_SP) | RD(restored_reg) | (sljit_uw)(frame_size - (2… in emit_stack_frame_release()
1336 …FAIL_IF(push_inst(compiler, LDR | 0x800000 | RN(SLJIT_SP) | RD(restored_reg) | (sljit_uw)local_siz… in emit_stack_frame_release()
1352 …FAIL_IF(push_inst(compiler, SUB | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 25) | (sljit_uw)(frame_size … in emit_stack_frame_release()
1354 FAIL_IF(emit_add_sp(compiler, (sljit_uw)(local_size - frame_size))); in emit_stack_frame_release()
1364 …return push_inst(compiler, LDR | 0x800000 | RN(SLJIT_SP) | RD(restored_reg) | (sljit_uw)frame_size… in emit_stack_frame_release()
1368 return push_inst(compiler, LDR_POST | RN(SLJIT_SP) | RD(restored_reg) | (sljit_uw)tmp); in emit_stack_frame_release()
1372 FAIL_IF(emit_add_sp(compiler, (sljit_uw)local_size)); in emit_stack_frame_release()
1381 return push_inst(compiler, LDR_POST | RN(SLJIT_SP) | RD(lr_dst) | 0x800004); in emit_stack_frame_release()
1384 FAIL_IF(push_inst(compiler, POP | reg_list)); in emit_stack_frame_release()
1387 …return push_inst(compiler, SUB | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 25) | ((sljit_uw)frame_size -… in emit_stack_frame_release()
1392 return push_inst(compiler, ADD | RD(SLJIT_SP) | RN(SLJIT_SP) | (1 << 25) | sizeof(sljit_sw)); in emit_stack_frame_release()
1395 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
1398 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
1400 return emit_stack_frame_release(compiler, 0); in sljit_emit_return_void()
1403 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *compiler, in sljit_emit_return_to() argument
1407 CHECK(check_sljit_emit_return_to(compiler, src, srcw)); in sljit_emit_return_to()
1410 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_return_to()
1413 …} else if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->op… in sljit_emit_return_to()
1414 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG1) | RM(src))); in sljit_emit_return_to()
1419 FAIL_IF(emit_stack_frame_release(compiler, 1)); in sljit_emit_return_to()
1421 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_return_to()
1422 return sljit_emit_ijump(compiler, SLJIT_JUMP, src, srcw); in sljit_emit_return_to()
1429 static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s… in emit_single_op() argument
1440 return push_inst(compiler, ((flags & INV_IMM) ? MVN : MOV) | RD(dst) | src2); in emit_single_op()
1442 return push_inst(compiler, MOV | RD(dst) | RM(src2)); in emit_single_op()
1452 return push_inst(compiler, AND | RD(dst) | RN(src2) | SRC2_IMM | 0xff); in emit_single_op()
1453 FAIL_IF(push_inst(compiler, MOV | RD(dst) | (24 << 7) | RM(src2))); in emit_single_op()
1454 …return push_inst(compiler, MOV | RD(dst) | (24 << 7) | (op == SLJIT_MOV_U8 ? 0x20 : 0x40) | RM(dst… in emit_single_op()
1456 return push_inst(compiler, (op == SLJIT_MOV_U8 ? UXTB : SXTB) | RD(dst) | RM(src2)); in emit_single_op()
1461 return push_inst(compiler, ((flags & INV_IMM) ? MVN : MOV) | RD(dst) | src2); in emit_single_op()
1470 FAIL_IF(push_inst(compiler, MOV | RD(dst) | (16 << 7) | RM(src2))); in emit_single_op()
1471 …return push_inst(compiler, MOV | RD(dst) | (16 << 7) | (op == SLJIT_MOV_U16 ? 0x20 : 0x40) | RM(ds… in emit_single_op()
1473 return push_inst(compiler, (op == SLJIT_MOV_U16 ? UXTH : SXTH) | RD(dst) | RM(src2)); in emit_single_op()
1478 return push_inst(compiler, ((flags & INV_IMM) ? MVN : MOV) | RD(dst) | src2); in emit_single_op()
1484 …return push_inst(compiler, ((flags & INV_IMM) ? MOV : MVN) | (flags & SET_FLAGS) | RD(dst) | src2); in emit_single_op()
1486 return push_inst(compiler, MVN | (flags & SET_FLAGS) | RD(dst) | RM(src2)); in emit_single_op()
1490 FAIL_IF(push_inst(compiler, CLZ | RD(dst) | RM(src2))); in emit_single_op()
1497 FAIL_IF(push_inst(compiler, RSB | SRC2_IMM | RD(TMP_REG1) | RN(src2) | 0)); in emit_single_op()
1498 FAIL_IF(push_inst(compiler, AND | RD(TMP_REG2) | RN(src2) | RM(TMP_REG1))); in emit_single_op()
1499 FAIL_IF(push_inst(compiler, CLZ | RD(dst) | RM(TMP_REG2))); in emit_single_op()
1500 FAIL_IF(push_inst(compiler, CMP | SET_FLAGS | SRC2_IMM | RN(dst) | 32)); in emit_single_op()
1501 return push_inst(compiler, (EOR ^ 0xf0000000) | SRC2_IMM | RD(dst) | RN(dst) | 0x1f); in emit_single_op()
1503 FAIL_IF(push_inst(compiler, RBIT | RD(dst) | RM(src2))); in emit_single_op()
1504 return push_inst(compiler, CLZ | RD(dst) | RM(dst)); in emit_single_op()
1511 return push_inst(compiler, CMN | SET_FLAGS | RN(src1) | ((src2 & SRC2_IMM) ? src2 : RM(src2))); in emit_single_op()
1512 …return push_inst(compiler, ADD | (flags & SET_FLAGS) | RD(dst) | RN(src1) | ((src2 & SRC2_IMM) ? s… in emit_single_op()
1516 …return push_inst(compiler, ADC | (flags & SET_FLAGS) | RD(dst) | RN(src1) | ((src2 & SRC2_IMM) ? s… in emit_single_op()
1522 return push_inst(compiler, CMP | SET_FLAGS | RN(src1) | ((src2 & SRC2_IMM) ? src2 : RM(src2))); in emit_single_op()
1524 return push_inst(compiler, (!(flags & ARGS_SWAPPED) ? SUB : RSB) | (flags & SET_FLAGS) in emit_single_op()
1529 return push_inst(compiler, (!(flags & ARGS_SWAPPED) ? SBC : RSC) | (flags & SET_FLAGS) in emit_single_op()
1535 compiler->status_flags_state = 0; in emit_single_op()
1538 return push_inst(compiler, MUL | RN(dst) | RM8(src2) | RM(src1)); in emit_single_op()
1540 FAIL_IF(push_inst(compiler, SMULL | RN(TMP_REG1) | RD(dst) | RM8(src2) | RM(src1))); in emit_single_op()
1543 return push_inst(compiler, CMP | SET_FLAGS | RN(TMP_REG1) | RM(dst) | 0xfc0); in emit_single_op()
1547 return push_inst(compiler, TST | SET_FLAGS | RN(src1) | ((src2 & SRC2_IMM) ? src2 : RM(src2))); in emit_single_op()
1548 return push_inst(compiler, (!(flags & INV_IMM) ? AND : BIC) | (flags & SET_FLAGS) in emit_single_op()
1553 …return push_inst(compiler, ORR | (flags & SET_FLAGS) | RD(dst) | RN(src1) | ((src2 & SRC2_IMM) ? s… in emit_single_op()
1557 …return push_inst(compiler, EOR | (flags & SET_FLAGS) | RD(dst) | RN(src1) | ((src2 & SRC2_IMM) ? s… in emit_single_op()
1578 if (compiler->shift_imm == 0x20) { in emit_single_op()
1579 FAIL_IF(push_inst(compiler, RSB | SRC2_IMM | RD(TMP_REG2) | RN(src2) | 0)); in emit_single_op()
1582 compiler->shift_imm = (sljit_uw)(-(sljit_sw)compiler->shift_imm) & 0x1f; in emit_single_op()
1597 if (compiler->shift_imm != 0x20) { in emit_single_op()
1600 if (compiler->shift_imm != 0) in emit_single_op()
1601 return push_inst(compiler, MOV | (flags & SET_FLAGS) | in emit_single_op()
1602 RD(dst) | (compiler->shift_imm << 7) | (shift_type << 5) | RM(src2)); in emit_single_op()
1603 return push_inst(compiler, MOV | (flags & SET_FLAGS) | RD(dst) | RM(src2)); in emit_single_op()
1609 FAIL_IF(push_inst(compiler, AND | RD(TMP_REG2) | RN(src2) | SRC2_IMM | 0x1f)); in emit_single_op()
1613 return push_inst(compiler, MOV | (flags & SET_FLAGS) | RD(dst) in emit_single_op()
1659 static sljit_s32 generate_int(struct sljit_compiler *compiler, sljit_s32 reg, sljit_uw imm, sljit_s… in generate_int() argument
1764 FAIL_IF(push_inst(compiler, (positive ? MOV : MVN) | RD(reg) | imm1)); in generate_int()
1765 FAIL_IF(push_inst(compiler, (positive ? ORR : BIC) | RD(reg) | RN(reg) | imm2)); in generate_int()
1770 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 reg, sljit_uw imm) in load_immediate() argument
1776 return push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | (imm & 0xfff)); in load_immediate()
1782 return push_inst(compiler, MOV | RD(reg) | tmp); in load_immediate()
1786 return push_inst(compiler, MVN | RD(reg) | tmp); in load_immediate()
1790 FAIL_IF(generate_int(compiler, reg, imm, 1)); in load_immediate()
1791 FAIL_IF(generate_int(compiler, reg, ~imm, 0)); in load_immediate()
1794 …return push_inst_with_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, reg, TMP_PC, … in load_immediate()
1796 FAIL_IF(push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | (imm & 0xfff))); in load_immediate()
1799 return push_inst(compiler, MOVT | RD(reg) | ((imm >> 12) & 0xf0000) | ((imm >> 16) & 0xfff)); in load_immediate()
1803 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, in emit_op_mem() argument
1817 FAIL_IF(load_immediate(compiler, tmp_reg, tmp)); in emit_op_mem()
1827 return push_inst(compiler, EMIT_DATA_TRANSFER(flags, tmp, reg, tmp_reg, in emit_op_mem()
1837 …FAIL_IF(push_inst(compiler, ADD | RD(tmp_reg) | RN(arg) | RM(offset_reg) | ((sljit_uw)argw << 7))); in emit_op_mem()
1838 return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, reg, tmp_reg, TYPE2_TRANSFER_IMM(0))); in emit_op_mem()
1842 return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, reg, arg, in emit_op_mem()
1854 FAIL_IF(push_inst(compiler, ADD | RD(tmp_reg) | RN(arg) | imm)); in emit_op_mem()
1866 FAIL_IF(push_inst(compiler, SUB | RD(tmp_reg) | RN(arg) | imm)); in emit_op_mem()
1878 return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, reg, arg, argw)); in emit_op_mem()
1886 return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 0, reg, arg, argw)); in emit_op_mem()
1889 FAIL_IF(load_immediate(compiler, tmp_reg, (sljit_uw)argw)); in emit_op_mem()
1890 return push_inst(compiler, EMIT_DATA_TRANSFER(flags, 1, reg, arg, in emit_op_mem()
1894 static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 inp_flags, in emit_op() argument
1918 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op()
1922 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in emit_op()
1926 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op()
1930 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in emit_op()
1994 FAIL_IF(emit_op_mem(compiler, inp_flags | LOAD_DATA, TMP_REG1, src1, src1w, TMP_REG1)); in emit_op()
1998 FAIL_IF(load_immediate(compiler, TMP_REG1, (sljit_uw)src1w)); in emit_op()
2011 return emit_op_mem(compiler, inp_flags, src2, dst, dstw, TMP_REG2); in emit_op()
2025 FAIL_IF(emit_op_mem(compiler, inp_flags | LOAD_DATA, src2_reg, src2, src2w, TMP_REG2)); in emit_op()
2027 FAIL_IF(load_immediate(compiler, src2_reg, (sljit_uw)src2w)); in emit_op()
2030 …FAIL_IF(emit_single_op(compiler, op, flags, (sljit_uw)dst_reg, (sljit_uw)src1_reg, (sljit_uw)src2_… in emit_op()
2035 return emit_op_mem(compiler, inp_flags, dst_reg, dst, dstw, TMP_REG1); in emit_op()
2053 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
2059 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
2064 FAIL_IF(push_inst(compiler, BKPT)); in sljit_emit_op0()
2067 FAIL_IF(push_inst(compiler, NOP)); in sljit_emit_op0()
2071 return push_inst(compiler, (op == SLJIT_LMUL_UW ? UMULL : SMULL) in sljit_emit_op0()
2081 if (compiler->scratches >= 4) in sljit_emit_op0()
2083 if (compiler->scratches >= 3) in sljit_emit_op0()
2089 FAIL_IF(push_inst(compiler, STR | 0x2d0000 | (saved_reg_count >= 3 ? 16 : 8) in sljit_emit_op0()
2093 FAIL_IF(push_inst(compiler, STR | 0x8d0004 | (saved_reg_list[1] << 12) /* str rX, [sp, #4] */)); in sljit_emit_op0()
2097 FAIL_IF(push_inst(compiler, STR | 0x8d0008 | (saved_reg_list[2] << 12) /* str rX, [sp, #8] */)); in sljit_emit_op0()
2102 FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, in sljit_emit_op0()
2111 FAIL_IF(push_inst(compiler, LDR | 0x8d0008 | (saved_reg_list[2] << 12) /* ldr rX, [sp, #8] */)); in sljit_emit_op0()
2115 FAIL_IF(push_inst(compiler, LDR | 0x8d0004 | (saved_reg_list[1] << 12) /* ldr rX, [sp, #4] */)); in sljit_emit_op0()
2117 …return push_inst(compiler, (LDR ^ (1 << 24)) | 0x8d0000 | (sljit_uw)(saved_reg_count >= 3 ? 16 : 8) in sljit_emit_op0()
2129 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
2134 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
2144 return emit_op(compiler, SLJIT_MOV, ALLOW_ANY_IMM, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
2147 …return emit_op(compiler, SLJIT_MOV_U8, ALLOW_ANY_IMM | BYTE_SIZE, dst, dstw, TMP_REG1, 0, src, (sr… in sljit_emit_op1()
2150 …return emit_op(compiler, SLJIT_MOV_S8, ALLOW_ANY_IMM | SIGNED | BYTE_SIZE, dst, dstw, TMP_REG1, 0,… in sljit_emit_op1()
2153 …return emit_op(compiler, SLJIT_MOV_U16, ALLOW_ANY_IMM | HALF_SIZE, dst, dstw, TMP_REG1, 0, src, (s… in sljit_emit_op1()
2156 …return emit_op(compiler, SLJIT_MOV_S16, ALLOW_ANY_IMM | SIGNED | HALF_SIZE, dst, dstw, TMP_REG1, 0… in sljit_emit_op1()
2159 return emit_op(compiler, op, ALLOW_ANY_IMM, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
2163 return emit_op(compiler, op, 0, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
2169 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
2175 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
2185 return emit_op(compiler, op, ALLOW_IMM | ALLOW_NEG_IMM, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2189 return emit_op(compiler, op, ALLOW_IMM, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2192 return emit_op(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2195 return emit_op(compiler, op, ALLOW_ANY_IMM, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2206 compiler->shift_imm = src2w & 0x1f; in sljit_emit_op2()
2207 return emit_op(compiler, op, 0, dst, dstw, TMP_REG1, 0, src1, src1w); in sljit_emit_op2()
2209 compiler->shift_imm = 0x20; in sljit_emit_op2()
2210 return emit_op(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2217 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
2222 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
2224 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_op2u()
2225 return sljit_emit_op2(compiler, op, TMP_REG2, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
2228 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_shift_into(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_shift_into() argument
2236 CHECK(check_sljit_emit_shift_into(compiler, op, src_dst, src1, src1w, src2, src2w)); in sljit_emit_shift_into()
2242 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_shift_into()
2243 …return sljit_emit_op2(compiler, is_left ? SLJIT_ROTL : SLJIT_ROTR, src_dst, 0, src_dst, 0, src2, s… in sljit_emit_shift_into()
2256 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG2, src2, src2w, TMP_REG2)); in sljit_emit_shift_into()
2261 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG1, src1, src1w, TMP_REG1)); in sljit_emit_shift_into()
2264 FAIL_IF(load_immediate(compiler, TMP_REG1, (sljit_uw)src1w)); in sljit_emit_shift_into()
2269 …FAIL_IF(push_inst(compiler, MOV | RD(src_dst) | RM(src_dst) | ((sljit_uw)(is_left ? 0 : 1) << 5) |… in sljit_emit_shift_into()
2271 …return push_inst(compiler, ORR | RD(src_dst) | RN(src_dst) | RM(src1) | ((sljit_uw)(is_left ? 1 : … in sljit_emit_shift_into()
2275 FAIL_IF(push_inst(compiler, AND | SRC2_IMM | RD(TMP_REG2) | RN(src2) | 0x1f)); in sljit_emit_shift_into()
2279 …FAIL_IF(push_inst(compiler, MOV | RD(src_dst) | RM8(src2) | ((sljit_uw)(is_left ? 0 : 1) << 5) | 0… in sljit_emit_shift_into()
2280 …FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG1) | RM(src1) | ((sljit_uw)(is_left ? 1 : 0) << 5) | (… in sljit_emit_shift_into()
2281 FAIL_IF(push_inst(compiler, EOR | SRC2_IMM | RD(TMP_REG2) | RN(src2) | 0x1f)); in sljit_emit_shift_into()
2282 …return push_inst(compiler, ORR | RD(src_dst) | RN(src_dst) | RM(TMP_REG1) | ((sljit_uw)(is_left ? … in sljit_emit_shift_into()
2285 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_src(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op_src() argument
2289 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
2297 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG2) | RM(src))); in sljit_emit_op_src()
2299 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG2, src, srcw, TMP_REG1)); in sljit_emit_op_src()
2301 return push_inst(compiler, BX | RM(TMP_REG2)); in sljit_emit_op_src()
2310 return emit_op_mem(compiler, PRELOAD | LOAD_DATA, TMP_PC, src, srcw, TMP_REG1); in sljit_emit_op_src()
2331 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
2336 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
2338 return push_inst(compiler, *(sljit_uw*)instruction); in sljit_emit_op_custom()
2349 static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, slji… in emit_fop_mem() argument
2358 …FAIL_IF(push_inst(compiler, ADD | RD(TMP_REG2) | RN(arg & REG_MASK) | RM(OFFS_REG(arg)) | (((sljit… in emit_fop_mem()
2366 return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, arg & REG_MASK, reg, argw >> 2)); in emit_fop_mem()
2368 return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 0, arg & REG_MASK, reg, (-argw) >> 2)); in emit_fop_mem()
2372 FAIL_IF(push_inst(compiler, ADD | RD(TMP_REG2) | RN(arg & REG_MASK) | imm)); in emit_fop_mem()
2373 return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG2, reg, (argw & 0x3fc) >> 2)); in emit_fop_mem()
2378 FAIL_IF(push_inst(compiler, SUB | RD(TMP_REG2) | RN(arg & REG_MASK) | imm)); in emit_fop_mem()
2379 return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 0, TMP_REG2, reg, (argw & 0x3fc) >> 2)); in emit_fop_mem()
2384 FAIL_IF(load_immediate(compiler, TMP_REG2, (sljit_uw)argw)); in emit_fop_mem()
2385 FAIL_IF(push_inst(compiler, ADD | RD(TMP_REG2) | RN(arg & REG_MASK) | RM(TMP_REG2))); in emit_fop_mem()
2388 FAIL_IF(load_immediate(compiler, TMP_REG2, (sljit_uw)argw)); in emit_fop_mem()
2390 return push_inst(compiler, EMIT_FPU_DATA_TRANSFER(inst, 1, TMP_REG2, reg, 0)); in emit_fop_mem()
2393 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_compiler *compiler, slj… in sljit_emit_fop1_conv_sw_from_f64() argument
2400 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG1, src, srcw)); in sljit_emit_fop1_conv_sw_from_f64()
2404 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VCVT_S32_F32, op & SLJIT_32, TMP_FREG1, src, 0))); in sljit_emit_fop1_conv_sw_from_f64()
2407 return push_inst(compiler, VMOV | (1 << 20) | RD(dst) | VN(TMP_FREG1)); in sljit_emit_fop1_conv_sw_from_f64()
2410 return emit_fop_mem(compiler, 0, TMP_FREG1, dst, dstw); in sljit_emit_fop1_conv_sw_from_f64()
2413 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_compiler *compiler, slj… in sljit_emit_fop1_conv_f64_from_sw() argument
2422 FAIL_IF(push_inst(compiler, VMOV | RD(src) | VN(TMP_FREG1))); in sljit_emit_fop1_conv_f64_from_sw()
2425 FAIL_IF(emit_fop_mem(compiler, FPU_LOAD, TMP_FREG1, src, srcw)); in sljit_emit_fop1_conv_f64_from_sw()
2428 FAIL_IF(load_immediate(compiler, TMP_REG1, (sljit_uw)srcw)); in sljit_emit_fop1_conv_f64_from_sw()
2429 FAIL_IF(push_inst(compiler, VMOV | RD(TMP_REG1) | VN(TMP_FREG1))); in sljit_emit_fop1_conv_f64_from_sw()
2432 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VCVT_F32_S32, op & SLJIT_32, dst_r, TMP_FREG1, 0))); in sljit_emit_fop1_conv_f64_from_sw()
2435 return emit_fop_mem(compiler, (op & SLJIT_32), TMP_FREG1, dst, dstw); in sljit_emit_fop1_conv_f64_from_sw()
2439 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
2446 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG1, src1, src1w)); in sljit_emit_fop1_cmp()
2451 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG2, src2, src2w)); in sljit_emit_fop1_cmp()
2455 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VCMP_F32, op & SLJIT_32, src1, src2, 0))); in sljit_emit_fop1_cmp()
2456 return push_inst(compiler, VMRS); in sljit_emit_fop1_cmp()
2459 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
2468 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
2476 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, dst_r, src, srcw)); in sljit_emit_fop1()
2484 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VMOV_F32, op & SLJIT_32, dst_r, src, 0))); in sljit_emit_fop1()
2490 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VNEG_F32, op & SLJIT_32, dst_r, src, 0))); in sljit_emit_fop1()
2493 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VABS_F32, op & SLJIT_32, dst_r, src, 0))); in sljit_emit_fop1()
2496 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VCVT_F64_F32, op & SLJIT_32, dst_r, src, 0))); in sljit_emit_fop1()
2502 return emit_fop_mem(compiler, (op & SLJIT_32), dst_r, dst, dstw); in sljit_emit_fop1()
2506 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
2514 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
2524 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG2, src2, src2w)); in sljit_emit_fop2()
2529 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32) | FPU_LOAD, TMP_FREG1, src1, src1w)); in sljit_emit_fop2()
2535 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VADD_F32, op & SLJIT_32, dst_r, src2, src1))); in sljit_emit_fop2()
2539 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VSUB_F32, op & SLJIT_32, dst_r, src2, src1))); in sljit_emit_fop2()
2543 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VMUL_F32, op & SLJIT_32, dst_r, src2, src1))); in sljit_emit_fop2()
2547 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VDIV_F32, op & SLJIT_32, dst_r, src2, src1))); in sljit_emit_fop2()
2552 FAIL_IF(emit_fop_mem(compiler, (op & SLJIT_32), TMP_FREG1, dst, dstw)); in sljit_emit_fop2()
2563 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
2566 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
2572 return push_inst(compiler, MOV | RD(dst) | RM(TMP_REG2)); in sljit_emit_fast_enter()
2575 return emit_op_mem(compiler, WORD_SIZE, TMP_REG2, dst, dstw, TMP_REG1); in sljit_emit_fast_enter()
2582 static sljit_uw get_cc(struct sljit_compiler *compiler, sljit_s32 type) in get_cc() argument
2598 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) in get_cc()
2606 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) in get_cc()
2641 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
2649 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
2669 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
2674 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
2676 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
2677 return compiler->last_label; in sljit_emit_label()
2679 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
2681 set_label(label, compiler); in sljit_emit_label()
2685 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
2690 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
2692 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2694 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2701 PTR_FAIL_IF(prepare_blx(compiler)); in sljit_emit_jump()
2702 PTR_FAIL_IF(push_inst_with_unique_literal(compiler, ((EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, in sljit_emit_jump()
2703 type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0)) & ~COND_MASK) | get_cc(compiler, type), 0)); in sljit_emit_jump()
2706 jump->addr = compiler->size; in sljit_emit_jump()
2707 compiler->patches++; in sljit_emit_jump()
2712 PTR_FAIL_IF(emit_blx(compiler)); in sljit_emit_jump()
2716 jump->addr = compiler->size; in sljit_emit_jump()
2720 PTR_FAIL_IF(emit_imm(compiler, TMP_REG1, 0)); in sljit_emit_jump()
2721 …PTR_FAIL_IF(push_inst(compiler, (((type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1)) & ~COND_MASK) | … in sljit_emit_jump()
2722 jump->addr = compiler->size; in sljit_emit_jump()
2729 static sljit_s32 softfloat_call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types, slj… in softfloat_call_with_args() argument
2771 if (offset > 4 * sizeof(sljit_sw) && (!is_tail_call || offset > compiler->args_size)) { in softfloat_call_with_args()
2781 FAIL_IF(emit_stack_frame_release(compiler, (sljit_s32)offset)); in softfloat_call_with_args()
2783 FAIL_IF(push_inst(compiler, SUB | RD(SLJIT_SP) | RN(SLJIT_SP) | SRC2_IMM | offset)); in softfloat_call_with_args()
2786 FAIL_IF(emit_stack_frame_release(compiler, -1)); in softfloat_call_with_args()
2801 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG1) | (src_offset >> 2))); in softfloat_call_with_args()
2804 …FAIL_IF(push_inst(compiler, VMOV2 | 0x100000 | (offset << 10) | ((offset + sizeof(sljit_sw)) << 14… in softfloat_call_with_args()
2806 FAIL_IF(push_inst(compiler, VSTR_F32 | 0x800100 | RN(SLJIT_SP) in softfloat_call_with_args()
2815 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG1) | (src_offset >> 2))); in softfloat_call_with_args()
2818 FAIL_IF(push_inst(compiler, VMOV | 0x100000 | (float_arg_count << 16) | (offset << 10))); in softfloat_call_with_args()
2820 FAIL_IF(push_inst(compiler, VSTR_F32 | 0x800000 | RN(SLJIT_SP) in softfloat_call_with_args()
2832 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG1) | (src_offset >> 2))); in softfloat_call_with_args()
2839 FAIL_IF(push_inst(compiler, MOV | (offset << 10) | (word_arg_offset >> 2))); in softfloat_call_with_args()
2841 …FAIL_IF(push_inst(compiler, STR | 0x800000 | RN(SLJIT_SP) | (word_arg_offset << 10) | (offset - 4 … in softfloat_call_with_args()
2852 static sljit_s32 softfloat_post_call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types) in softfloat_post_call_with_args() argument
2855 FAIL_IF(push_inst(compiler, VMOV2 | (1 << 16) | (0 << 12) | 0)); in softfloat_post_call_with_args()
2857 FAIL_IF(push_inst(compiler, VMOV | (0 << 16) | (0 << 12))); in softfloat_post_call_with_args()
2864 static sljit_s32 hardfloat_call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types) in hardfloat_call_with_args() argument
2877 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VMOV_F32, in hardfloat_call_with_args()
2885 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VMOV_F32, in hardfloat_call_with_args()
2890 FAIL_IF(push_inst(compiler, EMIT_FPU_OPERATION(VMOV_F32, in hardfloat_call_with_args()
2908 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_call(struct sljit_compiler *compiler, sljit_… in sljit_emit_call() argument
2917 CHECK_PTR(check_sljit_emit_call(compiler, type, arg_types)); in sljit_emit_call()
2921 PTR_FAIL_IF(softfloat_call_with_args(compiler, arg_types, NULL, &extra_space)); in sljit_emit_call()
2927 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_call()
2928 jump = sljit_emit_jump(compiler, type); in sljit_emit_call()
2933 PTR_FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, in sljit_emit_call()
2936 PTR_FAIL_IF(push_inst(compiler, ADD | RD(SLJIT_SP) | RN(SLJIT_SP) | SRC2_IMM | extra_space)); in sljit_emit_call()
2939 PTR_FAIL_IF(push_inst(compiler, BX | RM(TMP_REG2))); in sljit_emit_call()
2945 PTR_FAIL_IF(softfloat_post_call_with_args(compiler, arg_types)); in sljit_emit_call()
2951 PTR_FAIL_IF(emit_stack_frame_release(compiler, -1)); in sljit_emit_call()
2957 PTR_FAIL_IF(hardfloat_call_with_args(compiler, arg_types)); in sljit_emit_call()
2960 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_call()
2961 return sljit_emit_jump(compiler, type); in sljit_emit_call()
2964 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
2969 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
2977 return push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(src)); in sljit_emit_ijump()
2981 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_ijump()
2982 return push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1)); in sljit_emit_ijump()
2986 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2988 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
2993 FAIL_IF(prepare_blx(compiler)); in sljit_emit_ijump()
2994 …FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, type … in sljit_emit_ijump()
2996 FAIL_IF(emit_blx(compiler)); in sljit_emit_ijump()
2998 FAIL_IF(emit_imm(compiler, TMP_REG1, 0)); in sljit_emit_ijump()
2999 FAIL_IF(push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1))); in sljit_emit_ijump()
3001 jump->addr = compiler->size; in sljit_emit_ijump()
3005 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_icall() argument
3014 CHECK(check_sljit_emit_icall(compiler, type, arg_types, src, srcw)); in sljit_emit_icall()
3017 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_icall()
3021 …(src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options)))) { in sljit_emit_icall()
3022 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG1) | RM(src))); in sljit_emit_icall()
3028 FAIL_IF(softfloat_call_with_args(compiler, arg_types, &src, &extra_space)); in sljit_emit_icall()
3034 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_icall()
3035 FAIL_IF(sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_icall()
3039 FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, in sljit_emit_icall()
3042 FAIL_IF(push_inst(compiler, ADD | RD(SLJIT_SP) | RN(SLJIT_SP) | SRC2_IMM | extra_space)); in sljit_emit_icall()
3045 return push_inst(compiler, BX | RM(TMP_REG2)); in sljit_emit_icall()
3049 return softfloat_post_call_with_args(compiler, arg_types); in sljit_emit_icall()
3054 FAIL_IF(emit_stack_frame_release(compiler, -1)); in sljit_emit_icall()
3060 FAIL_IF(hardfloat_call_with_args(compiler, arg_types)); in sljit_emit_icall()
3063 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_icall()
3064 return sljit_emit_ijump(compiler, type, src, srcw); in sljit_emit_icall()
3069 static SLJIT_INLINE sljit_s32 emit_fmov_before_return(struct sljit_compiler *compiler, sljit_s32 op… in emit_fmov_before_return() argument
3071 if (compiler->options & SLJIT_ENTER_REG_ARG) { in emit_fmov_before_return()
3075 SLJIT_SKIP_CHECKS(compiler); in emit_fmov_before_return()
3076 return sljit_emit_fop1(compiler, op, SLJIT_RETURN_FREG, 0, src, srcw); in emit_fmov_before_return()
3081 return push_inst(compiler, VMOV | (1 << 20) | RD(SLJIT_R0) | VN(src)); in emit_fmov_before_return()
3082 return push_inst(compiler, VMOV2 | (1 << 20) | RD(SLJIT_R0) | RN(SLJIT_R1) | VM(src)); in emit_fmov_before_return()
3085 SLJIT_SKIP_CHECKS(compiler); in emit_fmov_before_return()
3088 return sljit_emit_op1(compiler, SLJIT_MOV, SLJIT_R0, 0, src, srcw); in emit_fmov_before_return()
3089 return sljit_emit_mem(compiler, SLJIT_MOV, SLJIT_REG_PAIR(SLJIT_R0, SLJIT_R1), src, srcw); in emit_fmov_before_return()
3094 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
3102 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
3106 cc = get_cc(compiler, type); in sljit_emit_op_flags()
3110 FAIL_IF(push_inst(compiler, MOV | RD(dst_reg) | SRC2_IMM | 0)); in sljit_emit_op_flags()
3111 FAIL_IF(push_inst(compiler, ((MOV | RD(dst_reg) | SRC2_IMM | 1) & ~COND_MASK) | cc)); in sljit_emit_op_flags()
3113 return emit_op_mem(compiler, WORD_SIZE, TMP_REG1, dst, dstw, TMP_REG2); in sljit_emit_op_flags()
3120 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG1, dst, dstw, TMP_REG2)); in sljit_emit_op_flags()
3122 FAIL_IF(push_inst(compiler, ((ins | RD(dst_reg) | RN(dst_reg) | SRC2_IMM | 1) & ~COND_MASK) | cc)); in sljit_emit_op_flags()
3125 …FAIL_IF(push_inst(compiler, ((ins | RD(dst_reg) | RN(dst_reg) | SRC2_IMM | 0) & ~COND_MASK) | (cc … in sljit_emit_op_flags()
3128 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG1, dst, dstw, TMP_REG2)); in sljit_emit_op_flags()
3131 return push_inst(compiler, MOV | SET_FLAGS | RD(TMP_REG2) | RM(dst_reg)); in sljit_emit_op_flags()
3135 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
3142 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
3144 cc = get_cc(compiler, type & ~SLJIT_32); in sljit_emit_cmov()
3149 return push_inst(compiler, ((MOV | RD(dst_reg) | tmp) & ~COND_MASK) | cc); in sljit_emit_cmov()
3153 return push_inst(compiler, ((MVN | RD(dst_reg) | tmp) & ~COND_MASK) | cc); in sljit_emit_cmov()
3157 …FAIL_IF(push_inst(compiler, (MOVW & ~COND_MASK) | cc | RD(dst_reg) | ((tmp << 4) & 0xf0000) | (tmp… in sljit_emit_cmov()
3160 …return push_inst(compiler, (MOVT & ~COND_MASK) | cc | RD(dst_reg) | ((tmp >> 12) & 0xf0000) | ((tm… in sljit_emit_cmov()
3162 FAIL_IF(load_immediate(compiler, TMP_REG1, (sljit_uw)srcw)); in sljit_emit_cmov()
3167 return push_inst(compiler, ((MOV | RD(dst_reg) | RM(src)) & ~COND_MASK) | cc); in sljit_emit_cmov()
3170 static sljit_s32 update_mem_addr(struct sljit_compiler *compiler, sljit_s32 *mem, sljit_sw *memw, s… in update_mem_addr() argument
3189 …return push_inst(compiler, ADD | RD(TMP_REG1) | RN(arg & REG_MASK) | RM(OFFS_REG(arg)) | ((sljit_u… in update_mem_addr()
3209 return push_inst(compiler, ADD | RD(TMP_REG1) | RN(arg) | imm); in update_mem_addr()
3220 return push_inst(compiler, SUB | RD(TMP_REG1) | RN(arg) | imm); in update_mem_addr()
3229 FAIL_IF(load_immediate(compiler, TMP_REG1, tmp)); in update_mem_addr()
3234 return push_inst(compiler, ADD | RD(TMP_REG1) | RN(TMP_REG1) | RM(arg)); in update_mem_addr()
3239 static sljit_s32 sljit_emit_mem_unaligned(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem_unaligned() argument
3255 return emit_op_mem(compiler, flags, reg, mem, memw, TMP_REG1); in sljit_emit_mem_unaligned()
3258 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xfff - 1)); in sljit_emit_mem_unaligned()
3264 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xff - 1)); in sljit_emit_mem_unaligned()
3275 return emit_op_mem(compiler, flags, reg, mem, memw, TMP_REG1); in sljit_emit_mem_unaligned()
3279 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xfff - 3)); in sljit_emit_mem_unaligned()
3285 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xff - 2)); in sljit_emit_mem_unaligned()
3296 …FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(HALF_SIZE, add, reg, mem, TYPE2_TRANSFER_IMM(memw))… in sljit_emit_mem_unaligned()
3297 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG2) | RM(reg) | (16 << 7) | (2 << 4))); in sljit_emit_mem_unaligned()
3304 …FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(HALF_SIZE | LOAD_DATA, add, tmp_reg, mem, TYPE2_TRA… in sljit_emit_mem_unaligned()
3317 …return push_inst(compiler, EMIT_DATA_TRANSFER(HALF_SIZE, add, TMP_REG2, mem, TYPE2_TRANSFER_IMM(me… in sljit_emit_mem_unaligned()
3319 …FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(HALF_SIZE | LOAD_DATA, add, TMP_REG2, mem, TYPE2_TR… in sljit_emit_mem_unaligned()
3320 return push_inst(compiler, ORR | RD(reg) | RN(tmp_reg) | RM(TMP_REG2) | (16 << 7)); in sljit_emit_mem_unaligned()
3332 FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(BYTE_SIZE, add, reg, mem, memw))); in sljit_emit_mem_unaligned()
3333 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG2) | RM(reg) | (8 << 7) | (2 << 4))); in sljit_emit_mem_unaligned()
3343 FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(BYTE_SIZE, add, TMP_REG2, mem, memw))); in sljit_emit_mem_unaligned()
3348 FAIL_IF(push_inst(compiler, MOV | RD(TMP_REG2) | RM(TMP_REG2) | (8 << 7) | (2 << 4))); in sljit_emit_mem_unaligned()
3360 FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(BYTE_SIZE | LOAD_DATA, add, tmp_reg, mem, memw))); in sljit_emit_mem_unaligned()
3371 … FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(BYTE_SIZE | LOAD_DATA, add, TMP_REG2, mem, memw))); in sljit_emit_mem_unaligned()
3372 FAIL_IF(push_inst(compiler, ORR | RD(tmp_reg) | RN(tmp_reg) | RM(TMP_REG2) | (shift << 7))); in sljit_emit_mem_unaligned()
3380 …FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(flags, add, TMP_REG2, mem, TYPE2_TRANSFER_IMM(memw)… in sljit_emit_mem_unaligned()
3382 FAIL_IF(push_inst(compiler, EMIT_DATA_TRANSFER(flags, add, TMP_REG2, mem, memw))); in sljit_emit_mem_unaligned()
3384 return push_inst(compiler, ORR | RD(reg) | RN(tmp_reg) | RM(TMP_REG2) | (shift << 7)); in sljit_emit_mem_unaligned()
3389 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem() argument
3396 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
3403 return sljit_emit_mem_unaligned(compiler, type, reg, mem, memw); in sljit_emit_mem()
3410 …FAIL_IF(update_mem_addr(compiler, &mem, &memw, (type & SLJIT_MEM_UNALIGNED_16) ? 0xfff - 6 : 0xfff… in sljit_emit_mem()
3413 …FAIL_IF(sljit_emit_mem_unaligned(compiler, type, REG_PAIR_SECOND(reg), SLJIT_MEM1(mem), memw + SSI… in sljit_emit_mem()
3414 return sljit_emit_mem_unaligned(compiler, type, REG_PAIR_FIRST(reg), SLJIT_MEM1(mem), memw); in sljit_emit_mem()
3417 FAIL_IF(sljit_emit_mem_unaligned(compiler, type, REG_PAIR_FIRST(reg), SLJIT_MEM1(mem), memw)); in sljit_emit_mem()
3418 …return sljit_emit_mem_unaligned(compiler, type, REG_PAIR_SECOND(reg), SLJIT_MEM1(mem), memw + SSIZ… in sljit_emit_mem()
3422 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xfff - 4)); in sljit_emit_mem()
3428 …FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, REG_PAIR_SECOND(reg), SLJIT_MEM1(mem), memw +… in sljit_emit_mem()
3429 …return emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, REG_PAIR_FIRST(reg), SLJIT_MEM1(mem), memw, TM… in sljit_emit_mem()
3435 FAIL_IF(emit_op_mem(compiler, flags, REG_PAIR_FIRST(reg), SLJIT_MEM1(mem), memw, TMP_REG1)); in sljit_emit_mem()
3436 …return emit_op_mem(compiler, flags, REG_PAIR_SECOND(reg), SLJIT_MEM1(mem), memw + SSIZE_OF(sw), TM… in sljit_emit_mem()
3439 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem_update(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_mem_update() argument
3447 CHECK(check_sljit_emit_mem_update(compiler, type, reg, mem, memw)); in sljit_emit_mem_update()
3513 return push_inst(compiler, inst); in sljit_emit_mem_update()
3529 return push_inst(compiler, inst | (sljit_uw)memw); in sljit_emit_mem_update()
3537 return push_inst(compiler, inst | TYPE2_TRANSFER_IMM((sljit_uw)memw)); in sljit_emit_mem_update()
3540 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_fmem() argument
3550 CHECK(check_sljit_emit_fmem(compiler, type, freg, mem, memw)); in sljit_emit_fmem()
3553 …return emit_fop_mem(compiler, ((type ^ SLJIT_32) & SLJIT_32) | ((type & SLJIT_MEM_STORE) ? 0 : FPU… in sljit_emit_fmem()
3557 FAIL_IF(push_inst(compiler, VMOV | (1 << 20) | VN(freg) | RD(TMP_REG2))); in sljit_emit_fmem()
3560 …return sljit_emit_mem_unaligned(compiler, SLJIT_MOV | SLJIT_MEM_STORE | (type & SLJIT_MEM_UNALIGNE… in sljit_emit_fmem()
3566 FAIL_IF(update_mem_addr(compiler, &mem, &memw, max_offset)); in sljit_emit_fmem()
3569 …FAIL_IF(sljit_emit_mem_unaligned(compiler, SLJIT_MOV | SLJIT_MEM_STORE | (type & SLJIT_MEM_UNALIGN… in sljit_emit_fmem()
3571 FAIL_IF(push_inst(compiler, VMOV | (1 << 20) | VN(freg) | 0x80 | RD(TMP_REG2))); in sljit_emit_fmem()
3572 …return sljit_emit_mem_unaligned(compiler, SLJIT_MOV | SLJIT_MEM_STORE | (type & SLJIT_MEM_UNALIGNE… in sljit_emit_fmem()
3579 FAIL_IF(update_mem_addr(compiler, &mem, &memw, max_offset)); in sljit_emit_fmem()
3589 if (compiler->scratches >= 4) in sljit_emit_fmem()
3590 FAIL_IF(push_inst(compiler, STR | (1 << 21) | RN(SLJIT_SP) | RD(SLJIT_R3) | 8)); in sljit_emit_fmem()
3595 …FAIL_IF(sljit_emit_mem_unaligned(compiler, SLJIT_MOV | (type & SLJIT_MEM_UNALIGNED_16), dst, mem, … in sljit_emit_fmem()
3596 FAIL_IF(push_inst(compiler, VMOV | VN(freg) | RD(dst))); in sljit_emit_fmem()
3599 …FAIL_IF(sljit_emit_mem_unaligned(compiler, SLJIT_MOV | (type & SLJIT_MEM_UNALIGNED_16), dst, mem, … in sljit_emit_fmem()
3600 FAIL_IF(push_inst(compiler, VMOV | VN(freg) | 0x80 | RD(dst))); in sljit_emit_fmem()
3603 if (dst == SLJIT_R3 && compiler->scratches >= 4) in sljit_emit_fmem()
3604 FAIL_IF(push_inst(compiler, (LDR ^ (0x1 << 24)) | (0x1 << 23) | RN(SLJIT_SP) | RD(SLJIT_R3) | 8)); in sljit_emit_fmem()
3608 FAIL_IF(push_inst(compiler, VMOV | (1 << 20) | VN(freg) | RD(TMP_REG2))); in sljit_emit_fmem()
3611 return emit_op_mem(compiler, WORD_SIZE, TMP_REG2, mem, memw, TMP_REG1); in sljit_emit_fmem()
3613 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xfff - 4)); in sljit_emit_fmem()
3616 FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, mem, memw, TMP_REG1)); in sljit_emit_fmem()
3617 FAIL_IF(push_inst(compiler, VMOV | (1 << 20) | VN(freg) | 0x80 | RD(TMP_REG2))); in sljit_emit_fmem()
3618 return emit_op_mem(compiler, WORD_SIZE, TMP_REG2, mem, memw + 4, TMP_REG1); in sljit_emit_fmem()
3622 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG2, mem, memw, TMP_REG1)); in sljit_emit_fmem()
3623 return push_inst(compiler, VMOV | VN(freg) | RD(TMP_REG2)); in sljit_emit_fmem()
3626 FAIL_IF(update_mem_addr(compiler, &mem, &memw, 0xfff - 4)); in sljit_emit_fmem()
3629 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG2, mem, memw, TMP_REG1)); in sljit_emit_fmem()
3630 FAIL_IF(emit_op_mem(compiler, WORD_SIZE | LOAD_DATA, TMP_REG1, mem, memw + 4, TMP_REG1)); in sljit_emit_fmem()
3631 return push_inst(compiler, VMOV2 | VM(freg) | RD(TMP_REG2) | RN(TMP_REG1)); in sljit_emit_fmem()
3637 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
3643 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
3649 PTR_FAIL_IF(push_inst_with_unique_literal(compiler, in sljit_emit_const()
3651 compiler->patches++; in sljit_emit_const()
3653 PTR_FAIL_IF(emit_imm(compiler, dst_r, init_value)); in sljit_emit_const()
3656 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const)); in sljit_emit_const()
3658 set_const(const_, compiler); in sljit_emit_const()
3661 PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, dst, dstw, TMP_REG1)); in sljit_emit_const()
3665 …UTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, s… in sljit_emit_put_label() argument
3671 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
3677 …PTR_FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, d… in sljit_emit_put_label()
3678 compiler->patches++; in sljit_emit_put_label()
3680 PTR_FAIL_IF(emit_imm(compiler, dst_r, 0)); in sljit_emit_put_label()
3683 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
3685 set_put_label(put_label, compiler, 0); in sljit_emit_put_label()
3688 PTR_FAIL_IF(emit_op_mem(compiler, WORD_SIZE, TMP_REG2, dst, dstw, TMP_REG1)); in sljit_emit_put_label()