jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Immediate values on ARM

Open vbgl opened this issue 1 year ago • 1 comments

A few things do not work yet, although they should.

  • 32-bit immediate assigned to a register (workaround: halve into 16-bit parts and use #MOVT)
export
fn big() -> reg u32 {
  reg u32 r;
  r = 0x12345678;
  return r;
}
  • Immediate arguments whose decoding clobbers the carry flag
export
fn mask(reg u32 x) -> reg u32 {
  x &= 0xff00;
  return x;
}

vbgl avatar Jul 20 '23 09:07 vbgl

Note that for the first part, we could reuse arm_cmd_load_large_imm from arm_params, that is already proven to have the appropriate semantics. But it's done for fexprs, se we could maybe parameterize these definitions on the type of expressions and lvals? I don't know if it's worth it for the proofs, though.

sarranz avatar Sep 11 '23 09:09 sarranz