Skip to content

Miscompilation of signed load by ARMv8 NCG

This Cmm program is miscompiled by the ARMv8 NCG.

test(W_ buffer) {
  return (%zx64(%shrl(bits16[buffer + (128 :: bits64)], (1 :: bits64))) & (64711 :: bits64));
}

With -fllvm (and under the bgamari/test-primops> interpreter) this evaluates to 0x40c0. With the NCG it evaluates to 0xc0c0.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information