Lines Matching refs:insn
253 let insn = ebpf::get_insn(prog, insn_ptr); in translate_program() localVariable
269 match insn.opc { in translate_program()
282 let ty = match insn.opc { in translate_program()
294 .iconst(self.isa.pointer_type(), insn.imm as u32 as i64); in translate_program()
298 let is_ind = (insn.opc & BPF_IND) != 0; in translate_program()
300 let src_reg = self.insn_src(bcx, &insn); in translate_program()
315 self.set_dst(bcx, &insn, ext); in translate_program()
321 let imm = (((insn.imm as u32) as u64) + ((next_insn.imm as u64) << 32)) as i64; in translate_program()
323 self.set_dst(bcx, &insn, iconst); in translate_program()
328 let ty = match insn.opc { in translate_program()
336 let base = self.insn_src(bcx, &insn); in translate_program()
337 let loaded = self.reg_load(bcx, ty, base, insn.off); in translate_program()
345 self.set_dst(bcx, &insn, ext); in translate_program()
357 let ty = match insn.opc { in translate_program()
364 let is_imm = match insn.opc { in translate_program()
371 self.insn_imm64(bcx, &insn) in translate_program()
373 self.insn_src(bcx, &insn) in translate_program()
382 let base = self.insn_dst(bcx, &insn); in translate_program()
383 self.reg_store(bcx, ty, base, insn.off, narrow); in translate_program()
394 let src = self.insn_dst32(bcx, &insn); in translate_program()
395 let imm = self.insn_imm32(bcx, &insn); in translate_program()
397 self.set_dst32(bcx, &insn, res); in translate_program()
401 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
402 let rhs = self.insn_src32(bcx, &insn); in translate_program()
404 self.set_dst32(bcx, &insn, res); in translate_program()
408 let src = self.insn_dst32(bcx, &insn); in translate_program()
409 let imm = self.insn_imm32(bcx, &insn); in translate_program()
411 self.set_dst32(bcx, &insn, res); in translate_program()
415 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
416 let rhs = self.insn_src32(bcx, &insn); in translate_program()
418 self.set_dst32(bcx, &insn, res); in translate_program()
422 let src = self.insn_dst32(bcx, &insn); in translate_program()
423 let imm = self.insn_imm32(bcx, &insn); in translate_program()
425 self.set_dst32(bcx, &insn, res); in translate_program()
429 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
430 let rhs = self.insn_src32(bcx, &insn); in translate_program()
432 self.set_dst32(bcx, &insn, res); in translate_program()
436 let res = if insn.imm == 0 { in translate_program()
439 let imm = self.insn_imm32(bcx, &insn); in translate_program()
440 let src = self.insn_dst32(bcx, &insn); in translate_program()
443 self.set_dst32(bcx, &insn, res); in translate_program()
450 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
451 let rhs = self.insn_src32(bcx, &insn); in translate_program()
458 self.set_dst32(bcx, &insn, res); in translate_program()
462 let src = self.insn_dst32(bcx, &insn); in translate_program()
463 let imm = self.insn_imm32(bcx, &insn); in translate_program()
465 self.set_dst32(bcx, &insn, res); in translate_program()
469 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
470 let rhs = self.insn_src32(bcx, &insn); in translate_program()
472 self.set_dst32(bcx, &insn, res); in translate_program()
476 let src = self.insn_dst32(bcx, &insn); in translate_program()
477 let imm = self.insn_imm32(bcx, &insn); in translate_program()
479 self.set_dst32(bcx, &insn, res); in translate_program()
483 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
484 let rhs = self.insn_src32(bcx, &insn); in translate_program()
486 self.set_dst32(bcx, &insn, res); in translate_program()
490 let src = self.insn_dst32(bcx, &insn); in translate_program()
491 let imm = self.insn_imm32(bcx, &insn); in translate_program()
493 self.set_dst32(bcx, &insn, res); in translate_program()
497 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
498 let rhs = self.insn_src32(bcx, &insn); in translate_program()
500 self.set_dst32(bcx, &insn, res); in translate_program()
504 let src = self.insn_dst32(bcx, &insn); in translate_program()
505 let imm = self.insn_imm32(bcx, &insn); in translate_program()
507 self.set_dst32(bcx, &insn, res); in translate_program()
511 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
512 let rhs = self.insn_src32(bcx, &insn); in translate_program()
514 self.set_dst32(bcx, &insn, res); in translate_program()
518 let src = self.insn_dst32(bcx, &insn); in translate_program()
521 self.set_dst32(bcx, &insn, res); in translate_program()
526 if insn.imm != 0 { in translate_program()
527 let imm = self.insn_imm32(bcx, &insn); in translate_program()
528 let src = self.insn_dst32(bcx, &insn); in translate_program()
530 self.set_dst32(bcx, &insn, res); in translate_program()
538 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
539 let rhs = self.insn_src32(bcx, &insn); in translate_program()
546 self.set_dst32(bcx, &insn, res); in translate_program()
550 let src = self.insn_dst32(bcx, &insn); in translate_program()
551 let imm = self.insn_imm32(bcx, &insn); in translate_program()
553 self.set_dst32(bcx, &insn, res); in translate_program()
557 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
558 let rhs = self.insn_src32(bcx, &insn); in translate_program()
560 self.set_dst32(bcx, &insn, res); in translate_program()
563 let imm = self.insn_imm32(bcx, &insn); in translate_program()
564 self.set_dst32(bcx, &insn, imm); in translate_program()
568 let src = self.insn_src32(bcx, &insn); in translate_program()
569 self.set_dst32(bcx, &insn, src); in translate_program()
573 let src = self.insn_dst32(bcx, &insn); in translate_program()
574 let imm = self.insn_imm32(bcx, &insn); in translate_program()
576 self.set_dst32(bcx, &insn, res); in translate_program()
580 let lhs = self.insn_dst32(bcx, &insn); in translate_program()
581 let rhs = self.insn_src32(bcx, &insn); in translate_program()
583 self.set_dst32(bcx, &insn, res); in translate_program()
587 let should_swap = match insn.opc { in translate_program()
593 let ty: Type = match insn.imm { in translate_program()
601 let src = self.insn_dst(bcx, &insn); in translate_program()
615 self.set_dst(bcx, &insn, res_wide); in translate_program()
622 let imm = self.insn_imm64(bcx, &insn); in translate_program()
623 let src = self.insn_dst(bcx, &insn); in translate_program()
625 self.set_dst(bcx, &insn, res); in translate_program()
629 let lhs = self.insn_dst(bcx, &insn); in translate_program()
630 let rhs = self.insn_src(bcx, &insn); in translate_program()
632 self.set_dst(bcx, &insn, res); in translate_program()
636 let imm = self.insn_imm64(bcx, &insn); in translate_program()
637 let src = self.insn_dst(bcx, &insn); in translate_program()
639 self.set_dst(bcx, &insn, res); in translate_program()
643 let lhs = self.insn_dst(bcx, &insn); in translate_program()
644 let rhs = self.insn_src(bcx, &insn); in translate_program()
646 self.set_dst(bcx, &insn, res); in translate_program()
650 let imm = self.insn_imm64(bcx, &insn); in translate_program()
651 let src = self.insn_dst(bcx, &insn); in translate_program()
653 self.set_dst(bcx, &insn, res); in translate_program()
657 let lhs = self.insn_dst(bcx, &insn); in translate_program()
658 let rhs = self.insn_src(bcx, &insn); in translate_program()
660 self.set_dst(bcx, &insn, res); in translate_program()
664 let res = if insn.imm == 0 { in translate_program()
667 let imm = self.insn_imm64(bcx, &insn); in translate_program()
668 let src = self.insn_dst(bcx, &insn); in translate_program()
671 self.set_dst(bcx, &insn, res); in translate_program()
679 let lhs = self.insn_dst(bcx, &insn); in translate_program()
680 let rhs = self.insn_src(bcx, &insn); in translate_program()
687 self.set_dst(bcx, &insn, res); in translate_program()
692 if insn.imm != 0 { in translate_program()
693 let imm = self.insn_imm64(bcx, &insn); in translate_program()
694 let src = self.insn_dst(bcx, &insn); in translate_program()
696 self.set_dst(bcx, &insn, res); in translate_program()
705 let lhs = self.insn_dst(bcx, &insn); in translate_program()
706 let rhs = self.insn_src(bcx, &insn); in translate_program()
713 self.set_dst(bcx, &insn, res); in translate_program()
717 let imm = self.insn_imm64(bcx, &insn); in translate_program()
718 let src = self.insn_dst(bcx, &insn); in translate_program()
720 self.set_dst(bcx, &insn, res); in translate_program()
724 let lhs = self.insn_dst(bcx, &insn); in translate_program()
725 let rhs = self.insn_src(bcx, &insn); in translate_program()
727 self.set_dst(bcx, &insn, res); in translate_program()
731 let imm = self.insn_imm64(bcx, &insn); in translate_program()
732 let src = self.insn_dst(bcx, &insn); in translate_program()
734 self.set_dst(bcx, &insn, res); in translate_program()
738 let lhs = self.insn_dst(bcx, &insn); in translate_program()
739 let rhs = self.insn_src(bcx, &insn); in translate_program()
741 self.set_dst(bcx, &insn, res); in translate_program()
745 let imm = self.insn_imm64(bcx, &insn); in translate_program()
746 let src = self.insn_dst(bcx, &insn); in translate_program()
748 self.set_dst(bcx, &insn, res); in translate_program()
752 let lhs = self.insn_dst(bcx, &insn); in translate_program()
753 let rhs = self.insn_src(bcx, &insn); in translate_program()
755 self.set_dst(bcx, &insn, res); in translate_program()
759 let imm = self.insn_imm64(bcx, &insn); in translate_program()
760 let src = self.insn_dst(bcx, &insn); in translate_program()
762 self.set_dst(bcx, &insn, res); in translate_program()
766 let lhs = self.insn_dst(bcx, &insn); in translate_program()
767 let rhs = self.insn_src(bcx, &insn); in translate_program()
769 self.set_dst(bcx, &insn, res); in translate_program()
773 let src = self.insn_dst(bcx, &insn); in translate_program()
775 self.set_dst(bcx, &insn, res); in translate_program()
779 let imm = self.insn_imm64(bcx, &insn); in translate_program()
780 let src = self.insn_dst(bcx, &insn); in translate_program()
782 self.set_dst(bcx, &insn, res); in translate_program()
786 let lhs = self.insn_dst(bcx, &insn); in translate_program()
787 let rhs = self.insn_src(bcx, &insn); in translate_program()
789 self.set_dst(bcx, &insn, res); in translate_program()
793 let imm = self.insn_imm64(bcx, &insn); in translate_program()
794 bcx.def_var(self.registers[insn.dst as usize], imm); in translate_program()
798 let src = self.insn_src(bcx, &insn); in translate_program()
799 bcx.def_var(self.registers[insn.dst as usize], src); in translate_program()
803 let imm = self.insn_imm64(bcx, &insn); in translate_program()
804 let src = self.insn_dst(bcx, &insn); in translate_program()
806 self.set_dst(bcx, &insn, res); in translate_program()
810 let lhs = self.insn_dst(bcx, &insn); in translate_program()
811 let rhs = self.insn_src(bcx, &insn); in translate_program()
813 self.set_dst(bcx, &insn, res); in translate_program()
869 let is_reg = (insn.opc & BPF_X) != 0; in translate_program()
870 let is_32 = (insn.opc & BPF_JMP32) != 0; in translate_program()
871 let intcc = match insn.opc { in translate_program()
888 self.insn_dst32(bcx, &insn) in translate_program()
890 self.insn_dst(bcx, &insn) in translate_program()
893 (true, false) => self.insn_src(bcx, &insn), in translate_program()
894 (true, true) => self.insn_src32(bcx, &insn), in translate_program()
895 (false, false) => self.insn_imm64(bcx, &insn), in translate_program()
896 (false, true) => self.insn_imm32(bcx, &insn), in translate_program()
899 let cmp_res = if (insn.opc & BPF_ALU_OP_MASK) == BPF_JSET { in translate_program()
913 .get(&(insn.imm as u32)) in translate_program()
920 insn.imm as u32 in translate_program()
933 self.set_dst(bcx, &insn, ret); in translate_program()
941 _ => unimplemented!("inst: {:?}", insn), in translate_program()
950 fn insn_imm64(&mut self, bcx: &mut FunctionBuilder, insn: &Insn) -> Value { in insn_imm64()
951 bcx.ins().iconst(I64, insn.imm as u64 as i64) in insn_imm64()
953 fn insn_imm32(&mut self, bcx: &mut FunctionBuilder, insn: &Insn) -> Value { in insn_imm32()
954 bcx.ins().iconst(I32, insn.imm as u32 as u64 as i64) in insn_imm32()
957 fn insn_dst(&mut self, bcx: &mut FunctionBuilder, insn: &Insn) -> Value { in insn_dst()
958 bcx.use_var(self.registers[insn.dst as usize]) in insn_dst()
960 fn insn_dst32(&mut self, bcx: &mut FunctionBuilder, insn: &Insn) -> Value { in insn_dst32()
961 let dst = self.insn_dst(bcx, insn); in insn_dst32()
965 fn insn_src(&mut self, bcx: &mut FunctionBuilder, insn: &Insn) -> Value { in insn_src()
966 bcx.use_var(self.registers[insn.src as usize]) in insn_src()
968 fn insn_src32(&mut self, bcx: &mut FunctionBuilder, insn: &Insn) -> Value { in insn_src32()
969 let src = self.insn_src(bcx, insn); in insn_src32()
973 fn set_dst(&mut self, bcx: &mut FunctionBuilder, insn: &Insn, val: Value) { in set_dst()
974 bcx.def_var(self.registers[insn.dst as usize], val); in set_dst()
976 fn set_dst32(&mut self, bcx: &mut FunctionBuilder, insn: &Insn, val: Value) { in set_dst32()
978 self.set_dst(bcx, insn, val32); in set_dst32()
1086 let insn = ebpf::get_insn(prog, insn_ptr); in build_cfg() localVariable
1088 match insn.opc { in build_cfg()
1141 self.prepare_jump_blocks(bcx, insn_ptr, &insn); in build_cfg()
1152 fn prepare_jump_blocks(&mut self, bcx: &mut FunctionBuilder, insn_ptr: usize, insn: &Insn) { in prepare_jump_blocks()
1155 let target_pc: u32 = (insn_ptr as isize + insn.off as isize + 1) in prepare_jump_blocks()