diff --git a/cranelift/codegen/src/isa/zkasm/inst/emit.rs b/cranelift/codegen/src/isa/zkasm/inst/emit.rs index 2205cd4d22ee..e7f430f3a03c 100644 --- a/cranelift/codegen/src/isa/zkasm/inst/emit.rs +++ b/cranelift/codegen/src/isa/zkasm/inst/emit.rs @@ -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, @@ -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, ); } diff --git a/cranelift/codegen/src/isa/zkasm/inst/mod.rs b/cranelift/codegen/src/isa/zkasm/inst/mod.rs index 100e9c8e975a..232904fd41ba 100644 --- a/cranelift/codegen/src/isa/zkasm/inst/mod.rs +++ b/cranelift/codegen/src/isa/zkasm/inst/mod.rs @@ -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,