Lines Matching refs:imm

57 #define IMM3(imm) (imm << 6)  argument
58 #define IMM8(imm) (imm) argument
76 #define IMM5(imm) \ argument
77 (COPY_BITS(imm, 2, 12, 3) | ((imm & 0x3) << 6))
78 #define IMM12(imm) \ argument
79 (COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))
206 …SLJIT_INLINE sljit_si emit_imm32_const(struct sljit_compiler *compiler, sljit_si dst, sljit_uw imm) in emit_imm32_const() argument
209 COPY_BITS(imm, 12, 16, 4) | COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))); in emit_imm32_const()
211 …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()
428 static sljit_uw get_imm(sljit_uw imm) in get_imm() argument
433 if (imm <= 0xff) in get_imm()
434 return imm; in get_imm()
436 if ((imm & 0xffff) == (imm >> 16)) { in get_imm()
438 if (!(imm & 0xff00)) in get_imm()
439 return (1 << 12) | (imm & 0xff); in get_imm()
440 if (!(imm & 0xff)) in get_imm()
441 return (2 << 12) | ((imm >> 8) & 0xff); in get_imm()
442 if ((imm & 0xff00) == ((imm & 0xff) << 8)) in get_imm()
443 return (3 << 12) | (imm & 0xff); in get_imm()
448 if (!(imm & 0xffff0000)) { in get_imm()
450 imm <<= 16; in get_imm()
452 if (!(imm & 0xff000000)) { in get_imm()
454 imm <<= 8; in get_imm()
456 if (!(imm & 0xf0000000)) { in get_imm()
458 imm <<= 4; in get_imm()
460 if (!(imm & 0xc0000000)) { in get_imm()
462 imm <<= 2; in get_imm()
464 if (!(imm & 0x80000000)) { in get_imm()
466 imm <<= 1; in get_imm()
471 if (imm & 0x00ffffff) in get_imm()
474 …return ((imm >> 24) & 0x7f) | COPY_BITS(counter, 4, 26, 1) | COPY_BITS(counter, 1, 12, 3) | COPY_B… in get_imm()
477 static sljit_si load_immediate(struct sljit_compiler *compiler, sljit_si dst, sljit_uw imm) in load_immediate() argument
481 if (imm >= 0x10000) { in load_immediate()
482 tmp = get_imm(imm); in load_immediate()
485 tmp = get_imm(~imm); in load_immediate()
492 COPY_BITS(imm, 12, 16, 4) | COPY_BITS(imm, 11, 26, 1) | COPY_BITS(imm, 8, 12, 3) | (imm & 0xff))); in load_immediate()
495 if (imm >= 0x10000) in load_immediate()
497 …COPY_BITS(imm, 12 + 16, 16, 4) | COPY_BITS(imm, 11 + 16, 26, 1) | COPY_BITS(imm, 8 + 16, 12, 3) | … in load_immediate()
517 sljit_uw imm, nimm; in emit_op_imm() local
528 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
537 return load_immediate(compiler, dst, imm); in emit_op_imm()
540 return load_immediate(compiler, dst, ~imm); in emit_op_imm()
545 nimm = -imm; in emit_op_imm()
547 if (imm <= 0x7) in emit_op_imm()
548 return push_inst16(compiler, ADDSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
552 if (imm <= 0xff) in emit_op_imm()
553 return push_inst16(compiler, ADDSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
559 if (imm <= 0xfff) in emit_op_imm()
560 return push_inst32(compiler, ADDWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
564 imm = get_imm(imm); in emit_op_imm()
565 if (imm != INVALID_IMM) in emit_op_imm()
566 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
569 imm = get_imm(imm); in emit_op_imm()
570 if (imm != INVALID_IMM) in emit_op_imm()
571 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
575 if (!(flags & KEEP_FLAGS) && imm == 0 && IS_2_LO_REGS(reg, dst)) in emit_op_imm()
577 imm = get_imm(imm); in emit_op_imm()
578 if (imm != INVALID_IMM) in emit_op_imm()
579 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
582 nimm = -imm; in emit_op_imm()
584 if (imm <= 0x7) in emit_op_imm()
585 return push_inst16(compiler, SUBSI3 | IMM3(imm) | RD3(dst) | RN3(reg)); in emit_op_imm()
589 if (imm <= 0xff) in emit_op_imm()
590 return push_inst16(compiler, SUBSI8 | IMM8(imm) | RDN3(dst)); in emit_op_imm()
594 if (imm <= 0xff && (flags & UNUSED_RETURN)) in emit_op_imm()
595 return push_inst16(compiler, CMPI | IMM8(imm) | RDN3(reg)); in emit_op_imm()
598 if (imm <= 0xfff) in emit_op_imm()
599 return push_inst32(compiler, SUBWI | RD4(dst) | RN4(reg) | IMM12(imm)); in emit_op_imm()
603 imm = get_imm(imm); in emit_op_imm()
604 if (imm != INVALID_IMM) in emit_op_imm()
605 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
610 imm = get_imm(imm); in emit_op_imm()
611 if (imm != INVALID_IMM) in emit_op_imm()
612 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
615 nimm = get_imm(imm); in emit_op_imm()
618 imm = get_imm(imm); in emit_op_imm()
619 if (imm != INVALID_IMM) in emit_op_imm()
620 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
623 nimm = get_imm(imm); in emit_op_imm()
626 imm = get_imm(imm); in emit_op_imm()
627 if (imm != INVALID_IMM) in emit_op_imm()
628 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
631 imm = get_imm(imm); in emit_op_imm()
632 if (imm != INVALID_IMM) in emit_op_imm()
633 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
640 imm &= 0x1f; in emit_op_imm()
641 if (imm == 0) { in emit_op_imm()
651 return push_inst16(compiler, LSLSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
652 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
655 return push_inst16(compiler, LSRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
656 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
659 return push_inst16(compiler, ASRSI | RD3(dst) | RN3(reg) | (imm << 6)); in emit_op_imm()
660 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
799 #define OFFSET_CHECK(imm, shift) (!(argw & ~(imm << shift))) argument
1536 sljit_uw imm; in emit_fop_mem() local
1575 imm = get_imm(argw & ~0x3fc); in emit_fop_mem()
1576 if (imm != INVALID_IMM) { in emit_fop_mem()
1577 FAIL_IF(push_inst32(compiler, ADD_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()
1580 imm = get_imm(-argw & ~0x3fc); in emit_fop_mem()
1581 if (imm != INVALID_IMM) { in emit_fop_mem()
1583 FAIL_IF(push_inst32(compiler, SUB_WI | RD4(TMP_REG1) | RN4(arg & REG_MASK) | imm)); in emit_fop_mem()