Lines Matching refs:imm

292 		s32 imm = insn[i].imm;  in bpf_jit_build_body()  local
345 imm = -imm; in bpf_jit_build_body()
348 if (IMM_HA(imm) & 0xffff) in bpf_jit_build_body()
349 EMIT(PPC_RAW_ADDIS(dst_reg, dst_reg, IMM_HA(imm))); in bpf_jit_build_body()
350 if (IMM_L(imm)) in bpf_jit_build_body()
351 EMIT(PPC_RAW_ADDI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
354 imm = -imm; in bpf_jit_build_body()
357 if (!imm) in bpf_jit_build_body()
360 if (imm >= -32768 && imm < 32768) { in bpf_jit_build_body()
361 EMIT(PPC_RAW_ADDIC(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
363 PPC_LI32(_R0, imm); in bpf_jit_build_body()
366 if (imm >= 0 || (BPF_OP(code) == BPF_SUB && imm == 0x80000000)) in bpf_jit_build_body()
384 if (imm >= -32768 && imm < 32768) { in bpf_jit_build_body()
385 EMIT(PPC_RAW_MULI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
387 PPC_LI32(_R0, imm); in bpf_jit_build_body()
392 if (!imm) { in bpf_jit_build_body()
397 if (imm == 1) in bpf_jit_build_body()
399 if (imm == -1) { in bpf_jit_build_body()
405 PPC_LI32(tmp_reg, imm); in bpf_jit_build_body()
407 if (imm < 0) in bpf_jit_build_body()
426 if (!imm) in bpf_jit_build_body()
428 if (imm == 1) in bpf_jit_build_body()
431 PPC_LI32(_R0, imm); in bpf_jit_build_body()
435 if (!imm) in bpf_jit_build_body()
438 if (!is_power_of_2((u32)imm)) { in bpf_jit_build_body()
440 PPC_LI32(tmp_reg, imm); in bpf_jit_build_body()
446 if (imm == 1) in bpf_jit_build_body()
449 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 32 - ilog2((u32)imm), 31)); in bpf_jit_build_body()
453 if (!imm) in bpf_jit_build_body()
455 if (imm < 0) in bpf_jit_build_body()
456 imm = -imm; in bpf_jit_build_body()
457 if (!is_power_of_2(imm)) in bpf_jit_build_body()
459 if (imm == 1) in bpf_jit_build_body()
462 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 32 - ilog2(imm), 31)); in bpf_jit_build_body()
466 if (!imm) in bpf_jit_build_body()
468 if (!is_power_of_2(abs(imm))) in bpf_jit_build_body()
471 if (imm < 0) { in bpf_jit_build_body()
474 imm = -imm; in bpf_jit_build_body()
476 if (imm == 1) in bpf_jit_build_body()
478 imm = ilog2(imm); in bpf_jit_build_body()
479 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 32 - imm, imm, 31)); in bpf_jit_build_body()
480 EMIT(PPC_RAW_RLWIMI(dst_reg, dst_reg_h, 32 - imm, 0, imm - 1)); in bpf_jit_build_body()
481 EMIT(PPC_RAW_SRAWI(dst_reg_h, dst_reg_h, imm)); in bpf_jit_build_body()
502 if (imm >= 0) in bpf_jit_build_body()
506 if (!IMM_H(imm)) { in bpf_jit_build_body()
507 EMIT(PPC_RAW_ANDI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
508 } else if (!IMM_L(imm)) { in bpf_jit_build_body()
509 EMIT(PPC_RAW_ANDIS(dst_reg, dst_reg, IMM_H(imm))); in bpf_jit_build_body()
510 } else if (imm == (((1 << fls(imm)) - 1) ^ ((1 << (ffs(i) - 1)) - 1))) { in bpf_jit_build_body()
512 32 - fls(imm), 32 - ffs(imm))); in bpf_jit_build_body()
514 PPC_LI32(_R0, imm); in bpf_jit_build_body()
527 if (imm < 0) in bpf_jit_build_body()
531 if (IMM_L(imm)) in bpf_jit_build_body()
532 EMIT(PPC_RAW_ORI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
533 if (IMM_H(imm)) in bpf_jit_build_body()
534 EMIT(PPC_RAW_ORIS(dst_reg, dst_reg, IMM_H(imm))); in bpf_jit_build_body()
552 if (imm < 0) in bpf_jit_build_body()
556 if (IMM_L(imm)) in bpf_jit_build_body()
557 EMIT(PPC_RAW_XORI(dst_reg, dst_reg, IMM_L(imm))); in bpf_jit_build_body()
558 if (IMM_H(imm)) in bpf_jit_build_body()
559 EMIT(PPC_RAW_XORIS(dst_reg, dst_reg, IMM_H(imm))); in bpf_jit_build_body()
576 if (!imm) in bpf_jit_build_body()
578 EMIT(PPC_RAW_SLWI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
581 if (imm < 0) in bpf_jit_build_body()
583 if (!imm) in bpf_jit_build_body()
585 if (imm < 32) { in bpf_jit_build_body()
586 EMIT(PPC_RAW_RLWINM(dst_reg_h, dst_reg_h, imm, 0, 31 - imm)); in bpf_jit_build_body()
587 EMIT(PPC_RAW_RLWIMI(dst_reg_h, dst_reg, imm, 32 - imm, 31)); in bpf_jit_build_body()
588 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, imm, 0, 31 - imm)); in bpf_jit_build_body()
591 if (imm < 64) in bpf_jit_build_body()
592 EMIT(PPC_RAW_RLWINM(dst_reg_h, dst_reg, imm, 0, 31 - imm)); in bpf_jit_build_body()
612 if (!imm) in bpf_jit_build_body()
614 EMIT(PPC_RAW_SRWI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
617 if (imm < 0) in bpf_jit_build_body()
619 if (!imm) in bpf_jit_build_body()
621 if (imm < 32) { in bpf_jit_build_body()
622 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 32 - imm, imm, 31)); in bpf_jit_build_body()
623 EMIT(PPC_RAW_RLWIMI(dst_reg, dst_reg_h, 32 - imm, 0, imm - 1)); in bpf_jit_build_body()
624 EMIT(PPC_RAW_RLWINM(dst_reg_h, dst_reg_h, 32 - imm, imm, 31)); in bpf_jit_build_body()
627 if (imm < 64) in bpf_jit_build_body()
628 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg_h, 64 - imm, imm - 32, 31)); in bpf_jit_build_body()
650 if (!imm) in bpf_jit_build_body()
652 EMIT(PPC_RAW_SRAWI(dst_reg, dst_reg, imm)); in bpf_jit_build_body()
655 if (imm < 0) in bpf_jit_build_body()
657 if (!imm) in bpf_jit_build_body()
659 if (imm < 32) { in bpf_jit_build_body()
660 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 32 - imm, imm, 31)); in bpf_jit_build_body()
661 EMIT(PPC_RAW_RLWIMI(dst_reg, dst_reg_h, 32 - imm, 0, imm - 1)); in bpf_jit_build_body()
662 EMIT(PPC_RAW_SRAWI(dst_reg_h, dst_reg_h, imm)); in bpf_jit_build_body()
665 if (imm < 64) in bpf_jit_build_body()
666 EMIT(PPC_RAW_SRAWI(dst_reg, dst_reg_h, imm - 32)); in bpf_jit_build_body()
683 if (imm == 1) in bpf_jit_build_body()
689 PPC_LI32(dst_reg, imm); in bpf_jit_build_body()
690 PPC_EX32(dst_reg_h, imm); in bpf_jit_build_body()
693 PPC_LI32(dst_reg, imm); in bpf_jit_build_body()
700 switch (imm) { in bpf_jit_build_body()
736 switch (imm) { in bpf_jit_build_body()
761 PPC_LI32(_R0, imm); in bpf_jit_build_body()
768 PPC_LI32(_R0, imm); in bpf_jit_build_body()
775 PPC_LI32(_R0, imm); in bpf_jit_build_body()
783 PPC_LI32(_R0, imm); in bpf_jit_build_body()
785 PPC_EX32(_R0, imm); in bpf_jit_build_body()
806 if (imm & BPF_FETCH) in bpf_jit_build_body()
809 switch (imm) { in bpf_jit_build_body()
853 if (imm & BPF_FETCH) { in bpf_jit_build_body()
960 PPC_LI32(dst_reg_h, (u32)insn[i + 1].imm); in bpf_jit_build_body()
961 PPC_LI32(dst_reg, (u32)insn[i].imm); in bpf_jit_build_body()
1132 if (imm >= 0 && imm < 32768) { in bpf_jit_build_body()
1135 EMIT(PPC_RAW_CMPLWI(dst_reg, imm)); in bpf_jit_build_body()
1138 PPC_EX32(_R0, imm); in bpf_jit_build_body()
1140 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1151 if (imm >= 0 && imm < 65536) { in bpf_jit_build_body()
1152 EMIT(PPC_RAW_CMPLWI(dst_reg, imm)); in bpf_jit_build_body()
1154 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1163 if (imm >= 0 && imm < 65536) { in bpf_jit_build_body()
1164 EMIT(PPC_RAW_CMPWI(dst_reg_h, imm < 0 ? -1 : 0)); in bpf_jit_build_body()
1166 EMIT(PPC_RAW_CMPLWI(dst_reg, imm)); in bpf_jit_build_body()
1169 EMIT(PPC_RAW_CMPWI(dst_reg_h, imm < 0 ? -1 : 0)); in bpf_jit_build_body()
1170 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1183 if (imm >= -32768 && imm < 32768) { in bpf_jit_build_body()
1184 EMIT(PPC_RAW_CMPWI(dst_reg, imm)); in bpf_jit_build_body()
1187 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1193 if (imm >= 0 && imm < 32768) { in bpf_jit_build_body()
1195 EMIT(PPC_RAW_ANDI(_R0, dst_reg, imm)); in bpf_jit_build_body()
1197 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1198 if (imm < 0) { in bpf_jit_build_body()
1207 if (imm >= 0 && imm < 32768) { in bpf_jit_build_body()
1209 EMIT(PPC_RAW_ANDI(_R0, dst_reg, imm)); in bpf_jit_build_body()
1211 PPC_LI32(_R0, imm); in bpf_jit_build_body()
1239 !insn_is_zext(&insn[i + 1]) && !(BPF_OP(code) == BPF_END && imm == 64)) in bpf_jit_build_body()