diff options
| author | Mark Rowe <mark@vector35.com> | 2026-06-04 16:36:52 -0700 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-06-05 13:01:46 -0700 |
| commit | fde1241ce928d38c2031c827ae0ddee5c6f5af0f (patch) | |
| tree | 6711a47863332712eb5324e2c3ef1dffb843bb5d /rust/src/high_level_il/instruction.rs | |
| parent | fa09f36b5f47ed690dc029fe9f1ed9ad4ebce7c8 (diff) | |
Add abs, min, and max instructions
Diffstat (limited to 'rust/src/high_level_il/instruction.rs')
| -rw-r--r-- | rust/src/high_level_il/instruction.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/rust/src/high_level_il/instruction.rs b/rust/src/high_level_il/instruction.rs index 0fbbb297..8b675657 100644 --- a/rust/src/high_level_il/instruction.rs +++ b/rust/src/high_level_il/instruction.rs @@ -227,6 +227,22 @@ impl HighLevelILInstruction { left: HighLevelExpressionIndex::from(op.operands[0]), right: HighLevelExpressionIndex::from(op.operands[1]), }), + HLIL_MINS => Op::MinSigned(BinaryOp { + left: HighLevelExpressionIndex::from(op.operands[0]), + right: HighLevelExpressionIndex::from(op.operands[1]), + }), + HLIL_MAXS => Op::MaxSigned(BinaryOp { + left: HighLevelExpressionIndex::from(op.operands[0]), + right: HighLevelExpressionIndex::from(op.operands[1]), + }), + HLIL_MINU => Op::MinUnsigned(BinaryOp { + left: HighLevelExpressionIndex::from(op.operands[0]), + right: HighLevelExpressionIndex::from(op.operands[1]), + }), + HLIL_MAXU => Op::MaxUnsigned(BinaryOp { + left: HighLevelExpressionIndex::from(op.operands[0]), + right: HighLevelExpressionIndex::from(op.operands[1]), + }), HLIL_CMP_E => Op::CmpE(BinaryOp { left: HighLevelExpressionIndex::from(op.operands[0]), right: HighLevelExpressionIndex::from(op.operands[1]), @@ -430,6 +446,9 @@ impl HighLevelILInstruction { HLIL_CLS => Op::Cls(UnaryOp { src: HighLevelExpressionIndex::from(op.operands[0]), }), + HLIL_ABS => Op::Abs(UnaryOp { + src: HighLevelExpressionIndex::from(op.operands[0]), + }), HLIL_SX => Op::Sx(UnaryOp { src: HighLevelExpressionIndex::from(op.operands[0]), }), @@ -695,6 +714,10 @@ impl HighLevelILInstruction { ModuDp(op) => Lifted::ModuDp(self.lift_binary_op(op)), Mods(op) => Lifted::Mods(self.lift_binary_op(op)), ModsDp(op) => Lifted::ModsDp(self.lift_binary_op(op)), + MinSigned(op) => Lifted::MinSigned(self.lift_binary_op(op)), + MaxSigned(op) => Lifted::MaxSigned(self.lift_binary_op(op)), + MinUnsigned(op) => Lifted::MinUnsigned(self.lift_binary_op(op)), + MaxUnsigned(op) => Lifted::MaxUnsigned(self.lift_binary_op(op)), CmpE(op) => Lifted::CmpE(self.lift_binary_op(op)), CmpNe(op) => Lifted::CmpNe(self.lift_binary_op(op)), CmpSlt(op) => Lifted::CmpSlt(self.lift_binary_op(op)), @@ -818,6 +841,7 @@ impl HighLevelILInstruction { Ctz(op) => Lifted::Ctz(self.lift_unary_op(op)), Rbit(op) => Lifted::Rbit(self.lift_unary_op(op)), Cls(op) => Lifted::Cls(self.lift_unary_op(op)), + Abs(op) => Lifted::Abs(self.lift_unary_op(op)), Sx(op) => Lifted::Sx(self.lift_unary_op(op)), Zx(op) => Lifted::Zx(self.lift_unary_op(op)), LowPart(op) => Lifted::LowPart(self.lift_unary_op(op)), @@ -1152,6 +1176,10 @@ pub enum HighLevelILInstructionKind { ModuDp(BinaryOp), Mods(BinaryOp), ModsDp(BinaryOp), + MinSigned(BinaryOp), + MaxSigned(BinaryOp), + MinUnsigned(BinaryOp), + MaxUnsigned(BinaryOp), CmpE(BinaryOp), CmpNe(BinaryOp), CmpSlt(BinaryOp), @@ -1203,6 +1231,7 @@ pub enum HighLevelILInstructionKind { Ctz(UnaryOp), Rbit(UnaryOp), Cls(UnaryOp), + Abs(UnaryOp), Sx(UnaryOp), Zx(UnaryOp), LowPart(UnaryOp), |
