Lines Matching refs:compiler

168 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins)  in push_inst()  argument
170 sljit_ins *ibuf = (sljit_ins *)ensure_buf(compiler, sizeof(sljit_ins)); in push_inst()
173 compiler->size++; in push_inst()
202 static SLJIT_INLINE sljit_u8 get_cc(struct sljit_compiler *compiler, sljit_s32 type) { in get_cc() argument
210 if (SLJIT_ADD_SUB_NO_COMPARE(compiler->status_flags_state)) { in get_cc()
211 sljit_s32 type = GET_FLAG_TYPE(compiler->status_flags_state); in get_cc()
225 if (SLJIT_ADD_SUB_NO_COMPARE(compiler->status_flags_state)) { in get_cc()
226 sljit_s32 type = GET_FLAG_TYPE(compiler->status_flags_state); in get_cc()
246 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_COMPARE) in get_cc()
251 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_COMPARE) in get_cc()
261 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_SUB) in get_cc()
271 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_SUB) in get_cc()
284 if (compiler->status_flags_state & SLJIT_SET_Z) in get_cc()
292 if (compiler->status_flags_state & SLJIT_SET_Z) in get_cc()
866 static sljit_s32 update_zero_overflow(struct sljit_compiler *compiler, sljit_s32 op, sljit_gpr dst_… in update_zero_overflow() argument
874 FAIL_IF(push_inst(compiler, brc(0xc, 2 + 2 + ((op & SLJIT_32) ? 1 : 2) + 2 + 3 + 1))); in update_zero_overflow()
875 FAIL_IF(push_inst(compiler, ipm(tmp1))); in update_zero_overflow()
876 FAIL_IF(push_inst(compiler, (op & SLJIT_32) ? or(dst_r, dst_r) : ogr(dst_r, dst_r))); in update_zero_overflow()
877 FAIL_IF(push_inst(compiler, brc(0x8, 2 + 3))); in update_zero_overflow()
878 FAIL_IF(push_inst(compiler, slfi(tmp1, 0x10000000))); in update_zero_overflow()
879 FAIL_IF(push_inst(compiler, spm(tmp1))); in update_zero_overflow()
884 static sljit_s32 push_load_imm_inst(struct sljit_compiler *compiler, sljit_gpr target, sljit_sw v) in push_load_imm_inst() argument
888 return push_inst(compiler, lghi(target, (sljit_s16)v)); in push_load_imm_inst()
891 return push_inst(compiler, llill(target, (sljit_u16)v)); in push_load_imm_inst()
894 return push_inst(compiler, llilh(target, (sljit_u16)(v >> 16))); in push_load_imm_inst()
897 return push_inst(compiler, llihl(target, (sljit_u16)(v >> 32))); in push_load_imm_inst()
900 return push_inst(compiler, llihh(target, (sljit_u16)(v >> 48))); in push_load_imm_inst()
905 return push_inst(compiler, lgfi(target, (sljit_s32)v)); in push_load_imm_inst()
908 return push_inst(compiler, llilf(target, (sljit_u32)v)); in push_load_imm_inst()
911 return push_inst(compiler, llihf(target, (sljit_u32)((sljit_uw)v >> 32))); in push_load_imm_inst()
913 FAIL_IF(push_inst(compiler, llilf(target, (sljit_u32)v))); in push_load_imm_inst()
914 return push_inst(compiler, iihf(target, (sljit_u32)(v >> 32))); in push_load_imm_inst()
928 static sljit_s32 make_addr_bxy(struct sljit_compiler *compiler, in make_addr_bxy() argument
944 FAIL_IF(push_inst(compiler, sllg(tmp, index, (sljit_s32)off, 0))); in make_addr_bxy()
950 FAIL_IF(push_load_imm_inst(compiler, tmp, off)); in make_addr_bxy()
961 static sljit_s32 make_addr_bx(struct sljit_compiler *compiler, in make_addr_bx() argument
977 FAIL_IF(push_inst(compiler, sllg(tmp, index, (sljit_s32)off, 0))); in make_addr_bx()
983 FAIL_IF(push_load_imm_inst(compiler, tmp, off)); in make_addr_bx()
998 static sljit_s32 load_word(struct sljit_compiler *compiler, sljit_gpr dst_r, in load_word() argument
1008 FAIL_IF(make_addr_bx(compiler, &addr, src, srcw, tmp1)); in load_word()
1009 …return push_inst(compiler, 0x58000000 /* l */ | R20A(dst_r) | R16A(addr.index) | R12A(addr.base) |… in load_word()
1012 FAIL_IF(make_addr_bxy(compiler, &addr, src, srcw, tmp1)); in load_word()
1015 …return push_inst(compiler, ins | R36A(dst_r) | R32A(addr.index) | R28A(addr.base) | disp_s20(addr.… in load_word()
1019 static sljit_s32 load_unsigned_word(struct sljit_compiler *compiler, sljit_gpr dst_r, in load_unsigned_word() argument
1028 FAIL_IF(make_addr_bxy(compiler, &addr, src, srcw, tmp1)); in load_unsigned_word()
1031 …return push_inst(compiler, ins | R36A(dst_r) | R32A(addr.index) | R28A(addr.base) | disp_s20(addr.… in load_unsigned_word()
1035 static sljit_s32 store_word(struct sljit_compiler *compiler, sljit_gpr src_r, in store_word() argument
1045 FAIL_IF(make_addr_bx(compiler, &addr, dst, dstw, tmp1)); in store_word()
1046 …return push_inst(compiler, 0x50000000 /* st */ | R20A(src_r) | R16A(addr.index) | R12A(addr.base) … in store_word()
1049 FAIL_IF(make_addr_bxy(compiler, &addr, dst, dstw, tmp1)); in store_word()
1052 …return push_inst(compiler, ins | R36A(src_r) | R32A(addr.index) | R28A(addr.base) | disp_s20(addr.… in store_word()
1057 static sljit_s32 emit_move(struct sljit_compiler *compiler, in emit_move() argument
1064 return push_load_imm_inst(compiler, dst_r, srcw); in emit_move()
1067 return load_word(compiler, dst_r, src, srcw, (compiler->mode & SLJIT_32) != 0); in emit_move()
1070 return push_inst(compiler, (compiler->mode & SLJIT_32) ? lr(dst_r, src_r) : lgr(dst_r, src_r)); in emit_move()
1073 static sljit_s32 emit_rr(struct sljit_compiler *compiler, sljit_ins ins, in emit_rr() argument
1094 FAIL_IF(emit_move(compiler, dst_r, src1, src1w)); in emit_rr()
1099 FAIL_IF(emit_move(compiler, tmp1, src2, src2w)); in emit_rr()
1101 FAIL_IF(push_inst(compiler, ins | R4A(dst_r) | R0A(src_r))); in emit_rr()
1107 return push_inst(compiler, (compiler->mode & SLJIT_32) ? lr(dst_r, tmp0) : lgr(dst_r, tmp0)); in emit_rr()
1110 static sljit_s32 emit_rr1(struct sljit_compiler *compiler, sljit_ins ins, in emit_rr1() argument
1120 FAIL_IF(emit_move(compiler, tmp1, src1, src1w)); in emit_rr1()
1122 return push_inst(compiler, ins | R4A(dst_r) | R0A(src_r)); in emit_rr1()
1125 static sljit_s32 emit_rrf(struct sljit_compiler *compiler, sljit_ins ins, in emit_rrf() argument
1137 FAIL_IF(emit_move(compiler, tmp0, src1, src1w)); in emit_rrf()
1142 FAIL_IF(emit_move(compiler, tmp1, src2, src2w)); in emit_rrf()
1144 return push_inst(compiler, ins | R4A(dst_r) | R0A(src1_r) | R12A(src2_r)); in emit_rrf()
1152 static sljit_s32 emit_ri(struct sljit_compiler *compiler, sljit_ins ins, in emit_ri() argument
1169 FAIL_IF(emit_move(compiler, dst_r, src1, src1w)); in emit_ri()
1172 return push_inst(compiler, ins | R36A(dst_r) | (src2w & 0xffffffff)); in emit_ri()
1173 return push_inst(compiler, ins | R20A(dst_r) | (src2w & 0xffff)); in emit_ri()
1176 static sljit_s32 emit_rie_d(struct sljit_compiler *compiler, sljit_ins ins, in emit_rie_d() argument
1185 FAIL_IF(emit_move(compiler, tmp0, src1, src1w)); in emit_rie_d()
1189 return push_inst(compiler, ins | R36A(dst_r) | R32A(src_r) | (sljit_ins)(src2w & 0xffff) << 16); in emit_rie_d()
1197 static sljit_s32 emit_rx(struct sljit_compiler *compiler, sljit_ins ins, in emit_rx() argument
1221 FAIL_IF(emit_move(compiler, dst_r, src1, src1w)); in emit_rx()
1230 FAIL_IF(push_inst(compiler, sllg(tmp1, index, src2w & 0x3, 0))); in emit_rx()
1235 FAIL_IF(push_load_imm_inst(compiler, tmp1, src2w)); in emit_rx()
1249 FAIL_IF(push_inst(compiler, ins)); in emit_rx()
1255 return push_inst(compiler, (compiler->mode & SLJIT_32) ? lr(dst_r, tmp0) : lgr(dst_r, tmp0)); in emit_rx()
1258 static sljit_s32 emit_siy(struct sljit_compiler *compiler, sljit_ins ins, in emit_siy() argument
1272 FAIL_IF(push_inst(compiler, sllg(tmp1, index, dstw & 0x3, 0))); in emit_siy()
1274 FAIL_IF(push_inst(compiler, la(tmp1, 0, dst_r, index))); in emit_siy()
1278 FAIL_IF(push_load_imm_inst(compiler, tmp1, dstw)); in emit_siy()
1281 FAIL_IF(push_inst(compiler, la(tmp1, 0, dst_r, tmp1))); in emit_siy()
1288 …return push_inst(compiler, ins | ((sljit_ins)(srcw & 0xff) << 32) | R28A(dst_r) | disp_s20((sljit_… in emit_siy()
1301 static sljit_s32 emit_commutative(struct sljit_compiler *compiler, const struct ins_forms *forms, in emit_commutative() argument
1306 sljit_s32 mode = compiler->mode; in emit_commutative()
1326 return emit_rx(compiler, ins12, dst, src1, src1w, src2, src2w, RX_A); in emit_commutative()
1328 return emit_rx(compiler, ins20, dst, src1, src1w, src2, src2w, RXY_A); in emit_commutative()
1333 return emit_rx(compiler, ins12, dst, src2, src2w, src1, src1w, RX_A); in emit_commutative()
1335 return emit_rx(compiler, ins20, dst, src2, src2w, src1, src1w, RXY_A); in emit_commutative()
1352 return emit_rx(compiler, ins, dst, src1, src1w, src2, src2w, rx_type); in emit_commutative()
1355 return emit_rx(compiler, ins, dst, src2, src2w, src1, src1w, rx_type); in emit_commutative()
1372 return emit_rr(compiler, ins, dst, src1, src1w, src2, src2w); in emit_commutative()
1375 return emit_rr(compiler, ins, dst, src2, src2w, src1, src1w); in emit_commutative()
1379 return emit_rr(compiler, ins, dst, src1, src1w, src2, src2w); in emit_commutative()
1381 return emit_rrf(compiler, ins_k, dst, src1, src1w, src2, src2w); in emit_commutative()
1384 static sljit_s32 emit_non_commutative(struct sljit_compiler *compiler, const struct ins_forms *form… in emit_non_commutative() argument
1389 sljit_s32 mode = compiler->mode; in emit_non_commutative()
1406 return emit_rx(compiler, ins12, dst, src1, src1w, src2, src2w, RX_A); in emit_non_commutative()
1408 return emit_rx(compiler, ins20, dst, src1, src1w, src2, src2w, RXY_A); in emit_non_commutative()
1411 return emit_rx(compiler, ins12, dst, src1, src1w, src2, src2w, RX_A); in emit_non_commutative()
1413 return emit_rx(compiler, ins20, dst, src1, src1w, src2, src2w, RXY_A); in emit_non_commutative()
1419 …return emit_rr(compiler, (mode & SLJIT_32) ? forms->op_r : forms->op_gr, dst, src1, src1w, src2, s… in emit_non_commutative()
1421 return emit_rrf(compiler, ins, dst, src1, src1w, src2, src2w); in emit_non_commutative()
1424 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
1441 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
1442 reverse_buf(compiler); in sljit_generate_code()
1445 label = compiler->labels; in sljit_generate_code()
1446 jump = compiler->jumps; in sljit_generate_code()
1447 put_label = compiler->put_labels; in sljit_generate_code()
1454 for (buf = compiler->buf; buf != NULL; buf = buf->next) { in sljit_generate_code()
1511 compiler->exec_allocator_data); in sljit_generate_code()
1523 const_ = (struct sljit_s390x_const *)compiler->consts; in sljit_generate_code()
1526 label = compiler->labels; in sljit_generate_code()
1534 jump = compiler->jumps; in sljit_generate_code()
1535 put_label = compiler->put_labels; in sljit_generate_code()
1539 for (buf = compiler->buf; buf != NULL; buf = buf->next) { in sljit_generate_code()
1638 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
1639 compiler->executable_offset = executable_offset; in sljit_generate_code()
1640 compiler->executable_size = ins_size; in sljit_generate_code()
1674 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
1682 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
1683 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
1691 FAIL_IF(push_inst(compiler, stmg(r6, r14, offset, r15))); in sljit_emit_enter()
1694 FAIL_IF(push_inst(compiler, stmg(r6, r13 - (sljit_gpr)saved_arg_count, offset, r15))); in sljit_emit_enter()
1699 FAIL_IF(push_inst(compiler, stg(r6, offset, 0, r15))); in sljit_emit_enter()
1702 …FAIL_IF(push_inst(compiler, stmg(r6, r6 + (sljit_gpr)(scratches - SLJIT_FIRST_SAVED_REG), offset, … in sljit_emit_enter()
1708 FAIL_IF(push_inst(compiler, stg(r14, offset, 0, r15))); in sljit_emit_enter()
1711 FAIL_IF(push_inst(compiler, stmg(r14 - (sljit_gpr)saveds, r14, offset, r15))); in sljit_emit_enter()
1716 FAIL_IF(push_inst(compiler, stg(r14 - (sljit_gpr)saveds, offset, 0, r15))); in sljit_emit_enter()
1719 …FAIL_IF(push_inst(compiler, stmg(r14 - (sljit_gpr)saveds, r13 - (sljit_gpr)saved_arg_count, offset… in sljit_emit_enter()
1726 FAIL_IF(push_inst(compiler, stg(r14, offset, 0, r15))); in sljit_emit_enter()
1732 FAIL_IF(push_inst(compiler, 0x60000000 /* std */ | F20(i) | R12A(r15) | (sljit_ins)offset)); in sljit_emit_enter()
1737 FAIL_IF(push_inst(compiler, 0x60000000 /* std */ | F20(i) | R12A(r15) | (sljit_ins)offset)); in sljit_emit_enter()
1742 compiler->local_size = local_size; in sljit_emit_enter()
1744 …FAIL_IF(push_inst(compiler, 0xe30000000071 /* lay */ | R36A(r15) | R28A(r15) | disp_s20(-local_siz… in sljit_emit_enter()
1755 FAIL_IF(push_inst(compiler, lgr(gpr(SLJIT_S0 - saved_arg_count), gpr(SLJIT_R0 + tmp)))); in sljit_emit_enter()
1767 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1772 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
1773 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
1775 compiler->local_size = (local_size + SLJIT_S390X_DEFAULT_STACK_FRAME_SIZE + 0xf) & ~0xf; in sljit_set_context()
1779 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_gpr last_reg) in emit_stack_frame_release() argument
1782 sljit_s32 local_size = compiler->local_size; in emit_stack_frame_release()
1783 sljit_s32 saveds = compiler->saveds; in emit_stack_frame_release()
1784 sljit_s32 scratches = compiler->scratches; in emit_stack_frame_release()
1785 sljit_s32 kept_saveds_count = SLJIT_KEPT_SAVEDS_COUNT(compiler->options); in emit_stack_frame_release()
1788 FAIL_IF(push_inst(compiler, 0x41000000 /* ly */ | R20A(r15) | R12A(r15) | (sljit_ins)local_size)); in emit_stack_frame_release()
1790 …FAIL_IF(push_inst(compiler, 0xe30000000071 /* lay */ | R36A(r15) | R28A(r15) | disp_s20(local_size… in emit_stack_frame_release()
1795 FAIL_IF(push_inst(compiler, lmg(r6, last_reg, offset, r15))); in emit_stack_frame_release()
1798 FAIL_IF(push_inst(compiler, lmg(r6, r13 - (sljit_gpr)kept_saveds_count, offset, r15))); in emit_stack_frame_release()
1803 FAIL_IF(push_inst(compiler, lg(r6, offset, 0, r15))); in emit_stack_frame_release()
1806 …FAIL_IF(push_inst(compiler, lmg(r6, r6 + (sljit_gpr)(scratches - SLJIT_FIRST_SAVED_REG), offset, r… in emit_stack_frame_release()
1813 FAIL_IF(push_inst(compiler, lg(r14, offset, 0, r15))); in emit_stack_frame_release()
1816 FAIL_IF(push_inst(compiler, lg(r13, offset, 0, r15))); in emit_stack_frame_release()
1819 FAIL_IF(push_inst(compiler, lmg(r14 - (sljit_gpr)saveds, last_reg, offset, r15))); in emit_stack_frame_release()
1824 FAIL_IF(push_inst(compiler, lg(r14 - (sljit_gpr)saveds, offset, 0, r15))); in emit_stack_frame_release()
1827 …FAIL_IF(push_inst(compiler, lmg(r14 - (sljit_gpr)saveds, r13 - (sljit_gpr)kept_saveds_count, offse… in emit_stack_frame_release()
1835 FAIL_IF(push_inst(compiler, lg(r14, offset, 0, r15))); in emit_stack_frame_release()
1839 tmp = SLJIT_FS0 - compiler->fsaveds; in emit_stack_frame_release()
1841 FAIL_IF(push_inst(compiler, 0x68000000 /* ld */ | F20(i) | R12A(r15) | (sljit_ins)offset)); in emit_stack_frame_release()
1845 for (i = compiler->fscratches; i >= SLJIT_FIRST_SAVED_FLOAT_REG; i--) { in emit_stack_frame_release()
1846 FAIL_IF(push_inst(compiler, 0x68000000 /* ld */ | F20(i) | R12A(r15) | (sljit_ins)offset)); in emit_stack_frame_release()
1853 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
1856 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
1858 FAIL_IF(emit_stack_frame_release(compiler, r14)); in sljit_emit_return_void()
1859 return push_inst(compiler, br(r14)); /* return */ in sljit_emit_return_void()
1862 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *compiler, in sljit_emit_return_to() argument
1866 CHECK(check_sljit_emit_return_to(compiler, src, srcw)); in sljit_emit_return_to()
1870 FAIL_IF(load_word(compiler, tmp1, src, srcw, 0 /* 64-bit */)); in sljit_emit_return_to()
1873 …} else if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->op… in sljit_emit_return_to()
1874 FAIL_IF(push_inst(compiler, lgr(tmp1, gpr(src)))); in sljit_emit_return_to()
1879 FAIL_IF(emit_stack_frame_release(compiler, r13)); in sljit_emit_return_to()
1881 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_return_to()
1882 return sljit_emit_ijump(compiler, SLJIT_JUMP, src, srcw); in sljit_emit_return_to()
1889 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
1895 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
1901 return push_inst(compiler, 0x0001 /* 2-byte trap */); in sljit_emit_op0()
1903 return push_inst(compiler, 0x0700 /* 2-byte nop */); in sljit_emit_op0()
1905 FAIL_IF(push_inst(compiler, mlgr(arg0, arg0))); in sljit_emit_op0()
1910 FAIL_IF(push_inst(compiler, srag(tmp0, arg0, 63, 0))); in sljit_emit_op0()
1911 FAIL_IF(push_inst(compiler, srag(tmp1, arg1, 63, 0))); in sljit_emit_op0()
1912 FAIL_IF(push_inst(compiler, ngr(tmp0, arg1))); in sljit_emit_op0()
1913 FAIL_IF(push_inst(compiler, ngr(tmp1, arg0))); in sljit_emit_op0()
1916 FAIL_IF(push_inst(compiler, mlgr(arg0, arg0))); in sljit_emit_op0()
1918 FAIL_IF(push_inst(compiler, sgr(arg0, tmp0))); in sljit_emit_op0()
1919 FAIL_IF(push_inst(compiler, sgr(arg0, tmp1))); in sljit_emit_op0()
1923 FAIL_IF(push_inst(compiler, lhi(tmp0, 0))); in sljit_emit_op0()
1924 FAIL_IF(push_inst(compiler, lr(tmp1, arg0))); in sljit_emit_op0()
1925 FAIL_IF(push_inst(compiler, dlr(tmp0, arg1))); in sljit_emit_op0()
1926 FAIL_IF(push_inst(compiler, lr(arg0, tmp1))); /* quotient */ in sljit_emit_op0()
1928 return push_inst(compiler, lr(arg1, tmp0)); /* remainder */ in sljit_emit_op0()
1933 FAIL_IF(push_inst(compiler, lhi(tmp0, 0))); in sljit_emit_op0()
1934 FAIL_IF(push_inst(compiler, lr(tmp1, arg0))); in sljit_emit_op0()
1935 FAIL_IF(push_inst(compiler, dr(tmp0, arg1))); in sljit_emit_op0()
1936 FAIL_IF(push_inst(compiler, lr(arg0, tmp1))); /* quotient */ in sljit_emit_op0()
1938 return push_inst(compiler, lr(arg1, tmp0)); /* remainder */ in sljit_emit_op0()
1943 FAIL_IF(push_inst(compiler, lghi(tmp0, 0))); in sljit_emit_op0()
1944 FAIL_IF(push_inst(compiler, lgr(tmp1, arg0))); in sljit_emit_op0()
1945 FAIL_IF(push_inst(compiler, dlgr(tmp0, arg1))); in sljit_emit_op0()
1946 FAIL_IF(push_inst(compiler, lgr(arg0, tmp1))); /* quotient */ in sljit_emit_op0()
1948 return push_inst(compiler, lgr(arg1, tmp0)); /* remainder */ in sljit_emit_op0()
1953 FAIL_IF(push_inst(compiler, lgr(tmp1, arg0))); in sljit_emit_op0()
1954 FAIL_IF(push_inst(compiler, dsgr(tmp0, arg1))); in sljit_emit_op0()
1955 FAIL_IF(push_inst(compiler, lgr(arg0, tmp1))); /* quotient */ in sljit_emit_op0()
1957 return push_inst(compiler, lgr(arg1, tmp0)); /* remainder */ in sljit_emit_op0()
1968 FAIL_IF(push_inst(compiler, lgr(tmp0, arg0))); in sljit_emit_op0()
1969 FAIL_IF(push_inst(compiler, lgr(arg0, arg1))); in sljit_emit_op0()
1970 return push_inst(compiler, lgr(arg1, tmp0)); in sljit_emit_op0()
1973 static sljit_s32 sljit_emit_clz_ctz(struct sljit_compiler *compiler, sljit_s32 op, sljit_gpr dst_r,… in sljit_emit_clz_ctz() argument
1978 FAIL_IF(push_inst(compiler, 0xb9160000 /* llgfr */ | R4A(tmp0) | R0A(src_r))); in sljit_emit_clz_ctz()
1983 …FAIL_IF(push_inst(compiler, ((op & SLJIT_32) ? 0x1300 /* lcr */ : 0xb9030000 /* lcgr */) | R4A(tmp… in sljit_emit_clz_ctz()
1986 …FAIL_IF(push_inst(compiler, ((op & SLJIT_32) ? 0x1400 /* nr */ : 0xb9800000 /* ngr */) | R4A(tmp0)… in sljit_emit_clz_ctz()
1988 FAIL_IF(push_inst(compiler, 0xb9e40000 /* ngrk */ | R12A(tmp1) | R4A(tmp0) | R0A(src_r))); in sljit_emit_clz_ctz()
1993 FAIL_IF(push_inst(compiler, 0xb9830000 /* flogr */ | R4A(tmp0) | R0A(src_r))); in sljit_emit_clz_ctz()
1996 …FAIL_IF(push_inst(compiler, 0xec00000000d9 /* aghik */ | R36A(tmp1) | R32A(tmp0) | ((sljit_ins)(-6… in sljit_emit_clz_ctz()
2000 …return push_inst(compiler, 0xec00000000d9 /* aghik */ | R36A(dst_r) | R32A(tmp0) | ((sljit_ins)(-3… in sljit_emit_clz_ctz()
2002 FAIL_IF(push_inst(compiler, 0xc20800000000 /* agfi */ | R36A(tmp0) | (sljit_u32)-32)); in sljit_emit_clz_ctz()
2006 …FAIL_IF(push_inst(compiler, 0xec0000000057 /* rxsbg */ | R36A(tmp0) | R32A(tmp1) | ((sljit_ins)((o… in sljit_emit_clz_ctz()
2011 …return push_inst(compiler, ((op & SLJIT_32) ? 0x1800 /* lr */ : 0xb9040000 /* lgr */) | R4A(dst_r)… in sljit_emit_clz_ctz()
2017 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
2028 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
2086 FAIL_IF(push_inst(compiler, ins)); in sljit_emit_op1()
2112 return push_load_imm_inst(compiler, gpr(dst), srcw); in sljit_emit_op1()
2120 FAIL_IF(make_addr_bxy(compiler, &mem, src, srcw, tmp1)); in sljit_emit_op1()
2165 FAIL_IF(push_inst(compiler, ins)); in sljit_emit_op1()
2174 FAIL_IF(push_load_imm_inst(compiler, reg, srcw)); in sljit_emit_op1()
2177 FAIL_IF(make_addr_bxy(compiler, &mem, dst, dstw, tmp1)); in sljit_emit_op1()
2181 return push_inst(compiler, in sljit_emit_op1()
2185 return push_inst(compiler, in sljit_emit_op1()
2190 return push_inst(compiler, in sljit_emit_op1()
2194 FAIL_IF(push_inst(compiler, LEVAL(stg))); in sljit_emit_op1()
2204 FAIL_IF(make_addr_bxy(compiler, &mem, src, srcw, tmp1)); in sljit_emit_op1()
2208 FAIL_IF(push_inst(compiler, in sljit_emit_op1()
2210 FAIL_IF(make_addr_bxy(compiler, &mem, dst, dstw, tmp1)); in sljit_emit_op1()
2211 return push_inst(compiler, in sljit_emit_op1()
2215 FAIL_IF(push_inst(compiler, in sljit_emit_op1()
2217 FAIL_IF(make_addr_bxy(compiler, &mem, dst, dstw, tmp1)); in sljit_emit_op1()
2218 return push_inst(compiler, in sljit_emit_op1()
2223 FAIL_IF(push_inst(compiler, in sljit_emit_op1()
2225 FAIL_IF(make_addr_bxy(compiler, &mem, dst, dstw, tmp1)); in sljit_emit_op1()
2226 return push_inst(compiler, in sljit_emit_op1()
2230 FAIL_IF(push_inst(compiler, in sljit_emit_op1()
2232 FAIL_IF(make_addr_bxy(compiler, &mem, dst, dstw, tmp1)); in sljit_emit_op1()
2233 FAIL_IF(push_inst(compiler, in sljit_emit_op1()
2248 compiler->status_flags_state = op & (VARIABLE_FLAG_MASK | SLJIT_SET_Z); in sljit_emit_op1()
2254 FAIL_IF(load_word(compiler, src_r, src, srcw, op & SLJIT_32)); in sljit_emit_op1()
2258 FAIL_IF(push_load_imm_inst(compiler, tmp1, -1)); in sljit_emit_op1()
2260 FAIL_IF(push_inst(compiler, lgr(dst_r, src_r))); in sljit_emit_op1()
2262 FAIL_IF(push_inst(compiler, xgr(dst_r, tmp1))); in sljit_emit_op1()
2267 FAIL_IF(push_inst(compiler, xilf(dst_r, 0xffffffff))); in sljit_emit_op1()
2269 FAIL_IF(push_load_imm_inst(compiler, tmp1, -1)); in sljit_emit_op1()
2271 FAIL_IF(push_inst(compiler, lr(dst_r, src_r))); in sljit_emit_op1()
2273 FAIL_IF(push_inst(compiler, xr(dst_r, tmp1))); in sljit_emit_op1()
2279 FAIL_IF(load_unsigned_word(compiler, src_r, src, srcw, op & SLJIT_32)); in sljit_emit_op1()
2281 FAIL_IF(sljit_emit_clz_ctz(compiler, op, dst_r, src_r)); in sljit_emit_op1()
2288 FAIL_IF(update_zero_overflow(compiler, op, dst_r)); in sljit_emit_op1()
2291 return store_word(compiler, dst_r, dst, dstw, op & SLJIT_32); in sljit_emit_op1()
2330 static sljit_s32 sljit_emit_add(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_add() argument
2346 return emit_siy(compiler, ins, dst, dstw, src2w); in sljit_emit_add()
2354 FAIL_IF(emit_rie_d(compiler, ins, dst, src1, src1w, src2w)); in sljit_emit_add()
2361 FAIL_IF(emit_ri(compiler, ins, dst, src1, src1w, src2w, RIL_A)); in sljit_emit_add()
2365 FAIL_IF(emit_ri(compiler, 0xc20400000000 /* slgfi */, dst, src1, src1w, -src2w, RIL_A)); in sljit_emit_add()
2371 FAIL_IF(emit_ri(compiler, ins, dst, src1, src1w, src2w, RIL_A)); in sljit_emit_add()
2377 FAIL_IF(emit_commutative(compiler, forms, dst, src1, src1w, src2, src2w)); in sljit_emit_add()
2381 FAIL_IF(update_zero_overflow(compiler, op, FAST_IS_REG(dst) ? gpr(dst & REG_MASK) : tmp0)); in sljit_emit_add()
2384 return store_word(compiler, tmp0, dst, dstw, op & SLJIT_32); in sljit_emit_add()
2409 static sljit_s32 sljit_emit_sub(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_sub() argument
2423 compiler->status_flags_state |= SLJIT_CURRENT_FLAGS_COMPARE; in sljit_emit_sub()
2430 return emit_ri(compiler, ins, src1, src1, src1w, src2w, RIL_A); in sljit_emit_sub()
2436 return emit_ri(compiler, ins, src1, src1, src1w, src2w, RIL_A); in sljit_emit_sub()
2439 return emit_rie_d(compiler, 0xec00000000db /* alghsik */, (sljit_s32)tmp0, src1, src1w, src2w); in sljit_emit_sub()
2445 return emit_rx(compiler, ins, src1, src1, src1w, src2, src2w, RX_A); in sljit_emit_sub()
2452 return emit_rx(compiler, ins, src1, src1, src1w, src2, src2w, RXY_A); in sljit_emit_sub()
2459 return emit_rr(compiler, ins, src1, src1, src1w, src2, src2w); in sljit_emit_sub()
2464 FAIL_IF(emit_rr1(compiler, ins, dst, src2, src2w)); in sljit_emit_sub()
2477 return emit_siy(compiler, ins, dst, dstw, neg_src2w); in sljit_emit_sub()
2485 FAIL_IF(emit_rie_d(compiler, ins, dst, src1, src1w, neg_src2w)); in sljit_emit_sub()
2493 FAIL_IF(emit_ri(compiler, ins, dst, src1, src1w, src2w, RIL_A)); in sljit_emit_sub()
2497 FAIL_IF(emit_ri(compiler, 0xc20a00000000 /* algfi */, dst, src1, src1w, neg_src2w, RIL_A)); in sljit_emit_sub()
2503 FAIL_IF(emit_ri(compiler, ins, dst, src1, src1w, neg_src2w, RIL_A)); in sljit_emit_sub()
2509 FAIL_IF(emit_non_commutative(compiler, forms, dst, src1, src1w, src2, src2w)); in sljit_emit_sub()
2521 FAIL_IF(push_inst(compiler, brc(0xe, 2 + 2))); in sljit_emit_sub()
2522 FAIL_IF(push_inst(compiler, (op & SLJIT_32) ? lcr(tmp1, dst_r) : lcgr(tmp1, dst_r))); in sljit_emit_sub()
2525 FAIL_IF(update_zero_overflow(compiler, op, dst_r)); in sljit_emit_sub()
2529 return store_word(compiler, tmp0, dst, dstw, op & SLJIT_32); in sljit_emit_sub()
2554 static sljit_s32 sljit_emit_multiply(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_multiply() argument
2573 return emit_commutative(compiler, &multiply_overflow_forms, dst, src1, src1w, src2, src2w); in sljit_emit_multiply()
2579 return emit_ri(compiler, ins, dst, src1, src1w, src2w, RI_A); in sljit_emit_multiply()
2584 return emit_ri(compiler, ins, dst, src1, src1w, src2w, RIL_A); in sljit_emit_multiply()
2588 return emit_commutative(compiler, &multiply_forms, dst, src1, src1w, src2, src2w); in sljit_emit_multiply()
2591 static sljit_s32 sljit_emit_bitwise_imm(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_bitwise_imm() argument
2596 sljit_s32 mode = compiler->mode; in sljit_emit_bitwise_imm()
2607 FAIL_IF(emit_move(compiler, dst_r, src1, src1w)); in sljit_emit_bitwise_imm()
2611 FAIL_IF(push_inst(compiler, 0xc00a00000000 /* nihf */ | R36A(dst_r) | (imm >> 32))); in sljit_emit_bitwise_imm()
2612 return push_inst(compiler, 0xc00b00000000 /* nilf */ | R36A(dst_r) | (imm & 0xffffffff)); in sljit_emit_bitwise_imm()
2616 FAIL_IF(push_inst(compiler, 0xc00c00000000 /* oihf */ | R36A(dst_r) | (imm >> 32))); in sljit_emit_bitwise_imm()
2617 return push_inst(compiler, 0xc00d00000000 /* oilf */ | R36A(dst_r) | (imm & 0xffffffff)); in sljit_emit_bitwise_imm()
2622 return push_inst(compiler, 0xc00c00000000 /* oihf */ | R36A(dst_r) | (imm >> 32)); in sljit_emit_bitwise_imm()
2624 return push_inst(compiler, 0xc00d00000000 /* oilf */ | R36A(dst_r) | (imm & 0xffffffff)); in sljit_emit_bitwise_imm()
2628 FAIL_IF(push_inst(compiler, 0xa5080000 /* oihh */ | R20A(dst_r) | (imm >> 48))); in sljit_emit_bitwise_imm()
2630 FAIL_IF(push_inst(compiler, 0xa5090000 /* oihl */ | R20A(dst_r) | ((imm >> 32) & 0xffff))); in sljit_emit_bitwise_imm()
2632 FAIL_IF(push_inst(compiler, 0xa50a0000 /* oilh */ | R20A(dst_r) | ((imm >> 16) & 0xffff))); in sljit_emit_bitwise_imm()
2634 return push_inst(compiler, 0xa50b0000 /* oill */ | R20A(dst_r) | (imm & 0xffff)); in sljit_emit_bitwise_imm()
2639 FAIL_IF(push_inst(compiler, 0xc00600000000 /* xihf */ | R36A(dst_r) | (imm >> 32))); in sljit_emit_bitwise_imm()
2641 return push_inst(compiler, 0xc00700000000 /* xilf */ | R36A(dst_r) | (imm & 0xffffffff)); in sljit_emit_bitwise_imm()
2675 static sljit_s32 sljit_emit_bitwise(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_bitwise() argument
2705 FAIL_IF(emit_move(compiler, tmp0, src1, src1w)); in sljit_emit_bitwise()
2708 return push_inst(compiler, 0xa7010000 | R20A(src_r) | imm); in sljit_emit_bitwise()
2710 return push_inst(compiler, 0xa7000000 | R20A(src_r) | (imm >> 16)); in sljit_emit_bitwise()
2712 return push_inst(compiler, 0xa7030000 | R20A(src_r) | (imm >> 32)); in sljit_emit_bitwise()
2713 return push_inst(compiler, 0xa7020000 | R20A(src_r) | (imm >> 48)); in sljit_emit_bitwise()
2717 return sljit_emit_bitwise_imm(compiler, type, dst, src1, src1w, imm, count16); in sljit_emit_bitwise()
2727 return emit_commutative(compiler, forms, dst, src1, src1w, src2, src2w); in sljit_emit_bitwise()
2730 static sljit_s32 sljit_emit_shift(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_shift() argument
2745 FAIL_IF(emit_move(compiler, tmp0, src1, src1w)); in sljit_emit_shift()
2751 FAIL_IF(emit_move(compiler, tmp1, src2, src2w)); in sljit_emit_shift()
2757 …FAIL_IF(push_inst(compiler, 0xec0000000055 /* risbg */ | R36A(tmp1) | R32A(base_r) | (59 << 24) | … in sljit_emit_shift()
2760 FAIL_IF(push_inst(compiler, 0xa5070000 /* nill */ | R20A(tmp1) | 0x1f)); in sljit_emit_shift()
2773 FAIL_IF(push_inst(compiler, ins | R20A(dst_r) | R12A(base_r) | imm)); in sljit_emit_shift()
2782 FAIL_IF(push_inst(compiler, ins | R36A(dst_r) | R32A(src_r) | R28A(base_r) | (imm << 16))); in sljit_emit_shift()
2786 return push_inst(compiler, (op & SLJIT_32) ? or(dst_r, dst_r) : ogr(dst_r, dst_r)); in sljit_emit_shift()
2791 static sljit_s32 sljit_emit_rotate(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_rotate() argument
2805 FAIL_IF(emit_move(compiler, tmp0, src1, src1w)); in sljit_emit_rotate()
2811 FAIL_IF(emit_move(compiler, tmp1, src2, src2w)); in sljit_emit_rotate()
2819 FAIL_IF(push_inst(compiler, ins | R4A(tmp1) | R0A(base_r))); in sljit_emit_rotate()
2829 return push_inst(compiler, ins | R36A(dst_r) | R32A(src_r) | R28A(base_r) | (imm << 16)); in sljit_emit_rotate()
2852 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
2858 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
2863 compiler->mode = op & SLJIT_32; in sljit_emit_op2()
2864 compiler->status_flags_state = op & (VARIABLE_FLAG_MASK | SLJIT_SET_Z); in sljit_emit_op2()
2878 compiler->status_flags_state |= SLJIT_CURRENT_FLAGS_ADD; in sljit_emit_op2()
2879 return sljit_emit_add(compiler, op, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2881 compiler->status_flags_state |= SLJIT_CURRENT_FLAGS_ADD; in sljit_emit_op2()
2882 FAIL_IF(emit_commutative(compiler, &addc_forms, dst, src1, src1w, src2, src2w)); in sljit_emit_op2()
2884 return store_word(compiler, tmp0, dst, dstw, op & SLJIT_32); in sljit_emit_op2()
2887 compiler->status_flags_state |= SLJIT_CURRENT_FLAGS_SUB; in sljit_emit_op2()
2888 return sljit_emit_sub(compiler, op, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2890 compiler->status_flags_state |= SLJIT_CURRENT_FLAGS_SUB; in sljit_emit_op2()
2891 FAIL_IF(emit_non_commutative(compiler, &subc_forms, dst, src1, src1w, src2, src2w)); in sljit_emit_op2()
2893 return store_word(compiler, tmp0, dst, dstw, op & SLJIT_32); in sljit_emit_op2()
2896 FAIL_IF(sljit_emit_multiply(compiler, op, dst, src1, src1w, src2, src2w)); in sljit_emit_op2()
2901 FAIL_IF(sljit_emit_bitwise(compiler, op, dst, src1, src1w, src2, src2w)); in sljit_emit_op2()
2909 FAIL_IF(sljit_emit_shift(compiler, op, dst, src1, src1w, src2, src2w)); in sljit_emit_op2()
2913 FAIL_IF(sljit_emit_rotate(compiler, op, dst, src1, src1w, src2, src2w)); in sljit_emit_op2()
2918 return store_word(compiler, tmp0, dst, dstw, op & SLJIT_32); in sljit_emit_op2()
2922 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
2927 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
2929 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_op2u()
2930 return sljit_emit_op2(compiler, op, (sljit_s32)tmp0, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
2933 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_shift_into(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_shift_into() argument
2946 CHECK(check_sljit_emit_shift_into(compiler, op, src_dst, src1, src1w, src2, src2w)); in sljit_emit_shift_into()
2951 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_shift_into()
2952 …return sljit_emit_op2(compiler, (is_right ? SLJIT_ROTR : SLJIT_ROTL) | (op & SLJIT_32), src_dst, 0… in sljit_emit_shift_into()
2959 FAIL_IF(load_word(compiler, tmp0, src1, src1w, op & SLJIT_32)); in sljit_emit_shift_into()
2961 FAIL_IF(push_load_imm_inst(compiler, tmp0, src1w)); in sljit_emit_shift_into()
2973 FAIL_IF(load_word(compiler, tmp1, src2, src2w, op & SLJIT_32)); in sljit_emit_shift_into()
2978 FAIL_IF(push_inst(compiler, ins | R20A(src_dst_r) | (sljit_ins)src2w)); in sljit_emit_shift_into()
2981 FAIL_IF(push_inst(compiler, ins | R36A(src_dst_r) | R32A(src_dst_r) | ((sljit_ins)src2w << 16))); in sljit_emit_shift_into()
2992 return push_inst(compiler, ins | R36A(src_dst_r) | R32A(src1_r)); in sljit_emit_shift_into()
2998 …FAIL_IF(push_inst(compiler, 0xec0000000055 /* risbg */ | R36A(tmp1) | R32A(src2_r) | (59 << 24) | … in sljit_emit_shift_into()
3001 FAIL_IF(push_inst(compiler, 0xa5070000 /* nill */ | R20A(tmp1) | 0x1f)); in sljit_emit_shift_into()
3005 FAIL_IF(push_inst(compiler, ins | R20A(src_dst_r) | R12A(src2_r))); in sljit_emit_shift_into()
3008 FAIL_IF(push_inst(compiler, 0xa50f0000 /* llill */ | R20A(tmp1) | 0x1f)); in sljit_emit_shift_into()
3009 FAIL_IF(push_inst(compiler, 0x1700 /* xr */ | R4A(tmp1) | R0A(src2_r))); in sljit_emit_shift_into()
3011 FAIL_IF(push_inst(compiler, 0xc00700000000 /* xilf */ | R36A(tmp1) | 0x1f)); in sljit_emit_shift_into()
3015 FAIL_IF(push_inst(compiler, ins | R20A(tmp0) | R12A(tmp1) | 0x1)); in sljit_emit_shift_into()
3018 FAIL_IF(push_inst(compiler, ins | R36A(tmp0) | R32A(src1_r) | R28A(tmp1) | (0x1 << 16))); in sljit_emit_shift_into()
3021 return push_inst(compiler, 0x1600 /* or */ | R4A(src_dst_r) | R0A(tmp0)); in sljit_emit_shift_into()
3025 FAIL_IF(push_inst(compiler, ins | R36A(src_dst_r) | R32A(src_dst_r) | R28A(src2_r))); in sljit_emit_shift_into()
3031 FAIL_IF(push_inst(compiler, 0xa50f0000 /* llill */ | R20A(tmp1) | 0x3f)); in sljit_emit_shift_into()
3033 FAIL_IF(push_inst(compiler, ins | R36A(tmp0) | R32A(src1_r) | (0x1 << 16))); in sljit_emit_shift_into()
3037 FAIL_IF(push_inst(compiler, 0xb9820000 /* xgr */ | R4A(tmp1) | R0A(src2_r))); in sljit_emit_shift_into()
3039 FAIL_IF(push_inst(compiler, 0xc00700000000 /* xilf */ | R36A(tmp1) | 0x3f)); in sljit_emit_shift_into()
3041 FAIL_IF(push_inst(compiler, 0xb9030000 /* lcgr */ | R4A(tmp1) | R0A(src2_r))); in sljit_emit_shift_into()
3043 FAIL_IF(push_inst(compiler, ins | R36A(tmp0) | R32A(src1_r) | R28A(tmp1))); in sljit_emit_shift_into()
3044 return push_inst(compiler, 0xb9810000 /* ogr */ | R4A(src_dst_r) | R0A(tmp0)); in sljit_emit_shift_into()
3048 struct sljit_compiler *compiler, in sljit_emit_op_src() argument
3055 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
3062 FAIL_IF(load_word(compiler, tmp1, src, srcw, 0)); in sljit_emit_op_src()
3064 return push_inst(compiler, br(src_r)); in sljit_emit_op_src()
3071 FAIL_IF(make_addr_bxy(compiler, &addr, src, srcw, tmp1)); in sljit_emit_op_src()
3072 …return push_inst(compiler, 0xe31000000036 /* pfd */ | R32A(addr.index) | R28A(addr.base) | disp_s2… in sljit_emit_op_src()
3092 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
3098 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
3101 return push_inst(compiler, ins); in sljit_emit_op_custom()
3111 static sljit_s32 float_mem(struct sljit_compiler *compiler, sljit_s32 op, in float_mem() argument
3121 FAIL_IF(make_addr_bx(compiler, &addr, mem, memw, tmp1)); in float_mem()
3128 …return push_inst(compiler, ins | F20(reg) | R16A(addr.index) | R12A(addr.base) | (sljit_ins)addr.o… in float_mem()
3131 FAIL_IF(make_addr_bxy(compiler, &addr, mem, memw, tmp1)); in float_mem()
3138 …return push_inst(compiler, ins | F36(reg) | R32A(addr.index) | R28A(addr.base) | disp_s20(addr.off… in float_mem()
3141 static sljit_s32 emit_float(struct sljit_compiler *compiler, sljit_ins ins_r, sljit_ins ins, in emit_float() argument
3148 return push_inst(compiler, ins_r | F4(reg) | F0(src)); in emit_float()
3150 FAIL_IF(make_addr_bx(compiler, &addr, src, srcw, tmp1)); in emit_float()
3151 …return push_inst(compiler, ins | F36(reg) | R32A(addr.index) | R28A(addr.base) | ((sljit_ins)addr.… in emit_float()
3154 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
3162 FAIL_IF(float_mem(compiler, FLOAT_LOAD | (op & SLJIT_32), TMP_FREG1, src, srcw)); in sljit_emit_fop1_conv_sw_from_f64()
3172 FAIL_IF(push_inst(compiler, ins | R4A(dst_r) | F0(src))); in sljit_emit_fop1_conv_sw_from_f64()
3175 return store_word(compiler, dst_r, dst, dstw, GET_OPCODE(op) >= SLJIT_CONV_S32_FROM_F64); in sljit_emit_fop1_conv_sw_from_f64()
3180 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
3188 FAIL_IF(push_load_imm_inst(compiler, tmp0, srcw)); in sljit_emit_fop1_conv_f64_from_sw()
3192 FAIL_IF(load_word(compiler, tmp0, src, srcw, GET_OPCODE(op) >= SLJIT_CONV_F64_FROM_S32)); in sljit_emit_fop1_conv_f64_from_sw()
3201 FAIL_IF(push_inst(compiler, ins | F4(dst_r) | R0(src))); in sljit_emit_fop1_conv_f64_from_sw()
3204 return float_mem(compiler, FLOAT_STORE | (op & SLJIT_32), TMP_FREG1, dst, dstw); in sljit_emit_fop1_conv_f64_from_sw()
3209 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
3216 FAIL_IF(float_mem(compiler, FLOAT_LOAD | (op & SLJIT_32), TMP_FREG1, src1, src1w)); in sljit_emit_fop1_cmp()
3228 return emit_float(compiler, ins_r, ins, src1, src2, src2w); in sljit_emit_fop1_cmp()
3231 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
3240 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
3245 …FAIL_IF(emit_float(compiler, 0xb3040000 /* ldebr */, 0xed0000000004 /* ldeb */, dst_r, src, srcw)); in sljit_emit_fop1()
3248 …FAIL_IF(float_mem(compiler, FLOAT_LOAD | (op == SLJIT_CONV_F32_FROM_F64 ? 0 : (op & SLJIT_32)), ds… in sljit_emit_fop1()
3261 return float_mem(compiler, FLOAT_STORE | (op & SLJIT_32), src, dst, dstw); in sljit_emit_fop1()
3275 FAIL_IF(push_inst(compiler, ins | F4(dst_r) | F0(src))); in sljit_emit_fop1()
3283 return float_mem(compiler, FLOAT_STORE | (op & SLJIT_32), TMP_FREG1, dst, dstw); in sljit_emit_fop1()
3289 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
3298 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
3318 FAIL_IF(push_inst(compiler, FLOAT_MOV(op, TMP_FREG1, src2))); in sljit_emit_fop2()
3324 FAIL_IF(float_mem(compiler, FLOAT_LOAD | (op & SLJIT_32), dst_r, src1, src1w)); in sljit_emit_fop2()
3326 FAIL_IF(push_inst(compiler, FLOAT_MOV(op, dst_r, src1))); in sljit_emit_fop2()
3349 FAIL_IF(emit_float(compiler, ins_r, ins, dst_r, src2, src2w)); in sljit_emit_fop2()
3352 return float_mem(compiler, FLOAT_STORE | (op & SLJIT_32), TMP_FREG1, dst, dstw); in sljit_emit_fop2()
3362 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
3365 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
3369 return push_inst(compiler, lgr(gpr(dst), link_r)); in sljit_emit_fast_enter()
3372 return store_word(compiler, link_r, dst, dstw, 0); in sljit_emit_fast_enter()
3379 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
3384 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
3386 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
3387 return compiler->last_label; in sljit_emit_label()
3389 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
3391 set_label(label, compiler); in sljit_emit_label()
3395 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
3397 sljit_u8 mask = ((type & 0xff) < SLJIT_JUMP) ? get_cc(compiler, type & 0xff) : 0xf; in sljit_emit_jump()
3400 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
3404 ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
3406 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
3407 jump->addr = compiler->size; in sljit_emit_jump()
3412 PTR_FAIL_IF(push_inst(compiler, brasl(link_r, 0))); in sljit_emit_jump()
3414 PTR_FAIL_IF(push_inst(compiler, brcl(mask, 0))); in sljit_emit_jump()
3419 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_call(struct sljit_compiler *compiler, sljit_… in sljit_emit_call() argument
3424 CHECK_PTR(check_sljit_emit_call(compiler, type, arg_types)); in sljit_emit_call()
3427 PTR_FAIL_IF(emit_stack_frame_release(compiler, r14)); in sljit_emit_call()
3431 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_call()
3432 return sljit_emit_jump(compiler, type); in sljit_emit_call()
3435 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
3440 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
3444 FAIL_IF(push_load_imm_inst(compiler, src_r, srcw)); in sljit_emit_ijump()
3448 FAIL_IF(load_word(compiler, src_r, src, srcw, 0 /* 64-bit */)); in sljit_emit_ijump()
3453 return push_inst(compiler, basr(link_r, src_r)); in sljit_emit_ijump()
3455 return push_inst(compiler, br(src_r)); in sljit_emit_ijump()
3458 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_icall() argument
3463 CHECK(check_sljit_emit_icall(compiler, type, arg_types, src, srcw)); in sljit_emit_icall()
3469 FAIL_IF(load_word(compiler, tmp1, src, srcw, 0 /* 64-bit */)); in sljit_emit_icall()
3475 …if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options))… in sljit_emit_icall()
3476 FAIL_IF(push_inst(compiler, lgr(tmp1, gpr(src)))); in sljit_emit_icall()
3481 FAIL_IF(emit_stack_frame_release(compiler, r14)); in sljit_emit_icall()
3485 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_icall()
3486 return sljit_emit_ijump(compiler, type, src, srcw); in sljit_emit_icall()
3489 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
3493 sljit_u8 mask = get_cc(compiler, type); in sljit_emit_op_flags()
3496 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
3504 compiler->status_flags_state = op & SLJIT_SET_Z; in sljit_emit_op_flags()
3508 FAIL_IF(load_word(compiler, dst_r, dst, dstw, op & SLJIT_32)); in sljit_emit_op_flags()
3525 FAIL_IF(push_load_imm_inst(compiler, loc_r, 0)); in sljit_emit_op_flags()
3526 FAIL_IF(push_inst(compiler, in sljit_emit_op_flags()
3538 FAIL_IF(push_inst(compiler, in sljit_emit_op_flags()
3542 FAIL_IF(push_inst(compiler, in sljit_emit_op_flags()
3546 FAIL_IF(push_inst(compiler, in sljit_emit_op_flags()
3554 return store_word(compiler, dst_r, dst, dstw, (op & SLJIT_32)); in sljit_emit_op_flags()
3559 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
3563 sljit_ins mask = get_cc(compiler, type & ~SLJIT_32); in sljit_emit_cmov()
3568 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
3575 …return push_inst(compiler, ins | R36A(gpr(dst_reg)) | (mask << 32) | (sljit_ins)(srcw & 0xffff) <<… in sljit_emit_cmov()
3579 FAIL_IF(push_load_imm_inst(compiler, tmp0, srcw)); in sljit_emit_cmov()
3586 return push_inst(compiler, ins | (mask << 12) | R4A(gpr(dst_reg)) | R0A(src_r)); in sljit_emit_cmov()
3589 return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw); in sljit_emit_cmov()
3592 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem() argument
3599 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
3602 return sljit_emit_mem_unaligned(compiler, type, reg, mem, memw); in sljit_emit_mem()
3615 …FAIL_IF(push_inst(compiler, 0xeb000000000d /* sllg */ | R36A(tmp1) | R32A(offs) | ((sljit_ins)memw… in sljit_emit_mem()
3618 FAIL_IF(push_inst(compiler, 0xb9f80000 | R12A(tmp1) | R4A(base) | R0A(offs))); in sljit_emit_mem()
3625 FAIL_IF(push_load_imm_inst(compiler, tmp1, memw)); in sljit_emit_mem()
3637 …return push_inst(compiler, ins | R36A(reg1) | R32A(reg2) | R28A(base) | disp_s20((sljit_s32)memw)); in sljit_emit_mem()
3643 FAIL_IF(push_inst(compiler, ins | R36A(reg2) | disp_s20((sljit_s32)memw + SSIZE_OF(sw)))); in sljit_emit_mem()
3644 return push_inst(compiler, ins | R36A(reg1) | disp_s20((sljit_s32)memw)); in sljit_emit_mem()
3647 FAIL_IF(push_inst(compiler, ins | R36A(reg1) | disp_s20((sljit_s32)memw))); in sljit_emit_mem()
3648 return push_inst(compiler, ins | R36A(reg2) | disp_s20((sljit_s32)memw + SSIZE_OF(sw))); in sljit_emit_mem()
3665 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
3671 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
3673 const_ = (struct sljit_s390x_const*)ensure_abuf(compiler, in sljit_emit_const()
3676 set_const((struct sljit_const*)const_, compiler); in sljit_emit_const()
3681 PTR_FAIL_IF(push_inst(compiler, sljit_ins_const | lgrl(dst_r, 0))); in sljit_emit_const()
3683 PTR_FAIL_IF(push_inst(compiler, sljit_ins_const | larl(tmp1, 0))); in sljit_emit_const()
3684 PTR_FAIL_IF(push_inst(compiler, lg(dst_r, 0, r0, tmp1))); in sljit_emit_const()
3688 PTR_FAIL_IF(store_word(compiler, dst_r, dst, dstw, 0 /* always 64-bit */)); in sljit_emit_const()
3711 struct sljit_compiler *compiler, in sljit_emit_put_label() argument
3718 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
3721 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
3723 set_put_label(put_label, compiler, 0); in sljit_emit_put_label()
3728 PTR_FAIL_IF(push_inst(compiler, lgrl(dst_r, 0))); in sljit_emit_put_label()
3730 PTR_FAIL_IF(push_inst(compiler, larl(tmp1, 0))); in sljit_emit_put_label()
3731 PTR_FAIL_IF(push_inst(compiler, lg(dst_r, 0, r0, tmp1))); in sljit_emit_put_label()
3735 PTR_FAIL_IF(store_word(compiler, dst_r, dst, dstw, 0)); in sljit_emit_put_label()