summaryrefslogtreecommitdiff
path: root/rust/src/medium_level_il
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/medium_level_il')
-rw-r--r--rust/src/medium_level_il/instruction.rs30
-rw-r--r--rust/src/medium_level_il/lift.rs15
2 files changed, 44 insertions, 1 deletions
diff --git a/rust/src/medium_level_il/instruction.rs b/rust/src/medium_level_il/instruction.rs
index 41f2bbe4..77a0be27 100644
--- a/rust/src/medium_level_il/instruction.rs
+++ b/rust/src/medium_level_il/instruction.rs
@@ -575,6 +575,24 @@ impl MediumLevelILInstruction {
MLIL_NOT => Op::Not(UnaryOp {
src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
}),
+ MLIL_BSWAP => Op::Bswap(UnaryOp {
+ src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
+ }),
+ MLIL_POPCNT => Op::Popcnt(UnaryOp {
+ src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
+ }),
+ MLIL_CLZ => Op::Clz(UnaryOp {
+ src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
+ }),
+ MLIL_CTZ => Op::Ctz(UnaryOp {
+ src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
+ }),
+ MLIL_RBIT => Op::Rbit(UnaryOp {
+ src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
+ }),
+ MLIL_CLS => Op::Cls(UnaryOp {
+ src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
+ }),
MLIL_SX => Op::Sx(UnaryOp {
src: MediumLevelExpressionIndex::from(op.operands[0] as usize),
}),
@@ -1099,6 +1117,12 @@ impl MediumLevelILInstruction {
Neg(op) => Lifted::Neg(self.lift_unary_op(op)),
Not(op) => Lifted::Not(self.lift_unary_op(op)),
+ Bswap(op) => Lifted::Bswap(self.lift_unary_op(op)),
+ Popcnt(op) => Lifted::Popcnt(self.lift_unary_op(op)),
+ Clz(op) => Lifted::Clz(self.lift_unary_op(op)),
+ 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)),
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)),
@@ -1874,6 +1898,12 @@ pub enum MediumLevelILInstructionKind {
StoreOutput(StoreOutput),
Neg(UnaryOp),
Not(UnaryOp),
+ Bswap(UnaryOp),
+ Popcnt(UnaryOp),
+ Clz(UnaryOp),
+ Ctz(UnaryOp),
+ Rbit(UnaryOp),
+ Cls(UnaryOp),
Sx(UnaryOp),
Zx(UnaryOp),
LowPart(UnaryOp),
diff --git a/rust/src/medium_level_il/lift.rs b/rust/src/medium_level_il/lift.rs
index aee8139f..2f0d6653 100644
--- a/rust/src/medium_level_il/lift.rs
+++ b/rust/src/medium_level_il/lift.rs
@@ -154,6 +154,12 @@ pub enum MediumLevelILLiftedInstructionKind {
SharedParamSlot(LiftedSharedParamSlot),
Neg(LiftedUnaryOp),
Not(LiftedUnaryOp),
+ Bswap(LiftedUnaryOp),
+ Popcnt(LiftedUnaryOp),
+ Clz(LiftedUnaryOp),
+ Ctz(LiftedUnaryOp),
+ Rbit(LiftedUnaryOp),
+ Cls(LiftedUnaryOp),
Sx(LiftedUnaryOp),
Zx(LiftedUnaryOp),
LowPart(LiftedUnaryOp),
@@ -313,6 +319,12 @@ impl MediumLevelILLiftedInstruction {
StoreOutput(_) => "StoreOutput",
Neg(_) => "Neg",
Not(_) => "Not",
+ Bswap(_) => "Bswap",
+ Popcnt(_) => "Popcnt",
+ Clz(_) => "Clz",
+ Ctz(_) => "Ctz",
+ Rbit(_) => "Rbit",
+ Cls(_) => "Cls",
Sx(_) => "Sx",
Zx(_) => "Zx",
LowPart(_) => "LowPart",
@@ -542,7 +554,8 @@ impl MediumLevelILLiftedInstruction {
("params", Operand::ExprList(op.params.clone())),
("stack", Operand::Expr(*op.stack.clone())),
],
- Neg(op) | Not(op) | Sx(op) | Zx(op) | LowPart(op) | BoolToInt(op) | UnimplMem(op)
+ Neg(op) | Not(op) | Bswap(op) | Popcnt(op) | Clz(op) | Ctz(op) | Rbit(op) | Cls(op)
+ | Sx(op) | Zx(op) | LowPart(op) | BoolToInt(op) | UnimplMem(op)
| Fsqrt(op) | Fneg(op) | Fabs(op) | FloatToInt(op) | IntToFloat(op) | FloatConv(op)
| RoundToInt(op) | Floor(op) | Ceil(op) | Ftrunc(op) | Load(op) => {
vec![("src", Operand::Expr(*op.src.clone()))]