jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Cast bool to machine word

Open vbgl opened this issue 1 year ago • 0 comments

Currently, the only way I know to turn a boolean condition into a word (in a register) is to resort to the #SETcc intrinsic. I think it would be much more convenient (and readable) to allow using a cast, as exemplified below:

export
fn main(reg u64 x) -> reg u8 {
  reg bool b;
  reg u8 r;
  b = x > 1;
  r = (8u)b; // Does not work; we have to do: r = #SETcc(b);
  return r;
}

vbgl avatar Jul 06 '22 08:07 vbgl