minirust icon indicating copy to clipboard operation
minirust copied to clipboard

Add missing operators

Open RalfJung opened this issue 9 months ago • 6 comments

Rust has a bunch of operators that we do not support yet:

  • [x] BitOr, BitXor (on integers and Booleans)
  • [x] Shl, Shr
  • [x] Cmp
  • [x] checked operators (in MIR encoded via a separate Rvalue::CheckedBinaryOp) -- AFAIK this is only allowed for Add, Sub, Mul; they should become separate BinOp for us
  • [x] some intrinsics that are lowered to binops: AddUnchecked, SubUnchecked, MulUnchecked, ShlUnchecked, ShrUnchecked
  • [x] UnOp::Not, which we support for Booleans but not for integers
  • [x] Comparison operators on bool (here it seems best to not add anything new to MiniRust, and teach minimize to translate this to operations on integers)
  • [ ] Comparison operators on pointers (probably also best done via casts)

RalfJung avatar May 14 '24 13:05 RalfJung