Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Nov 15, 2023
1 parent 5f5bf0b commit d21e133
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions cranelift/codegen/src/isa/zkasm/inst/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ impl MachInstEmit for Inst {
Inst::Ineg { rd, rs1 } => {
let rs = allocs.next(*rs1);
let rd = allocs.next(rd.to_reg());
// TODO(nagisa): this wants to conditionally use the `SUB` instruction instead (if
// the negation is for 64 bits)
// FIXME(#81): should this use a SUB?
put_string(
&format!("0n - {} => {}\n", reg_name(rs), reg_name(rd)),
sink,
Expand All @@ -468,12 +467,9 @@ impl MachInstEmit for Inst {
Inst::Bnot { rd, rs1 } => {
let rs = allocs.next(*rs1);
let rd = allocs.next(rd.to_reg());
// FIXME(#81): should this use a SUB?
put_string(
&format!(
"18446744073709551615n - {} => {}\n",
reg_name(rs),
reg_name(rd)
),
&format!("{}n - {} => {}\n", u64::MAX, reg_name(rs), reg_name(rd)),
sink,
);
}
Expand Down
6 changes: 3 additions & 3 deletions cranelift/codegen/src/isa/zkasm/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,14 +1025,14 @@ impl Inst {
Inst::Ineg { rd, rs1 } => {
let rd = format_reg(rd.to_reg(), allocs);
let rs = format_reg(*rs1, allocs);
// FIXME: should this use a SUB?
// FIXME(#81): should this use a SUB?
format!("0n - {rs} => {rd}")
}
Inst::Bnot { rd, rs1 } => {
let rd = format_reg(rd.to_reg(), allocs);
let rs = format_reg(*rs1, allocs);
// FIXME: should this use a SUB?
format!("18446744073709551615n - {rs} => {rd}")
// FIXME(#81): should this use a SUB?
format!("{}n - {rs} => {rd}", u64::MAX)
}
&Inst::Load {
rd,
Expand Down

0 comments on commit d21e133

Please sign in to comment.