Skip to content

Commit a56aedd

Browse files
committed
Set the cycles of the CFI instruction
1 parent 546d975 commit a56aedd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cost_model.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use goblin_v023::mach::constants::S_LITERAL_POINTERS;
2+
13
use crate::{
24
Instruction,
35
instructions::{extract_opcode, insts},
@@ -88,6 +90,13 @@ pub fn estimate_cycles(i: Instruction) -> u64 {
8890
insts::OP_WIDE_DIVU => 32,
8991
insts::OP_FAR_JUMP_REL => 3,
9092
insts::OP_FAR_JUMP_ABS => 3,
93+
// CFI
94+
insts::OP_LPAD => 3,
95+
insts::OP_SSRDP => 3,
96+
insts::OP_SSPUSH => 3,
97+
insts::OP_SSPOPCHK => 3,
98+
insts::OP_SSAMOSWAP_W => 4,
99+
insts::OP_SSAMOSWAP_D => 4,
91100
_ => 1,
92101
}
93102
}

0 commit comments

Comments
 (0)