Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong semantics of x86 instruction BT when operand is in memory #931

Closed
vbgl opened this issue Oct 16, 2024 · 0 comments · Fixed by #948
Closed

Wrong semantics of x86 instruction BT when operand is in memory #931

vbgl opened this issue Oct 16, 2024 · 0 comments · Fixed by #948

Comments

@vbgl
Copy link
Member

vbgl commented Oct 16, 2024

The following (safe) program produces zero in Jasmin semantics but one when run on hardware after compilation.

export fn test() -> reg u8 {
  reg bool cf;
  stack u64[2] s;
  s[0] = 0;
  s[1] = 1;
  reg u64 ofs = 64;
  cf = #BT(s[0], ofs);
  reg u8 r = #SETcc(cf);
  return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant