Lines Matching refs:imm
288 s32 imm = insn[i].imm; in bpf_jit_build_body() local
339 imm = -imm; in bpf_jit_build_body()
342 if (IMM_HA(imm) & 0xffff) in bpf_jit_build_body()
343 EMIT(PPC_RAW_ADDIS(dst_reg, dst_reg, IMM_HA(imm))); in bpf_jit_build_body()
344 if (IMM_L(imm)) in bpf_jit_build_body()
345 EMIT(PPC_RAW_ADDI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
348 imm = -imm; in bpf_jit_build_body()
351 if (!imm) in bpf_jit_build_body()
354 if (imm >= -32768 && imm < 32768) { in bpf_jit_build_body()
355 EMIT(PPC_RAW_ADDIC(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
357 PPC_LI32(_R0, imm); in bpf_jit_build_body()
360 if (imm >= 0 || (BPF_OP(code) == BPF_SUB && imm == 0x80000000)) in bpf_jit_build_body()
378 if (imm >= -32768 && imm < 32768) { in bpf_jit_build_body()
379 EMIT(PPC_RAW_MULI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
381 PPC_LI32(_R0, imm); in bpf_jit_build_body()
386 if (!imm) { in bpf_jit_build_body()
391 if (imm == 1) in bpf_jit_build_body()
393 if (imm == -1) { in bpf_jit_build_body()
399 PPC_LI32(tmp_reg, imm); in bpf_jit_build_body()
401 if (imm < 0) in bpf_jit_build_body()
420 if (!imm) in bpf_jit_build_body()
422 if (imm == 1) in bpf_jit_build_body()
425 PPC_LI32(_R0, imm); in bpf_jit_build_body()
429 if (!imm) in bpf_jit_build_body()
432 if (!is_power_of_2((u32)imm)) { in bpf_jit_build_body()
434 PPC_LI32(tmp_reg, imm); in bpf_jit_build_body()
440 if (imm == 1) in bpf_jit_build_body()
443 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 32 - ilog2((u32)imm), 31)); in bpf_jit_build_body()
447 if (!imm) in bpf_jit_build_body()
449 if (imm < 0) in bpf_jit_build_body()
450 imm = -imm; in bpf_jit_build_body()
451 if (!is_power_of_2(imm)) in bpf_jit_build_body()
453 if (imm == 1) in bpf_jit_build_body()
456 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 32 - ilog2(imm), 31)); in bpf_jit_build_body()
460 if (!imm) in bpf_jit_build_body()
462 if (!is_power_of_2(abs(imm))) in bpf_jit_build_body()
465 if (imm < 0) { in bpf_jit_build_body()
468 imm = -imm; in bpf_jit_build_body()
470 if (imm == 1) in bpf_jit_build_body()
472 imm = ilog2(imm); in bpf_jit_build_body()
473 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 32 - imm, imm, 31)); in bpf_jit_build_body()
474 EMIT(PPC_RAW_RLWIMI(dst_reg, dst_reg_h, 32 - imm, 0, imm - 1)); in bpf_jit_build_body()
475 EMIT(PPC_RAW_SRAWI(dst_reg_h, dst_reg_h, imm)); in bpf_jit_build_body()
496 if (imm >= 0) in bpf_jit_build_body()
500 if (!IMM_H(imm)) { in bpf_jit_build_body()
501 EMIT(PPC_RAW_ANDI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
502 } else if (!IMM_L(imm)) { in bpf_jit_build_body()
503 EMIT(PPC_RAW_ANDIS(dst_reg, dst_reg, IMM_H(imm))); in bpf_jit_build_body()
504 } else if (imm == (((1 << fls(imm)) - 1) ^ ((1 << (ffs(i) - 1)) - 1))) { in bpf_jit_build_body()
506 32 - fls(imm), 32 - ffs(imm))); in bpf_jit_build_body()
508 PPC_LI32(_R0, imm); in bpf_jit_build_body()
521 if (imm < 0) in bpf_jit_build_body()
525 if (IMM_L(imm)) in bpf_jit_build_body()
526 EMIT(PPC_RAW_ORI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
527 if (IMM_H(imm)) in bpf_jit_build_body()
528 EMIT(PPC_RAW_ORIS(dst_reg, dst_reg, IMM_H(imm))); in bpf_jit_build_body()
546 if (imm < 0) in bpf_jit_build_body()
550 if (IMM_L(imm)) in bpf_jit_build_body()
551 EMIT(PPC_RAW_XORI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
552 if (IMM_H(imm)) in bpf_jit_build_body()
553 EMIT(PPC_RAW_XORIS(dst_reg, dst_reg, IMM_H(imm))); in bpf_jit_build_body()
570 if (!imm) in bpf_jit_build_body()
572 EMIT(PPC_RAW_SLWI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
575 if (imm < 0) in bpf_jit_build_body()
577 if (!imm) in bpf_jit_build_body()
579 if (imm < 32) { in bpf_jit_build_body()
580 EMIT(PPC_RAW_RLWINM(dst_reg_h, dst_reg_h, imm, 0, 31 - imm)); in bpf_jit_build_body()
581 EMIT(PPC_RAW_RLWIMI(dst_reg_h, dst_reg, imm, 32 - imm, 31)); in bpf_jit_build_body()
582 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, imm, 0, 31 - imm)); in bpf_jit_build_body()
585 if (imm < 64) in bpf_jit_build_body()
586 EMIT(PPC_RAW_RLWINM(dst_reg_h, dst_reg, imm, 0, 31 - imm)); in bpf_jit_build_body()
606 if (!imm) in bpf_jit_build_body()
608 EMIT(PPC_RAW_SRWI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
611 if (imm < 0) in bpf_jit_build_body()
613 if (!imm) in bpf_jit_build_body()
615 if (imm < 32) { in bpf_jit_build_body()
616 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 32 - imm, imm, 31)); in bpf_jit_build_body()
617 EMIT(PPC_RAW_RLWIMI(dst_reg, dst_reg_h, 32 - imm, 0, imm - 1)); in bpf_jit_build_body()
618 EMIT(PPC_RAW_RLWINM(dst_reg_h, dst_reg_h, 32 - imm, imm, 31)); in bpf_jit_build_body()
621 if (imm < 64) in bpf_jit_build_body()
622 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg_h, 64 - imm, imm - 32, 31)); in bpf_jit_build_body()
644 if (!imm) in bpf_jit_build_body()
646 EMIT(PPC_RAW_SRAWI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
649 if (imm < 0) in bpf_jit_build_body()
651 if (!imm) in bpf_jit_build_body()
653 if (imm < 32) { in bpf_jit_build_body()
654 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 32 - imm, imm, 31)); in bpf_jit_build_body()
655 EMIT(PPC_RAW_RLWIMI(dst_reg, dst_reg_h, 32 - imm, 0, imm - 1)); in bpf_jit_build_body()
656 EMIT(PPC_RAW_SRAWI(dst_reg_h, dst_reg_h, imm)); in bpf_jit_build_body()
659 if (imm < 64) in bpf_jit_build_body()
660 EMIT(PPC_RAW_SRAWI(dst_reg, dst_reg_h, imm - 32)); in bpf_jit_build_body()
677 if (imm == 1) in bpf_jit_build_body()
683 PPC_LI32(dst_reg, imm); in bpf_jit_build_body()
684 PPC_EX32(dst_reg_h, imm); in bpf_jit_build_body()
687 PPC_LI32(dst_reg, imm); in bpf_jit_build_body()
694 switch (imm) { in bpf_jit_build_body()
730 switch (imm) { in bpf_jit_build_body()
755 PPC_LI32(_R0, imm); in bpf_jit_build_body()
762 PPC_LI32(_R0, imm); in bpf_jit_build_body()
769 PPC_LI32(_R0, imm); in bpf_jit_build_body()
777 PPC_LI32(_R0, imm); in bpf_jit_build_body()
779 PPC_EX32(_R0, imm); in bpf_jit_build_body()
787 if (imm != BPF_ADD) { in bpf_jit_build_body()
839 PPC_LI32(dst_reg_h, (u32)insn[i + 1].imm); in bpf_jit_build_body()
840 PPC_LI32(dst_reg, (u32)insn[i].imm); in bpf_jit_build_body()
1003 if (imm >= 0 && imm < 32768) { in bpf_jit_build_body()
1006 EMIT(PPC_RAW_CMPLWI(dst_reg, imm)); in bpf_jit_build_body()
1009 PPC_EX32(_R0, imm); in bpf_jit_build_body()
1011 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1022 if (imm >= 0 && imm < 65536) { in bpf_jit_build_body()
1023 EMIT(PPC_RAW_CMPLWI(dst_reg, imm)); in bpf_jit_build_body()
1025 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1034 if (imm >= 0 && imm < 65536) { in bpf_jit_build_body()
1035 EMIT(PPC_RAW_CMPWI(dst_reg_h, imm < 0 ? -1 : 0)); in bpf_jit_build_body()
1037 EMIT(PPC_RAW_CMPLWI(dst_reg, imm)); in bpf_jit_build_body()
1040 EMIT(PPC_RAW_CMPWI(dst_reg_h, imm < 0 ? -1 : 0)); in bpf_jit_build_body()
1041 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1054 if (imm >= -32768 && imm < 32768) { in bpf_jit_build_body()
1055 EMIT(PPC_RAW_CMPWI(dst_reg, imm)); in bpf_jit_build_body()
1058 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1064 if (imm >= 0 && imm < 32768) { in bpf_jit_build_body()
1066 EMIT(PPC_RAW_ANDI(_R0, dst_reg, imm)); in bpf_jit_build_body()
1068 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1069 if (imm < 0) { in bpf_jit_build_body()
1078 if (imm >= 0 && imm < 32768) { in bpf_jit_build_body()
1080 EMIT(PPC_RAW_ANDI(_R0, dst_reg, imm)); in bpf_jit_build_body()
1082 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1110 !insn_is_zext(&insn[i + 1]) && !(BPF_OP(code) == BPF_END && imm == 64)) in bpf_jit_build_body()