Lines Matching refs:imm
396 static SLJIT_INLINE sljit_s32 emit_imm(struct sljit_compiler *compiler, sljit_s32 reg, sljit_sw imm) in emit_imm() argument
398 FAIL_IF(push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | (imm & 0xfff))); in emit_imm()
399 return push_inst(compiler, MOVT | RD(reg) | ((imm >> 12) & 0xf0000) | ((imm >> 16) & 0xfff)); in emit_imm()
556 static sljit_uw get_imm(sljit_uw imm);
1008 #define TYPE2_TRANSFER_IMM(imm) \ argument
1009 (((imm) & 0xf) | (((imm) & 0xf0) << 4) | (1 << 22))
1267 static sljit_uw get_imm(sljit_uw imm) in get_imm() argument
1271 if (imm <= 0xff) in get_imm()
1272 return SRC2_IMM | imm; in get_imm()
1274 if (!(imm & 0xff000000)) { in get_imm()
1275 imm <<= 8; in get_imm()
1279 imm = (imm << 24) | (imm >> 8); in get_imm()
1283 if (!(imm & 0xff000000)) { in get_imm()
1284 imm <<= 8; in get_imm()
1288 if (!(imm & 0xf0000000)) { in get_imm()
1289 imm <<= 4; in get_imm()
1293 if (!(imm & 0xc0000000)) { in get_imm()
1294 imm <<= 2; in get_imm()
1298 if (!(imm & 0x00ffffff)) in get_imm()
1299 return SRC2_IMM | (imm >> 24) | (rol << 8); in get_imm()
1305 static sljit_s32 generate_int(struct sljit_compiler *compiler, sljit_s32 reg, sljit_uw imm, sljit_s… in generate_int() argument
1316 if (!(imm & mask)) { in generate_int()
1318 imm = (imm << rol) | (imm >> (32 - rol)); in generate_int()
1327 imm = (imm << 8) | (imm >> 24); in generate_int()
1331 if (!(imm & mask)) { in generate_int()
1333 imm = (imm << rol) | (imm >> (32 - rol)); in generate_int()
1348 SLJIT_ASSERT(!(imm & 0xff)); in generate_int()
1350 if (!(imm & 0xff000000)) { in generate_int()
1351 imm1 = SRC2_IMM | ((imm >> 16) & 0xff) | (((rol + 4) & 0xf) << 8); in generate_int()
1352 imm2 = SRC2_IMM | ((imm >> 8) & 0xff) | (((rol + 8) & 0xf) << 8); in generate_int()
1354 else if (imm & 0xc0000000) { in generate_int()
1355 imm1 = SRC2_IMM | ((imm >> 24) & 0xff) | ((rol & 0xf) << 8); in generate_int()
1356 imm <<= 8; in generate_int()
1359 if (!(imm & 0xff000000)) { in generate_int()
1360 imm <<= 8; in generate_int()
1364 if (!(imm & 0xf0000000)) { in generate_int()
1365 imm <<= 4; in generate_int()
1369 if (!(imm & 0xc0000000)) { in generate_int()
1370 imm <<= 2; in generate_int()
1374 if (!(imm & 0x00ffffff)) in generate_int()
1375 imm2 = SRC2_IMM | (imm >> 24) | ((rol & 0xf) << 8); in generate_int()
1380 if (!(imm & 0xf0000000)) { in generate_int()
1381 imm <<= 4; in generate_int()
1385 if (!(imm & 0xc0000000)) { in generate_int()
1386 imm <<= 2; in generate_int()
1390 imm1 = SRC2_IMM | ((imm >> 24) & 0xff) | ((rol & 0xf) << 8); in generate_int()
1391 imm <<= 8; in generate_int()
1394 if (!(imm & 0xf0000000)) { in generate_int()
1395 imm <<= 4; in generate_int()
1399 if (!(imm & 0xc0000000)) { in generate_int()
1400 imm <<= 2; in generate_int()
1404 if (!(imm & 0x00ffffff)) in generate_int()
1405 imm2 = SRC2_IMM | (imm >> 24) | ((rol & 0xf) << 8); in generate_int()
1416 static sljit_s32 load_immediate(struct sljit_compiler *compiler, sljit_s32 reg, sljit_uw imm) in load_immediate() argument
1421 if (!(imm & ~0xffff)) in load_immediate()
1422 return push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | (imm & 0xfff)); in load_immediate()
1426 tmp = get_imm(imm); in load_immediate()
1430 tmp = get_imm(~imm); in load_immediate()
1436 FAIL_IF(generate_int(compiler, reg, imm, 1)); in load_immediate()
1437 FAIL_IF(generate_int(compiler, reg, ~imm, 0)); in load_immediate()
1440 …ush_inst_with_literal(compiler, EMIT_DATA_TRANSFER(WORD_SIZE | LOAD_DATA, 1, reg, TMP_PC, 0), imm); in load_immediate()
1442 FAIL_IF(push_inst(compiler, MOVW | RD(reg) | ((imm << 4) & 0xf0000) | (imm & 0xfff))); in load_immediate()
1443 if (imm <= 0xffff) in load_immediate()
1445 return push_inst(compiler, MOVT | RD(reg) | ((imm >> 12) & 0xf0000) | ((imm >> 16) & 0xfff)); in load_immediate()
1452 sljit_uw imm, offset_reg; in emit_op_mem() local
1491 imm = get_imm(argw & ~0xfff); in emit_op_mem()
1492 if (imm) { in emit_op_mem()
1493 FAIL_IF(push_inst(compiler, ADD | RD(tmp_reg) | RN(arg) | imm)); in emit_op_mem()
1499 imm = get_imm(-argw & ~0xfff); in emit_op_mem()
1500 if (imm) { in emit_op_mem()
1501 FAIL_IF(push_inst(compiler, SUB | RD(tmp_reg) | RN(arg) | imm)); in emit_op_mem()
1515 imm = get_imm(argw & ~0xff); in emit_op_mem()
1516 if (imm) { in emit_op_mem()
1517 FAIL_IF(push_inst(compiler, ADD | RD(tmp_reg) | RN(arg) | imm)); in emit_op_mem()
1523 imm = get_imm(-argw & ~0xff); in emit_op_mem()
1524 if (imm) { in emit_op_mem()
1525 FAIL_IF(push_inst(compiler, SUB | RD(tmp_reg) | RN(arg) | imm)); in emit_op_mem()
1929 sljit_uw imm; in emit_fop_mem() local
1948 imm = get_imm(argw & ~0x3fc); in emit_fop_mem()
1949 if (imm) { in emit_fop_mem()
1950 FAIL_IF(push_inst(compiler, ADD | RD(TMP_REG2) | RN(arg & REG_MASK) | imm)); in emit_fop_mem()
1953 imm = get_imm(-argw & ~0x3fc); in emit_fop_mem()
1954 if (imm) { in emit_fop_mem()
1956 FAIL_IF(push_inst(compiler, SUB | RD(TMP_REG2) | RN(arg & REG_MASK) | imm)); in emit_fop_mem()