Lines Matching refs:imm
56 #define IMM3(imm) (imm << 6) argument
57 #define IMM8(imm) (imm) argument
75 #define IMM5(imm) \ argument
76 (COPY_BITS(imm, 2, 12, 3) | ((imm & 0x3) << 6))
77 #define IMM12(imm) \ argument
78 (COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))
209 …JIT_INLINE sljit_s32 emit_imm32_const(struct sljit_compiler *compiler, sljit_s32 dst, sljit_uw imm) in emit_imm32_const() argument
212 COPY_BITS(imm, 12, 16, 4) | COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))); in emit_imm32_const()
214 …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()
462 static sljit_uw get_imm(sljit_uw imm) in get_imm() argument
467 if (imm <= 0xff) in get_imm()
468 return imm; in get_imm()
470 if ((imm & 0xffff) == (imm >> 16)) { in get_imm()
472 if (!(imm & 0xff00)) in get_imm()
473 return (1 << 12) | (imm & 0xff); in get_imm()
474 if (!(imm & 0xff)) in get_imm()
475 return (2 << 12) | ((imm >> 8) & 0xff); in get_imm()
476 if ((imm & 0xff00) == ((imm & 0xff) << 8)) in get_imm()
477 return (3 << 12) | (imm & 0xff); in get_imm()
482 if (!(imm & 0xffff0000)) { in get_imm()
484 imm <<= 16; in get_imm()
486 if (!(imm & 0xff000000)) { in get_imm()
488 imm <<= 8; in get_imm()
490 if (!(imm & 0xf0000000)) { in get_imm()
492 imm <<= 4; in get_imm()
494 if (!(imm & 0xc0000000)) { in get_imm()
496 imm <<= 2; in get_imm()
498 if (!(imm & 0x80000000)) { in get_imm()
500 imm <<= 1; in get_imm()
505 if (imm & 0x00ffffff) in get_imm()
508 …return ((imm >> 24) & 0x7f) | COPY_BITS(counter, 4, 26, 1) | COPY_BITS(counter, 1, 12, 3) | COPY_B… in get_imm()
511 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 dst, sljit_uw imm) in load_immediate() argument
515 if (imm >= 0x10000) { in load_immediate()
516 tmp = get_imm(imm); in load_immediate()
519 tmp = get_imm(~imm); in load_immediate()
526 COPY_BITS(imm, 12, 16, 4) | COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))); in load_immediate()
529 if (imm >= 0x10000) in load_immediate()
531 …COPY_BITS(imm, 12 + 16, 16, 4) | COPY_BITS(imm, 11 + 16, 26, 1) | COPY_BITS(imm, 8 + 16, 12, 3) | … in load_immediate()
547 sljit_uw imm, nimm; in emit_op_imm() local
558 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
567 return load_immediate(compiler, dst, imm); in emit_op_imm()
570 return load_immediate(compiler, dst, ~imm); in emit_op_imm()
575 nimm = -imm; in emit_op_imm()
577 if (imm <= 0x7) in emit_op_imm()
578 return push_inst16(compiler, ADDSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
582 if (imm <= 0xff) in emit_op_imm()
583 return push_inst16(compiler, ADDSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
589 if (imm <= 0xfff) in emit_op_imm()
590 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
594 nimm = get_imm(imm); in emit_op_imm()
597 nimm = get_imm(-imm); in emit_op_imm()
602 imm = get_imm(imm); in emit_op_imm()
603 if (imm != INVALID_IMM) in emit_op_imm()
604 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
609 if (imm == 0 && IS_2_LO_REGS(reg, dst)) in emit_op_imm()
611 imm = get_imm(imm); in emit_op_imm()
612 if (imm != INVALID_IMM) in emit_op_imm()
613 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
617 if (imm <= 0xff && reg_map[reg] <= 7) in emit_op_imm()
618 return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg)); in emit_op_imm()
619 nimm = get_imm(imm); in emit_op_imm()
622 nimm = get_imm(-imm); in emit_op_imm()
626 nimm = -imm; in emit_op_imm()
628 if (imm <= 0x7) in emit_op_imm()
629 return push_inst16(compiler, SUBSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
633 if (imm <= 0xff) in emit_op_imm()
634 return push_inst16(compiler, SUBSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
640 if (imm <= 0xfff) in emit_op_imm()
641 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
645 nimm = get_imm(imm); in emit_op_imm()
648 nimm = get_imm(-imm); in emit_op_imm()
655 imm = get_imm(imm); in emit_op_imm()
656 if (imm != INVALID_IMM) in emit_op_imm()
657 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
660 nimm = get_imm(imm); in emit_op_imm()
663 imm = get_imm(imm); in emit_op_imm()
664 if (imm != INVALID_IMM) in emit_op_imm()
665 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
668 nimm = get_imm(imm); in emit_op_imm()
671 imm = get_imm(imm); in emit_op_imm()
672 if (imm != INVALID_IMM) in emit_op_imm()
673 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
676 imm = get_imm(imm); in emit_op_imm()
677 if (imm != INVALID_IMM) in emit_op_imm()
678 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
685 imm &= 0x1f; in emit_op_imm()
686 if (imm == 0) { in emit_op_imm()
696 return push_inst16(compiler, LSLSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
697 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
700 return push_inst16(compiler, LSRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
701 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
704 return push_inst16(compiler, ASRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
705 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
713 imm = arg2; in emit_op_imm()
715 FAIL_IF(load_immediate(compiler, arg2, imm)); in emit_op_imm()
718 imm = arg1; in emit_op_imm()
720 FAIL_IF(load_immediate(compiler, arg1, imm)); in emit_op_imm()
846 #define OFFSET_CHECK(imm, shift) (!(argw & ~(imm << shift))) argument
1473 sljit_uw imm; in emit_fop_mem() local
1497 imm = get_imm(argw & ~0x3fc); in emit_fop_mem()
1498 if (imm != INVALID_IMM) { in emit_fop_mem()
1499 FAIL_IF(push_inst32(compiler, ADD_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()
1502 imm = get_imm(-argw & ~0x3fc); in emit_fop_mem()
1503 if (imm != INVALID_IMM) { in emit_fop_mem()
1505 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()