Skip to content

Commit

Permalink
Make unsupported instructions fail zkAsm execution
Browse files Browse the repository at this point in the history
  • Loading branch information
aborg-dev committed Feb 1, 2024
1 parent 5225823 commit 685ff6a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cranelift/codegen/src/isa/zkasm/inst/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ impl MachInstEmit for Inst {
);
}
&Inst::CallInd { ref info } => {
put_string(&format!(";; FIXME: Inst::CallInd({info:?})\n"), sink);
put_string(&format!("FIXME: Inst::CallInd({info:?})\n"), sink);

/*
let rn = allocs.next(info.rn);
Expand Down Expand Up @@ -828,7 +828,7 @@ impl MachInstEmit for Inst {
ref info,
} => {
put_string(
&format!(";; FIXME: Inst::ReturnCall({callee:?}, {info:?})\n"),
&format!("FIXME: Inst::ReturnCall({callee:?}, {info:?})\n"),
sink,
);
/* emit_return_call_common_sequence(
Expand All @@ -855,7 +855,7 @@ impl MachInstEmit for Inst {

&Inst::ReturnCallInd { callee, ref info } => {
put_string(
&format!(";; FIXME: Inst::ReturnCallInd({callee:?}, {info:?})\n"),
&format!("FIXME: Inst::ReturnCallInd({callee:?}, {info:?})\n"),
sink,
);
/* let callee = allocs.next(callee);
Expand Down Expand Up @@ -892,7 +892,7 @@ impl MachInstEmit for Inst {
put_string(&format!(":JMP(label_{})\n", label.index()), sink);
}
BranchTarget::ResolvedOffset(offset) => {
put_string(&format!(";; FIXME: Inst::Jal({dest:?})\n"), sink);
put_string(&format!("FIXME: Inst::Jal({dest:?})\n"), sink);
/*
let offset = offset as i64;
if offset != 0 {
Expand Down Expand Up @@ -942,7 +942,7 @@ impl MachInstEmit for Inst {
BranchTarget::ResolvedOffset(offset) => {
put_string(
&format!(
";; FIXME: Inst::CondBr({taken:?}, {not_taken:?}, {kind:?})\n"
"FIXME: Inst::CondBr({taken:?}, {not_taken:?}, {kind:?})\n"
),
sink,
);
Expand Down Expand Up @@ -1016,7 +1016,7 @@ impl MachInstEmit for Inst {

&Inst::MovFromPReg { rd, rm } => {
put_string(
&format!(";; FIXME: Inst::MovFromPReg({rd:?}, {rm:?})\n"),
&format!("FIXME: Inst::MovFromPReg({rd:?}, {rm:?})\n"),
sink,
);
/* debug_assert!([px_reg(2), px_reg(8)].contains(&rm));
Expand All @@ -1038,7 +1038,7 @@ impl MachInstEmit for Inst {
} => {
put_string(
&format!(
";; FIXME: Inst::BrTable({index:?}, {tmp1:?}, {tmp2:?}, {targets:?})\n"
"FIXME: Inst::BrTable({index:?}, {tmp1:?}, {tmp2:?}, {targets:?})\n"
),
sink,
);
Expand Down Expand Up @@ -1191,7 +1191,7 @@ impl MachInstEmit for Inst {

&Inst::LoadAddr { rd, mem } => {
put_string(
&format!(";; FIXME: Inst::LoadAddr({rd:?}, {mem:?})\n"),
&format!("FIXME: Inst::LoadAddr({rd:?}, {mem:?})\n"),
sink,
);
/* let mem = mem.with_allocs(&mut allocs);
Expand Down Expand Up @@ -1261,7 +1261,7 @@ impl MachInstEmit for Inst {
} => {
put_string(
&format!(
";; FIXME: Inst::Select({dst:?}, {condition:?}, {x:?}, {y:?}, {_ty})\n"
"FIXME: Inst::Select({dst:?}, {condition:?}, {x:?}, {y:?}, {_ty})\n"
),
sink,
);
Expand Down Expand Up @@ -1306,7 +1306,7 @@ impl MachInstEmit for Inst {
}
&Inst::Jalr { rd, base, offset } => {
put_string(
&format!(";; FIXME: Inst::Jalr({rd:?}, {base:?}, {offset:?})\n"),
&format!("FIXME: Inst::Jalr({rd:?}, {base:?}, {offset:?})\n"),
sink,
);
/* let rd = allocs.next_writable(rd);
Expand Down Expand Up @@ -1424,7 +1424,7 @@ impl MachInstEmit for Inst {
ty,
} => {
put_string(
&format!(";; FIXME: Inst::IntSelect({op:?}, {dst:?}, {x:?}, {y:?}, {ty:?})\n"),
&format!("FIXME: Inst::IntSelect({op:?}, {dst:?}, {x:?}, {y:?}, {ty:?})\n"),
sink,
);
/* let x = alloc_value_regs(x, &mut allocs);
Expand Down Expand Up @@ -1483,7 +1483,7 @@ impl MachInstEmit for Inst {
} => {
put_string(
&format!(
";; FIXME: Inst::SelectReg({condition:?}, {rd:?}, {rs1:?}, {rs2:?})\n"
"FIXME: Inst::SelectReg({condition:?}, {rd:?}, {rs1:?}, {rs2:?})\n"
),
sink,
);
Expand Down Expand Up @@ -1575,7 +1575,7 @@ impl MachInstEmit for Inst {
} => {
put_string(
&format!(
";; FIXME: Inst::Popcnt({sum:?}, {tmp:?}, {step:?}, {rs:?}, {ty:?})\n"
"FIXME: Inst::Popcnt({sum:?}, {tmp:?}, {step:?}, {rs:?}, {ty:?})\n"
),
sink,
);
Expand Down Expand Up @@ -1746,7 +1746,7 @@ impl MachInstEmit for Inst {
} => {
put_string(
&format!(
";; FIXME: Inst::Cltz({sum:?}, {tmp:?}, {step:?}, {rs:?}, {leading:?}, {ty:?})\n"
"FIXME: Inst::Cltz({sum:?}, {tmp:?}, {step:?}, {rs:?}, {leading:?}, {ty:?})\n"
),
sink,
);
Expand Down

0 comments on commit 685ff6a

Please sign in to comment.