30 #define ENABLE_STATIC_FACILITY_DETECTION 1
32 #define ENABLE_STATIC_FACILITY_DETECTION 0
34 #define ENABLE_DYNAMIC_FACILITY_DETECTION 1
38 return "s390x" SLJIT_CPUINFO;
44 #define TMP_REG1 (SLJIT_NUMBER_OF_REGISTERS + 2)
45 #define TMP_REG2 (SLJIT_NUMBER_OF_REGISTERS + 3)
48 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 0, 1, 14
97 #define IS_GPR_REG(reg) ((reg > 0) && (reg) <= SLJIT_SP)
102 #define TMP_FREG1 (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1)
105 0, 0, 2, 4, 6, 3, 5, 7, 15, 14, 13, 12, 11, 10, 9, 8, 1
109 #define R4A(r) ((r) << 4)
110 #define R8A(r) ((r) << 8)
111 #define R12A(r) ((r) << 12)
112 #define R16A(r) ((r) << 16)
113 #define R20A(r) ((r) << 20)
114 #define R28A(r) ((r) << 28)
115 #define R32A(r) ((r) << 32)
116 #define R36A(r) ((r) << 36)
118 #define R0(r) ((sljit_ins)reg_map[r])
120 #define F0(r) ((sljit_ins)freg_map[r])
121 #define F4(r) (R4A((sljit_ins)freg_map[r]))
122 #define F12(r) (R12A((sljit_ins)freg_map[r]))
123 #define F20(r) (R20A((sljit_ins)freg_map[r]))
124 #define F28(r) (R28A((sljit_ins)freg_map[r]))
125 #define F32(r) (R32A((sljit_ins)freg_map[r]))
126 #define F36(r) (R36A((sljit_ins)freg_map[r]))
149 if (ins & 0xffff00000000L)
152 if (ins & 0xffffffff0000L)
158 #define SLJIT_ADD_SUB_NO_COMPARE(status_flags_state) \
159 (((status_flags_state) & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB)) \
160 && !((status_flags_state) & SLJIT_CURRENT_FLAGS_COMPARE))
172 sljit_s32 type = GET_FLAG_TYPE(compiler->status_flags_state);
188 sljit_s32 type = GET_FLAG_TYPE(compiler->status_flags_state);
190 return (cc1 | cc2 | cc3);
198 return (cc1 | cc2 | cc3);
206 return (cc0 | cc2 | cc3);
216 return (cc0 | cc1 | cc2);
244 return (cc0 | cc2 | cc3);
260 return (cc0 | cc1 | cc2);
275 return (cc0 | cc1 | cc3);
291 #define STORE_FACILITY_LIST_EXTENDED_FACILITY 7
292 #define FAST_LONG_DISPLACEMENT_FACILITY 19
293 #define EXTENDED_IMMEDIATE_FACILITY 21
294 #define GENERAL_INSTRUCTION_EXTENSION_FACILITY 34
295 #define DISTINCT_OPERAND_FACILITY 45
296 #define HIGH_WORD_FACILITY 45
297 #define POPULATION_COUNT_FACILITY 45
298 #define LOAD_STORE_ON_CONDITION_1_FACILITY 45
299 #define MISCELLANEOUS_INSTRUCTION_EXTENSIONS_1_FACILITY 49
300 #define LOAD_STORE_ON_CONDITION_2_FACILITY 53
301 #define MISCELLANEOUS_INSTRUCTION_EXTENSIONS_2_FACILITY 58
302 #define VECTOR_FACILITY 129
303 #define VECTOR_ENHANCEMENTS_1_FACILITY 135
310 #if ENABLE_STATIC_FACILITY_DETECTION
313 return (__ARCH__ >= 6 );
316 return (__ARCH__ >= 7 );
318 return (__ARCH__ >= 8 );
320 return (__ARCH__ >= 9 );
322 return (__ARCH__ >= 10 );
325 return (__ARCH__ >= 11 );
328 return (__ARCH__ >= 12 );
338 static unsigned long hwcap = 0;
340 hwcap = getauxval(AT_HWCAP);
358 #if ENABLE_DYNAMIC_FACILITY_DETECTION
362 size_t size =
sizeof(cpu_features);
364 const sljit_uw bit_index = ((1UL << 63) >> (x & 63));
371 __asm__ __volatile__ (
375 :
"d" ((
size / 8) - 1),
"a" (&cpu_features)
376 :
"r0",
"cc",
"memory"
380 return (cpu_features.bits[word_index] & bit_index) != 0;
386 #define HAVE_FACILITY(name, bit) \
387 static SLJIT_INLINE int name() \
389 static int have = -1; \
391 if (have_facility_static(bit)) \
393 else if (SLJIT_UNLIKELY(have < 0)) \
394 have = have_facility_dynamic(bit) ? 1 : 0; \
407 #define is_u12(d) (0 <= (d) && (d) <= 0x00000fffL)
408 #define is_u32(d) (0 <= (d) && (d) <= 0xffffffffL)
410 #define CHECK_SIGNED(v, bitlen) \
411 ((v) >= -(1 << ((bitlen) - 1)) && (v) < (1 << ((bitlen) - 1)))
413 #define is_s8(d) CHECK_SIGNED((d), 8)
414 #define is_s16(d) CHECK_SIGNED((d), 16)
415 #define is_s20(d) CHECK_SIGNED((d), 20)
416 #define is_s32(d) ((d) == (sljit_s32)(d))
424 dh = (d >> 12) & 0xff;
426 return (dh | dl) << 8;
430 #define SLJIT_S390X_INSTRUCTION(op, ...) \
431 static SLJIT_INLINE sljit_ins op(__VA_ARGS__)
434 #define SLJIT_S390X_RR(name, pattern) \
435 SLJIT_S390X_INSTRUCTION(name, sljit_gpr dst, sljit_gpr src) \
437 return (pattern) | ((dst & 0xf) << 4) | (src & 0xf); \
464 #undef SLJIT_S390X_RR
467 #define SLJIT_S390X_RRE(name, pattern) \
468 SLJIT_S390X_INSTRUCTION(name, sljit_gpr dst, sljit_gpr src) \
470 return (pattern) | R4A(dst) | R0A(src); \
524 #undef SLJIT_S390X_RRE
527 #define SLJIT_S390X_RIA(name, pattern, imm_type) \
528 SLJIT_S390X_INSTRUCTION(name, sljit_gpr reg, imm_type imm) \
530 return (pattern) | R20A(reg) | (imm & 0xffff); \
553 #undef SLJIT_S390X_RIA
556 #define SLJIT_S390X_RILA(name, pattern, imm_type) \
557 SLJIT_S390X_INSTRUCTION(name, sljit_gpr reg, imm_type imm) \
559 SLJIT_ASSERT(have_eimm()); \
560 return (pattern) | R36A(reg) | ((sljit_ins)imm & 0xffffffffu); \
589 #undef SLJIT_S390X_RILA
592 #define SLJIT_S390X_RXA(name, pattern) \
593 SLJIT_S390X_INSTRUCTION(name, sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b) \
595 SLJIT_ASSERT((d & 0xfff) == d); \
597 return (pattern) | R20A(r) | R16A(x) | R12A(b) | (sljit_ins)(d & 0xfff); \
621 #undef SLJIT_S390X_RXA
624 #define SLJIT_S390X_RXYA(name, pattern, cond) \
625 SLJIT_S390X_INSTRUCTION(name, sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b) \
627 SLJIT_ASSERT(cond); \
629 return (pattern) | R36A(r) | R32A(x) | R28A(b) | disp_s20(d); \
670 #undef SLJIT_S390X_RXYA
673 #define SLJIT_S390X_RSYA(name, pattern, cond) \
674 SLJIT_S390X_INSTRUCTION(name, sljit_gpr dst, sljit_gpr src, sljit_s32 d, sljit_gpr b) \
676 SLJIT_ASSERT(cond); \
678 return (pattern) | R36A(dst) | R32A(src) | R28A(b) | disp_s20(d); \
693 #undef SLJIT_S390X_RSYA
696 #define SLJIT_S390X_RIEF(name, pattern) \
697 SLJIT_S390X_INSTRUCTION(name, sljit_gpr dst, sljit_gpr src, sljit_u8 start, sljit_u8 end, sljit_u8 rot) \
699 sljit_ins i3, i4, i5; \
701 SLJIT_ASSERT(have_genext()); \
702 i3 = (sljit_ins)start << 24; \
703 i4 = (sljit_ins)end << 16; \
704 i5 = (sljit_ins)rot << 8; \
706 return (pattern) | R36A(dst & 0xf) | R32A(src & 0xf) | i3 | i4 | i5; \
728 #undef SLJIT_S390X_RIEF
731 #define SLJIT_S390X_RRFC(name, pattern) \
732 SLJIT_S390X_INSTRUCTION(name, sljit_gpr dst, sljit_gpr src, sljit_uw mask) \
736 SLJIT_ASSERT(have_lscond1()); \
737 m3 = (sljit_ins)(mask & 0xf) << 12; \
739 return (pattern) | m3 | R4A(dst) | R0A(src); \
746 #undef SLJIT_S390X_RRFC
749 #define SLJIT_S390X_RIEG(name, pattern) \
750 SLJIT_S390X_INSTRUCTION(name, sljit_gpr reg, sljit_sw imm, sljit_uw mask) \
754 SLJIT_ASSERT(have_lscond2()); \
755 m3 = (sljit_ins)(mask & 0xf) << 32; \
756 i2 = (sljit_ins)(imm & 0xffffL) << 16; \
758 return (pattern) | R36A(reg) | m3 | i2; \
765 #undef SLJIT_S390X_RIEG
767 #define SLJIT_S390X_RILB(name, pattern, cond) \
768 SLJIT_S390X_INSTRUCTION(name, sljit_gpr reg, sljit_sw ri) \
770 SLJIT_ASSERT(cond); \
772 return (pattern) | R36A(reg) | (sljit_ins)(ri & 0xffffffff); \
784 #undef SLJIT_S390X_RILB
788 return 0x07f0 | target;
795 return 0xa7040000L | m1 | ri2;
802 return 0xc00400000000L | m1 | ri2;
808 return 0xb9830000 |
R8A(dst) |
R0A(src);
814 return 0xb2220000 |
R4A(dst);
820 return 0x0400 |
R4A(dst);
826 return risbhg(dst, src, start, 0x8 | end, rot);
829 #undef SLJIT_S390X_INSTRUCTION
896 base =
gpr(mem & REG_MASK);
898 if (mem & OFFS_REG_MASK) {
899 index =
gpr(OFFS_REG(mem));
929 base =
gpr(mem & REG_MASK);
931 if (mem & OFFS_REG_MASK) {
932 index =
gpr(OFFS_REG(mem));
952 #define EVAL(op, r, addr) op(r, addr.offset, addr.index, addr.base)
953 #define WHEN(cond, r, i1, i2, addr) \
954 (cond) ? EVAL(i1, r, addr) : EVAL(i2, r, addr)
965 if (is_32bit && ((mem & OFFS_REG_MASK) ||
is_u12(memw) || !
is_s20(memw))) {
1012 ins = is_32bit ? 0xe30000000016 : 0xe30000000004 ;
1040 src_r =
gpr(src & REG_MASK);
1053 if (FAST_IS_REG(dst)) {
1058 else if (dst == src2) {
1067 if (FAST_IS_REG(src2))
1074 if (needs_move != 2)
1077 dst_r =
gpr(dst & REG_MASK);
1088 if (FAST_IS_REG(src1))
1105 if (FAST_IS_REG(src1))
1110 if (FAST_IS_REG(src2))
1132 if (FAST_IS_REG(dst)) {
1143 return push_inst(compiler, ins |
R36A(dst_r) | (src2w & 0xffffffff));
1144 return push_inst(compiler, ins |
R20A(dst_r) | (src2w & 0xffff));
1155 if (!FAST_IS_REG(src1))
1158 src_r =
gpr(src1 & REG_MASK);
1180 if (FAST_IS_REG(dst)) {
1185 else if (dst == (src2 & REG_MASK) || (dst == OFFS_REG(src2))) {
1197 if (src2 & OFFS_REG_MASK) {
1208 if (src2 & REG_MASK)
1222 if (needs_move != 2)
1237 if (dst & OFFS_REG_MASK) {
1240 if ((dstw & 0x3) == 0)
1248 else if (!
is_s20(dstw)) {
1257 dst_r =
gpr(dst & REG_MASK);
1285 ins20 = forms->
op_y;
1289 ins20 = forms->
op_g;
1292 if (ins12 && ins20) {
1295 || ((src1 & OFFS_REG_MASK) ? (src1w & 0x3) == 0 :
is_s20(src1w)))) {
1296 if ((src2 & OFFS_REG_MASK) ||
is_u12(src2w) || !
is_s20(src2w))
1297 return emit_rx(compiler, ins12, dst, src1, src1w, src2, src2w,
RX_A);
1299 return emit_rx(compiler, ins20, dst, src1, src1w, src2, src2w,
RXY_A);
1303 if ((src1 & OFFS_REG_MASK) ||
is_u12(src1w) || !
is_s20(src1w))
1304 return emit_rx(compiler, ins12, dst, src2, src2w, src1, src1w,
RX_A);
1306 return emit_rx(compiler, ins20, dst, src2, src2w, src1, src1w,
RXY_A);
1309 else if (ins12 || ins20) {
1322 || ((src1 & OFFS_REG_MASK) ? (src1w & 0x3) == 0 : (rx_type ==
RX_A ?
is_u12(src1w) :
is_s20(src1w)))))
1323 return emit_rx(compiler, ins, dst, src1, src1w, src2, src2w, rx_type);
1326 return emit_rx(compiler, ins, dst, src2, src2w, src1, src1w, rx_type);
1332 ins_k = forms->
op_rk;
1341 if (ins && FAST_IS_REG(dst)) {
1343 return emit_rr(compiler, ins, dst, src1, src1w, src2, src2w);
1346 return emit_rr(compiler, ins, dst, src2, src2w, src1, src1w);
1350 return emit_rr(compiler, ins, dst, src1, src1w, src2, src2w);
1352 return emit_rrf(compiler, ins_k, dst, src1, src1w, src2, src2w);
1368 ins20 = forms->
op_y;
1372 ins20 = forms->
op_g;
1375 if (ins12 && ins20) {
1376 if ((src2 & OFFS_REG_MASK) ||
is_u12(src2w) || !
is_s20(src2w))
1377 return emit_rx(compiler, ins12, dst, src1, src1w, src2, src2w,
RX_A);
1379 return emit_rx(compiler, ins20, dst, src1, src1w, src2, src2w,
RXY_A);
1382 return emit_rx(compiler, ins12, dst, src1, src1w, src2, src2w,
RX_A);
1384 return emit_rx(compiler, ins20, dst, src1, src1w, src2, src2w,
RXY_A);
1389 if (ins == 0 || (FAST_IS_REG(dst) && dst == src1))
1392 return emit_rrf(compiler, ins, dst, src1, src1w, src2, src2w);
1405 SLJIT_NEXT_DEFINE_TYPES;
1416 CHECK_PTR(check_sljit_generate_code(compiler));
1417 reverse_buf(compiler);
1419 jump = compiler->
jumps;
1420 while (jump !=
NULL) {
1427 pool_size +=
sizeof(*pool);
1428 if (!(jump->
flags & JUMP_MOV_ADDR))
1434 const_ = compiler->
consts;
1436 pool_size +=
sizeof(*pool);
1437 const_ = const_->
next;
1442 pad_size = ((ins_size + 7UL) & ~7UL) - ins_size;
1446 code = (
sljit_u16*)allocate_executable_memory(ins_size + pad_size + pool_size, options, exec_allocator_data, &executable_offset);
1461 jump = compiler->
jumps;
1462 const_ = compiler->
consts;
1463 SLJIT_NEXT_INIT_TYPES();
1464 SLJIT_GET_NEXT_MIN();
1468 buf_end = buf_ptr + (
buf->used_size >> 3);
1472 if (next_min_addr == half_count) {
1477 if (next_min_addr == next_label_size) {
1478 label->u.addr = (
sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
1480 next_label_size = SLJIT_GET_NEXT_SIZE(
label);
1483 if (next_min_addr == next_jump_addr) {
1485 source = (
sljit_sw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
1503 source = (
sljit_sw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
1517 arg = (ins >> 36) & 0xf;
1518 if (((ins >> 32) & 0xf) == 4) {
1533 next_jump_addr = SLJIT_GET_NEXT_ADDRESS(jump);
1534 }
else if (next_min_addr == next_const_addr) {
1553 next_const_addr = SLJIT_GET_NEXT_ADDRESS(
const_);
1556 SLJIT_GET_NEXT_MIN();
1559 if (ins & 0xffff00000000L) {
1564 if (ins & 0xffffffff0000L) {
1571 }
while (buf_ptr < buf_end);
1576 if (next_label_size == half_count) {
1577 label->u.addr = (
sljit_uw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
1587 jump = compiler->
jumps;
1588 while (jump !=
NULL) {
1596 offset -= (
sljit_sw)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
1616 code_ptr = (
sljit_u16 *)SLJIT_ADD_EXEC_OFFSET(code_ptr, executable_offset);
1625 switch (feature_type) {
1627 #ifdef SLJIT_IS_FPU_AVAILABLE
1666 sljit_s32 saved_arg_count = SLJIT_KEPT_SAVEDS_COUNT(options);
1670 CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size));
1671 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size);
1677 if (saveds + scratches >= SLJIT_NUMBER_OF_REGISTERS) {
1678 if (saved_arg_count == 0) {
1683 offset += (8 - saved_arg_count) * SSIZE_OF(
sw);
1694 if (saved_arg_count == 0) {
1700 offset += (saveds + 1) * SSIZE_OF(
sw);
1702 }
else if (saveds > saved_arg_count) {
1703 if (saveds == saved_arg_count + 1) {
1708 offset += (saveds - saved_arg_count) * SSIZE_OF(
sw);
1713 if (saved_arg_count > 0) {
1729 local_size = (local_size + SLJIT_S390X_DEFAULT_STACK_FRAME_SIZE + 0xf) & ~0xf;
1741 saved_arg_count = 0;
1743 while (arg_types > 0) {
1763 CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size));
1764 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size);
1766 compiler->
local_size = (local_size + SLJIT_S390X_DEFAULT_STACK_FRAME_SIZE + 0xf) & ~0xf;
1780 else if (
is_s20(local_size))
1786 if (saveds + scratches >= SLJIT_NUMBER_OF_REGISTERS) {
1787 if (kept_saveds_count == 0) {
1792 offset += (8 - kept_saveds_count) * SSIZE_OF(
sw);
1803 if (kept_saveds_count == 0) {
1805 if (last_reg ==
r14)
1808 }
else if (saveds == 1 && last_reg ==
r13) {
1813 offset += (saveds + 1) * SSIZE_OF(
sw);
1815 }
else if (saveds > kept_saveds_count) {
1816 if (saveds == kept_saveds_count + 1) {
1821 offset += (saveds - kept_saveds_count) * SSIZE_OF(
sw);
1826 if (kept_saveds_count > 0) {
1827 if (last_reg ==
r14)
1849 CHECK(check_sljit_emit_return_void(compiler));
1859 CHECK(check_sljit_emit_return_to(compiler, src, srcw));
1862 ADJUST_LOCAL_OFFSET(src, srcw);
1874 SLJIT_SKIP_CHECKS(compiler);
1888 CHECK(check_sljit_emit_op0(compiler, op));
1890 op = GET_OPCODE(op) | (op &
SLJIT_32);
1992 if (!is_ctz && dst_r !=
tmp0)
2027 ins = 0xe3000000003f ;
2029 ins = (op &
SLJIT_32) ? 0xe3000000003e : 0xe3000000002f ;
2040 ins = 0xe3000000001f ;
2042 ins = (op &
SLJIT_32) ? 0xe3000000001e : 0xe3000000000f ;
2060 ins = (op &
SLJIT_32) ? 0xb91f0000 : 0xb90f0000 ;
2076 ins = (opcode ==
SLJIT_REV_U16) ? 0xeb000000000c : 0xeb000000000a ;
2081 #define WHEN2(cond, i1, i2) (cond) ? LEVAL(i1) : LEVAL(i2)
2094 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw));
2095 ADJUST_LOCAL_OFFSET(dst, dstw);
2096 ADJUST_LOCAL_OFFSET(src, srcw);
2100 if (FAST_IS_REG(dst) && FAST_IS_REG(src)) {
2103 switch (opcode | (op &
SLJIT_32)) {
2106 ins =
llcr(dst_r, src_r);
2109 ins =
lbr(dst_r, src_r);
2112 ins =
llhr(dst_r, src_r);
2115 ins =
lhr(dst_r, src_r);
2120 ins =
lr(dst_r, src_r);
2124 ins =
llgcr(dst_r, src_r);
2127 ins =
lgbr(dst_r, src_r);
2130 ins =
llghr(dst_r, src_r);
2133 ins =
lghr(dst_r, src_r);
2136 ins =
llgfr(dst_r, src_r);
2139 ins =
lgfr(dst_r, src_r);
2145 ins =
lgr(dst_r, src_r);
2156 if (FAST_IS_REG(dst) && src ==
SLJIT_IMM) {
2182 #define LEVAL(i) EVAL(i, reg, mem)
2183 if (FAST_IS_REG(dst) && (src &
SLJIT_MEM)) {
2188 switch (opcode | (op &
SLJIT_32)) {
2311 dst_r = FAST_IS_REG(dst) ?
gpr(dst) :
tmp0;
2312 src_r = FAST_IS_REG(src) ?
gpr(src) :
tmp0;
2314 compiler->status_flags_state = op & (VARIABLE_FLAG_MASK |
SLJIT_SET_Z);
2345 switch (GET_OPCODE(op)) {
2388 if (!sets_zero_overflow &&
is_s8(src2w) && (src1 &
SLJIT_MEM) && (dst == src1 && dstw == src1w)) {
2390 ins = (
op &
SLJIT_32) ? 0xeb000000006a : 0xeb000000007a ;
2392 ins = (
op &
SLJIT_32) ? 0xeb000000006e : 0xeb000000007e ;
2393 return emit_siy(compiler, ins, dst, dstw, src2w);
2398 ins = (
op &
SLJIT_32) ? 0xec00000000d8 : 0xec00000000d9 ;
2400 ins = (
op &
SLJIT_32) ? 0xec00000000da : 0xec00000000db ;
2405 if (!sets_overflow) {
2407 ins = (
op &
SLJIT_32) ? 0xc20b00000000 : 0xc20a00000000 ;
2417 ins = (
op &
SLJIT_32) ? 0xc20900000000 : 0xc20800000000 ;
2427 if (sets_zero_overflow)
2473 if (compare_signed || ((
op & VARIABLE_FLAG_MASK) == 0 &&
is_s32(src2w))) {
2475 ins = (
op &
SLJIT_32) ? 0xc20d00000000 : 0xc20c00000000 ;
2476 return emit_ri(compiler, ins, src1, src1, src1w, src2w,
RIL_A);
2481 ins = (
op &
SLJIT_32) ? 0xc20f00000000 : 0xc20e00000000 ;
2482 return emit_ri(compiler, ins, src1, src1, src1w, src2w,
RIL_A);
2490 ins = compare_signed ? 0x59000000 : 0x55000000 ;
2491 return emit_rx(compiler, ins, src1, src1, src1w, src2, src2w,
RX_A);
2495 ins = (
op &
SLJIT_32) ? 0xe30000000059 : 0xe30000000020 ;
2497 ins = (
op &
SLJIT_32) ? 0xe30000000055 : 0xe30000000021 ;
2498 return emit_rx(compiler, ins, src1, src1, src1w, src2, src2w,
RXY_A);
2502 ins = (
op &
SLJIT_32) ? 0x1900 : 0xb9200000 ;
2504 ins = (
op &
SLJIT_32) ? 0x1500 : 0xb9210000 ;
2505 return emit_rr(compiler, ins, src1, src1, src1w, src2, src2w);
2508 if (src1 ==
SLJIT_IMM && src1w == 0 && (flag_type == 0 || sets_signed)) {
2509 ins = (
op &
SLJIT_32) ? 0x1300 : 0xb9030000 ;
2517 if (sets_signed || neg_src2w != 0 || (
op & (
SLJIT_SET_Z | VARIABLE_FLAG_MASK)) == 0) {
2518 if (!sets_zero_overflow &&
is_s8(neg_src2w) && (src1 &
SLJIT_MEM) && (dst == src1 && dstw == src1w)) {
2520 ins = (
op &
SLJIT_32) ? 0xeb000000006a : 0xeb000000007a ;
2522 ins = (
op &
SLJIT_32) ? 0xeb000000006e : 0xeb000000007e ;
2523 return emit_siy(compiler, ins, dst, dstw, neg_src2w);
2528 ins = (
op &
SLJIT_32) ? 0xec00000000d8 : 0xec00000000d9 ;
2530 ins = (
op &
SLJIT_32) ? 0xec00000000da : 0xec00000000db ;
2538 ins = (
op &
SLJIT_32) ? 0xc20500000000 : 0xc20400000000 ;
2548 ins = (
op &
SLJIT_32) ? 0xc20900000000 : 0xc20800000000 ;
2607 if (HAS_FLAGS(
op)) {
2624 ins = (
op &
SLJIT_32) ? 0xa70c0000 : 0xa70d0000 ;
2625 return emit_ri(compiler, ins, dst, src1, src1w, src2w,
RI_A);
2629 ins = (
op &
SLJIT_32) ? 0xc20100000000 : 0xc20000000000 ;
2630 return emit_ri(compiler, ins, dst, src1, src1w, src2w,
RIL_A);
2647 dst_r =
gpr(dst & REG_MASK);
2658 return push_inst(compiler, 0xc00b00000000 |
R36A(dst_r) | (imm & 0xffffffff));
2663 return push_inst(compiler, 0xc00d00000000 |
R36A(dst_r) | (imm & 0xffffffff));
2667 if ((imm & 0x00000000ffffffffull) == 0)
2668 return push_inst(compiler, 0xc00c00000000 |
R36A(dst_r) | (imm >> 32));
2669 if ((imm & 0xffffffff00000000ull) == 0)
2670 return push_inst(compiler, 0xc00d00000000 |
R36A(dst_r) | (imm & 0xffffffff));
2673 if ((imm & 0xffff000000000000ull) != 0)
2675 if ((imm & 0x0000ffff00000000ull) != 0)
2677 if ((imm & 0x00000000ffff0000ull) != 0)
2679 if ((imm & 0x000000000000ffffull) != 0 || imm == 0)
2680 return push_inst(compiler, 0xa50b0000 |
R20A(dst_r) | (imm & 0xffff));
2684 if ((imm & 0xffffffff00000000ull) != 0)
2686 if ((imm & 0x00000000ffffffffull) != 0 || imm == 0)
2687 return push_inst(compiler, 0xc00700000000 |
R36A(dst_r) | (imm & 0xffffffff));
2734 imm &= 0xffffffffull;
2736 if ((imm & 0x000000000000ffffull) != 0 || imm == 0)
2738 if ((imm & 0x00000000ffff0000ull) != 0)
2740 if ((imm & 0x0000ffff00000000ull) != 0)
2742 if ((imm & 0xffff000000000000ull) != 0)
2748 if (FAST_IS_REG(src1))
2749 src_r =
gpr(src1 & REG_MASK);
2753 if ((imm & 0x000000000000ffffull) != 0 || imm == 0)
2755 if ((imm & 0x00000000ffff0000ull) != 0)
2756 return push_inst(compiler, 0xa7000000 |
R20A(src_r) | (imm >> 16));
2757 if ((imm & 0x0000ffff00000000ull) != 0)
2758 return push_inst(compiler, 0xa7030000 |
R20A(src_r) | (imm >> 32));
2759 return push_inst(compiler, 0xa7020000 |
R20A(src_r) | (imm >> 48));
2788 if (FAST_IS_REG(src1))
2794 if (FAST_IS_REG(src2))
2802 if (base_r !=
tmp1) {
2822 ins = (
op &
SLJIT_32) ? 0xeb00000000df : 0xeb000000000d ;
2824 ins = (
op &
SLJIT_32) ? 0xeb00000000de : 0xeb000000000c ;
2826 ins = (
op &
SLJIT_32) ? 0xeb00000000dc : 0xeb000000000a ;
2848 if (FAST_IS_REG(src1))
2854 if (FAST_IS_REG(src2))
2864 ins = (
op &
SLJIT_32) ? 0x1300 : 0xb9030000 ;
2874 ins = (
op &
SLJIT_32) ? 0xeb000000001d : 0xeb000000001c ;
2904 CHECK(check_sljit_emit_op2(compiler,
op, 0, dst, dstw, src1, src1w, src2, src2w));
2905 ADJUST_LOCAL_OFFSET(dst, dstw);
2906 ADJUST_LOCAL_OFFSET(src1, src1w);
2907 ADJUST_LOCAL_OFFSET(src2, src2w);
2910 compiler->status_flags_state =
op & (VARIABLE_FLAG_MASK |
SLJIT_SET_Z);
2922 switch (GET_OPCODE(
op)) {
2975 CHECK(check_sljit_emit_op2(compiler,
op, 1, 0, 0, src1, src1w, src2, src2w));
2977 SLJIT_SKIP_CHECKS(compiler);
2987 CHECK(check_sljit_emit_op2r(compiler,
op, dst_reg, src1, src1w, src2, src2w));
2989 switch (GET_OPCODE(
op)) {
2991 SLJIT_SKIP_CHECKS(compiler);
3014 CHECK(check_sljit_emit_shift_into(compiler,
op, dst_reg, src1_reg, src2_reg, src3, src3w));
3018 if (src1_reg == src2_reg) {
3019 SLJIT_SKIP_CHECKS(compiler);
3023 ADJUST_LOCAL_OFFSET(src3, src3w);
3026 src3w &= bit_length - 1;
3032 if (dst_r == src1_r) {
3033 ins = is_right ? 0x88000000 : 0x89000000 ;
3036 ins = is_right ? 0xeb00000000de : 0xeb00000000df ;
3040 ins = is_right ? 0xeb000000000c : 0xeb000000000d ;
3044 ins = 0xec0000000055 ;
3047 src3w = bit_length - src3w;
3058 if (dst_r == src3_r) {
3067 if (src3_r !=
tmp1) {
3074 if (dst_r == src1_r) {
3075 ins = is_right ? 0x88000000 : 0x89000000 ;
3078 ins = is_right ? 0xeb00000000de : 0xeb00000000df ;
3082 if (src3_r !=
tmp1) {
3088 ins = is_right ? 0xeb00000000df : 0xeb00000000de ;
3094 ins = is_right ? 0xeb000000000c : 0xeb000000000d ;
3097 ins = is_right ? 0xeb000000000d : 0xeb000000000c ;
3124 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw));
3125 ADJUST_LOCAL_OFFSET(src, srcw);
3129 src_r = FAST_IS_REG(src) ?
gpr(src) :
tmp1;
3156 CHECK(check_sljit_emit_op_dst(compiler, op, dst, dstw));
3157 ADJUST_LOCAL_OFFSET(dst, dstw);
3161 if (FAST_IS_REG(dst))
3165 dst_r = FAST_IS_REG(dst) ?
gpr(dst) :
tmp0;
3173 return store_word(compiler, dst_r, dst, dstw, 0);
3180 CHECK_REG_INDEX(check_sljit_get_register_index(
type, reg));
3197 CHECK(check_sljit_emit_op_custom(compiler, instruction,
size));
3207 #define FLOAT_LOAD 0
3208 #define FLOAT_STORE 1
3219 if ((mem & OFFS_REG_MASK) ||
is_u12(memw) || !
is_s20(memw)) {
3223 ins = (op &
SLJIT_32) ? 0x70000000 : 0x60000000 ;
3225 ins = (op &
SLJIT_32) ? 0x78000000 : 0x68000000 ;
3233 ins = (op &
SLJIT_32) ? 0xed0000000066 : 0xed0000000067 ;
3235 ins = (op &
SLJIT_32) ? 0xed0000000064 : 0xed0000000065 ;
3267 ins = (op &
SLJIT_32) ? 0xb3a85000 : 0xb3a95000 ;
3269 ins = (op &
SLJIT_32) ? 0xb3985000 : 0xb3995000 ;
3312 ins = (op &
SLJIT_32) ? 0xb3a40000 : 0xb3a50000 ;
3314 ins = (op &
SLJIT_32) ? 0xb3940000 : 0xb3950000 ;
3329 ins = (op &
SLJIT_32) ? 0xb3a00000 : 0xb3a10000 ;
3331 ins = (op &
SLJIT_32) ? 0xb3900000 : 0xb3910000 ;
3348 ins_r = 0xb3090000 ;
3349 ins = 0xed0000000009 ;
3351 ins_r = 0xb3190000 ;
3352 ins = 0xed0000000019 ;
3355 return emit_float(compiler, ins_r, ins, src1, src2, src2w);
3367 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw);
3369 dst_r = FAST_IS_REG(dst) ? dst :
TMP_FREG1;
3379 switch (GET_OPCODE(op)) {
3381 if (FAST_IS_REG(dst)) {
3385 ins = (op &
SLJIT_32) ? 0x3800 : 0x2800 ;
3394 ins = (op &
SLJIT_32) ? 0xb3030000 : 0xb3130000 ;
3398 ins = (op &
SLJIT_32) ? 0xb3000000 : 0xb3100000 ;
3411 #define FLOAT_MOV(op, dst_r, src_r) \
3412 (((op & SLJIT_32) ? 0x3800 : 0x2800 ) | F4(dst_r) | F0(src_r))
3423 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w));
3424 ADJUST_LOCAL_OFFSET(dst, dstw);
3425 ADJUST_LOCAL_OFFSET(src1, src1w);
3426 ADJUST_LOCAL_OFFSET(src2, src2w);
3429 if (FAST_IS_REG(dst)) {
3454 switch (GET_OPCODE(op)) {
3456 ins_r = (op &
SLJIT_32) ? 0xb30a0000 : 0xb31a0000 ;
3457 ins = (op &
SLJIT_32) ? 0xed000000000a : 0xed000000001a ;
3460 ins_r = (op &
SLJIT_32) ? 0xb30b0000 : 0xb31b0000 ;
3461 ins = (op &
SLJIT_32) ? 0xed000000000b : 0xed000000001b ;
3464 ins_r = (op &
SLJIT_32) ? 0xb3170000 : 0xb31c0000 ;
3465 ins = (op &
SLJIT_32) ? 0xed0000000017 : 0xed000000001c ;
3469 ins_r = (op &
SLJIT_32) ? 0xb30d0000 : 0xb31d0000 ;
3470 ins = (op &
SLJIT_32) ? 0xed000000000d : 0xed000000001d ;
3490 CHECK(check_sljit_emit_fop2r(compiler, op, dst_freg, src1, src1w, src2, src2w));
3491 ADJUST_LOCAL_OFFSET(src1, src1w);
3492 ADJUST_LOCAL_OFFSET(src2, src2w);
3500 reg = (dst_freg == src2) ?
TMP_FREG1 : dst_freg;
3505 return push_inst(compiler, 0xb3720000 |
F12(src2) |
F4(dst_freg) |
F0(src1));
3517 CHECK(check_sljit_emit_fset32(compiler, freg,
value));
3534 CHECK(check_sljit_emit_fset64(compiler, freg,
value));
3548 CHECK(check_sljit_emit_fcopy(compiler, op, freg, reg));
3566 return push_inst(compiler, 0xeb000000000c |
R36A(gen_r) |
R32A(gen_r) | (32 << 16));
3578 CHECK_PTR(check_sljit_emit_label(compiler));
3585 set_label(
label, compiler);
3595 CHECK_PTR(check_sljit_emit_jump(compiler,
type));
3618 CHECK_PTR(check_sljit_emit_call(compiler,
type, arg_types));
3625 SLJIT_SKIP_CHECKS(compiler);
3634 CHECK(check_sljit_emit_ijump(compiler,
type, src, srcw));
3641 ADJUST_LOCAL_OFFSET(src, srcw);
3659 CHECK(check_sljit_emit_icall(compiler,
type, arg_types, src, srcw));
3664 ADJUST_LOCAL_OFFSET(src, srcw);
3681 SLJIT_SKIP_CHECKS(compiler);
3694 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw,
type));
3696 switch (GET_OPCODE(op)) {
3719 #define LEVAL(i) i(loc_r, 1, mask)
3732 switch (GET_OPCODE(op)) {
3733 #define LEVAL(i) i(dst_r, loc_r)
3767 CHECK(check_sljit_emit_select(compiler,
type, dst_reg, src1, src1w, src2_reg));
3769 ADJUST_LOCAL_OFFSET(src1, src1w);
3771 if (dst_reg != src2_reg) {
3772 if (src1 == dst_reg) {
3777 if (ADDRESSING_DEPENDS_ON(src1, dst_reg)) {
3790 if (src1 & OFFS_REG_MASK) {
3791 src_r =
gpr(OFFS_REG(src1));
3801 }
else if (!
is_s20(src1w)) {
3804 if (src1 & REG_MASK)
3810 src_r =
gpr(src1 & REG_MASK);
3812 ins = (
type &
SLJIT_32) ? 0xeb00000000f2 : 0xeb00000000e2 ;
3821 ins = (
type &
SLJIT_32) ? 0xec0000000042 : 0xec0000000046 ;
3844 CHECK(check_sljit_emit_fselect(compiler,
type, dst_freg, src1, src1w, src2_freg));
3846 ADJUST_LOCAL_OFFSET(src1, src1w);
3848 if (dst_freg != src2_freg) {
3849 if (dst_freg == src1) {
3859 SLJIT_SKIP_CHECKS(compiler);
3869 SLJIT_SKIP_CHECKS(compiler);
3881 sljit_ins ins, reg1, reg2, base, offs = 0;
3884 CHECK(check_sljit_emit_mem(compiler,
type, reg, mem, memw));
3886 if (!(reg & REG_PAIR_MASK))
3887 return sljit_emit_mem_unaligned(compiler,
type, reg, mem, memw);
3889 ADJUST_LOCAL_OFFSET(mem, memw);
3891 base =
gpr(mem & REG_MASK);
3892 reg1 =
gpr(REG_PAIR_FIRST(reg));
3893 reg2 =
gpr(REG_PAIR_SECOND(reg));
3895 if (mem & OFFS_REG_MASK) {
3897 offs =
gpr(OFFS_REG(mem));
3902 }
else if (!(
type &
SLJIT_MEM_STORE) && (base == reg1 || base == reg2) && (offs == reg1 || offs == reg2)) {
3909 }
else if (memw < -0x80000 || memw > 0x7ffff - ((reg2 == reg1 + 1) ? 0 : SSIZE_OF(
sw))) {
3920 if (offs == 0 && reg2 == (reg1 + 1)) {
3947 CHECK(check_sljit_emit_simd_mov(compiler,
type, freg, srcdst, srcdstw));
3949 ADJUST_LOCAL_OFFSET(srcdst, srcdstw);
3962 ins =
F36(srcdst) |
F32(freg);
3964 ins =
F36(freg) |
F32(srcdst);
3966 return push_inst(compiler, 0xe70000000056 | ins);
3974 else if (alignment == 3)
3991 CHECK(check_sljit_emit_simd_replicate(compiler,
type, freg, src, srcw));
3993 ADJUST_LOCAL_OFFSET(src, srcw);
4012 return push_inst(compiler, 0xe70000000044 |
F36(freg));
4020 switch (elem_size) {
4044 if (sign_ext != 0x10000) {
4045 if (sign_ext == 0 || sign_ext == -1)
4047 | (sign_ext == 0 ? 0 : ((
sljit_ins)0xffff << 16)));
4073 CHECK(check_sljit_emit_simd_lane_mov(compiler,
type, freg, lane_index, srcdst, srcdstw));
4075 ADJUST_LOCAL_OFFSET(srcdst, srcdstw);
4092 if ((srcdst &
SLJIT_MEM) && lane_index == ((1 << (3 - elem_size)) - 1))
4105 switch (elem_size) {
4107 ins |= 0xe70000000000 ;
4110 ins |= 0xe70000000001 ;
4113 ins |= 0xe70000000003 ;
4116 ins |= 0xe70000000002 ;
4131 if (elem_size == 3) {
4132 if (lane_index == 0)
4133 ins =
F32(srcdst) |
F28(freg) | (1 << 12);
4135 ins =
F32(freg) |
F28(srcdst);
4137 return push_inst(compiler, 0xe70000000084 |
F36(freg) | ins);
4145 switch (elem_size) {
4147 ins = 0xe70000000040 ;
4151 ins = 0xe70000000041 ;
4157 ins = 0xe70000000043 ;
4159 srcdstw &= 0xffffffff;
4164 ins = 0xe70000000042 ;
4187 switch (elem_size) {
4210 CHECK(check_sljit_emit_simd_lane_replicate(compiler,
type, freg, src, src_lane_index));
4236 CHECK(check_sljit_emit_simd_extend(compiler,
type, freg, src, srcw));
4238 ADJUST_LOCAL_OFFSET(src, srcw);
4253 switch (elem2_size - elem_size) {
4255 ins |= 0xe70000000002 ;
4258 ins |= 0xe70000000003 ;
4261 ins |= 0xe70000000001 ;
4272 return push_inst(compiler, 0xe700000000c4 |
F36(freg) |
F32(freg) | (2 << 12));
4280 }
while (++elem_size < elem2_size);
4294 CHECK(check_sljit_emit_simd_sign(compiler,
type, freg, dst, dstw));
4296 ADJUST_LOCAL_OFFSET(dst, dstw);
4307 switch (elem_size) {
4329 dst_r = FAST_IS_REG(dst) ?
gpr(dst) :
tmp0;
4331 | (elem_size == 0 ? ((3 << 16) | (1 << 12)) : (7 << 16))));
4347 CHECK(check_sljit_emit_simd_op2(compiler,
type, dst_freg, src1_freg, src2_freg));
4358 switch (SLJIT_SIMD_GET_OPCODE(
type)) {
4360 ins = 0xe70000000068 ;
4363 ins = 0xe7000000006a ;
4366 ins = 0xe7000000006d ;
4381 CHECK(check_sljit_emit_atomic_load(compiler, op, dst_reg, mem_reg));
4383 SLJIT_SKIP_CHECKS(compiler);
4397 CHECK(check_sljit_emit_atomic_store(compiler, op, src_reg, mem_reg, temp_reg));
4399 switch (GET_OPCODE(op)) {
4452 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw,
init_value));
4460 dst_r = FAST_IS_REG(dst) ?
gpr(dst & REG_MASK) :
tmp0;
4497 CHECK_PTR(check_sljit_emit_mov_addr(compiler, dst, dstw));
4498 ADJUST_LOCAL_OFFSET(dst, dstw);
4502 set_mov_addr(jump, compiler, 0);
4504 dst_r = FAST_IS_REG(dst) ?
gpr(dst & REG_MASK) :
tmp0;
#define CHECK_ERROR(name, s)
static const char label[]
if(yy_accept[yy_current_state])
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
#define SLJIT_UNREACHABLE()
unsigned short int sljit_u16
signed short int sljit_s16
#define SLJIT_UNLIKELY(x)
#define SLJIT_API_FUNC_ATTRIBUTE
#define SLJIT_UNUSED_ARG(arg)
#define SLJIT_CACHE_FLUSH(from, to)
#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)
#define PTR_FAIL_IF(expr)
#define PTR_FAIL_WITH_EXEC_IF(ptr)
#define CHECK_ERROR_PTR()
#define SLJIT_UNORDERED_OR_LESS_EQUAL
#define SLJIT_SKIP_FRAMES_BEFORE_FAST_RETURN
#define SLJIT_ARG_TYPE_SCRATCH_REG
#define SLJIT_SIMD_OP2_AND
#define SLJIT_ORDERED_LESS_EQUAL