Lines Matching refs:imm
64 #define IMM3(imm) (imm << 6) argument
65 #define IMM8(imm) (imm) argument
83 #define IMM5(imm) \ argument
84 (COPY_BITS(imm, 2, 12, 3) | ((imm & 0x3) << 6))
85 #define IMM12(imm) \ argument
86 (COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))
222 …JIT_INLINE sljit_s32 emit_imm32_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_uw imm) in emit_imm32_const() argument
225 …| COPY_BITS(imm, 12, 16, 4) | COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))… in emit_imm32_const()
227 …| COPY_BITS(imm, 12 + 16, 16, 4) | COPY_BITS(imm, 11 + 16, 26, 1) | COPY_BITS(imm, 8 + 16, 12, 3) … in emit_imm32_const()
474 static sljit_uw get_imm(sljit_uw imm) in get_imm() argument
479 if (imm <= 0xff) in get_imm()
480 return imm; in get_imm()
482 if ((imm & 0xffff) == (imm >> 16)) { in get_imm()
484 if (!(imm & 0xff00)) in get_imm()
485 return (1 << 12) | (imm & 0xff); in get_imm()
486 if (!(imm & 0xff)) in get_imm()
487 return (2 << 12) | ((imm >> 8) & 0xff); in get_imm()
488 if ((imm & 0xff00) == ((imm & 0xff) << 8)) in get_imm()
489 return (3 << 12) | (imm & 0xff); in get_imm()
494 if (!(imm & 0xffff0000)) { in get_imm()
496 imm <<= 16; in get_imm()
498 if (!(imm & 0xff000000)) { in get_imm()
500 imm <<= 8; in get_imm()
502 if (!(imm & 0xf0000000)) { in get_imm()
504 imm <<= 4; in get_imm()
506 if (!(imm & 0xc0000000)) { in get_imm()
508 imm <<= 2; in get_imm()
510 if (!(imm & 0x80000000)) { in get_imm()
512 imm <<= 1; in get_imm()
517 if (imm & 0x00ffffff) in get_imm()
520 …return ((imm >> 24) & 0x7f) | COPY_BITS(counter, 4, 26, 1) | COPY_BITS(counter, 1, 12, 3) | COPY_B… in get_imm()
523 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst, sljit_uw imm) in load_immediate() argument
529 if (imm >= 0x10000) { in load_immediate()
530 tmp = get_imm(imm); in load_immediate()
533 tmp = get_imm(~imm); in load_immediate()
540 …| COPY_BITS(imm, 12, 16, 4) | COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))… in load_immediate()
543 if (imm >= 0x10000) in load_immediate()
545 …| COPY_BITS(imm, 12 + 16, 16, 4) | COPY_BITS(imm, 11 + 16, 26, 1) | COPY_BITS(imm, 8 + 16, 12, 3) … in load_immediate()
561 sljit_uw imm, nimm; in emit_op_imm() local
572 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
581 return load_immediate(compiler, dst, imm); in emit_op_imm()
584 return load_immediate(compiler, dst, ~imm); in emit_op_imm()
589 nimm = -imm; in emit_op_imm()
591 if (imm <= 0x7) in emit_op_imm()
592 return push_inst16(compiler, ADDSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
596 if (imm <= 0xff) in emit_op_imm()
597 return push_inst16(compiler, ADDSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
603 if (imm <= 0xfff) in emit_op_imm()
604 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
608 nimm = get_imm(imm); in emit_op_imm()
611 nimm = get_imm(-imm); in emit_op_imm()
616 imm = get_imm(imm); in emit_op_imm()
617 if (imm != INVALID_IMM) in emit_op_imm()
618 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
623 if (imm == 0 && IS_2_LO_REGS(reg, dst)) in emit_op_imm()
625 imm = get_imm(imm); in emit_op_imm()
626 if (imm != INVALID_IMM) in emit_op_imm()
627 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
631 if (imm <= 0xff && reg_map[reg] <= 7) in emit_op_imm()
632 return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg)); in emit_op_imm()
633 nimm = get_imm(imm); in emit_op_imm()
636 nimm = get_imm(-imm); in emit_op_imm()
640 nimm = -imm; in emit_op_imm()
642 if (imm <= 0x7) in emit_op_imm()
643 return push_inst16(compiler, SUBSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
647 if (imm <= 0xff) in emit_op_imm()
648 return push_inst16(compiler, SUBSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
654 if (imm <= 0xfff) in emit_op_imm()
655 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
659 nimm = get_imm(imm); in emit_op_imm()
662 nimm = get_imm(-imm); in emit_op_imm()
669 imm = get_imm(imm); in emit_op_imm()
670 if (imm != INVALID_IMM) in emit_op_imm()
671 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
674 nimm = get_imm(imm); in emit_op_imm()
677 imm = get_imm(imm); in emit_op_imm()
678 if (imm != INVALID_IMM) in emit_op_imm()
679 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
682 nimm = get_imm(imm); in emit_op_imm()
685 imm = get_imm(imm); in emit_op_imm()
686 if (imm != INVALID_IMM) in emit_op_imm()
687 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
690 imm = get_imm(imm); in emit_op_imm()
691 if (imm != INVALID_IMM) in emit_op_imm()
692 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
699 imm &= 0x1f; in emit_op_imm()
700 if (imm == 0) { in emit_op_imm()
710 return push_inst16(compiler, LSLSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
711 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
714 return push_inst16(compiler, LSRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
715 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
718 return push_inst16(compiler, ASRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
719 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
727 imm = arg2; in emit_op_imm()
729 FAIL_IF(load_immediate(compiler, arg2, imm)); in emit_op_imm()
732 imm = arg1; in emit_op_imm()
734 FAIL_IF(load_immediate(compiler, arg1, imm)); in emit_op_imm()
850 #define OFFSET_CHECK(imm, shift) (!(argw & ~(imm << shift))) argument
1042 sljit_uw imm; in sljit_emit_enter() local
1068 imm = get_imm(4096); in sljit_emit_enter()
1070 imm = get_imm(local_size & ~0xff); in sljit_emit_enter()
1072 SLJIT_ASSERT(imm != INVALID_IMM); in sljit_emit_enter()
1073 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(SLJIT_SP) | imm)); in sljit_emit_enter()
1096 imm = get_imm(4096); in sljit_emit_enter()
1097 SLJIT_ASSERT(imm != INVALID_IMM); in sljit_emit_enter()
1102 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); in sljit_emit_enter()
1108 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); in sljit_emit_enter()
1120 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); in sljit_emit_enter()
1132 imm = get_imm(local_size & ~0xff); in sljit_emit_enter()
1133 SLJIT_ASSERT(imm != INVALID_IMM); in sljit_emit_enter()
1135 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(TMP_REG1) | imm)); in sljit_emit_enter()
1488 sljit_uw imm; in emit_fop_mem() local
1512 imm = get_imm(argw & ~0x3fc); in emit_fop_mem()
1513 if (imm != INVALID_IMM) { in emit_fop_mem()
1514 FAIL_IF(push_inst32(compiler, ADD_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()
1517 imm = get_imm(-argw & ~0x3fc); in emit_fop_mem()
1518 if (imm != INVALID_IMM) { in emit_fop_mem()
1520 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()