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

ASM: print 8-bit immediates unsigned #821

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@
- The deprecated legacy interface to the CT checker has been removed
([PR #769](https://github.com/jasmin-lang/jasmin/pull/769)).

- In x86 assembly, 8-bit immediate operands are printed unsigned,
i.e., in the range [0; 255]
([PR #821](https://github.com/jasmin-lang/jasmin/pull/821);
fixes [#803](https://github.com/jasmin-lang/jasmin/issues/803)).

# Jasmin 2023.06.3 — 2024-04-10

## New features
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/ppasm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ module Printer (BP:BPrinter) = struct
let pp_asm_arg ((ws,op):(W.wsize * (_, _, _, _, _) Arch_decl.asm_arg)) =
match op with
| Condt _ -> assert false
| Imm(ws, w) -> pp_imm (Conv.z_of_word ws w)
| Imm(ws, w) -> pp_imm ((if ws = U8 then Conv.z_unsigned_of_word else Conv.z_of_word) ws w)
| Reg r -> pp_register ~reg_pre (rsize_of_wsize ws) r
| Regx r -> pp_register_ext ~reg_pre ws r
| Addr addr -> BP.pp_address ws addr
Expand Down
2 changes: 2 additions & 0 deletions compiler/tests/success/x86-64/vector.jazz
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ y = (64u) #VPEXTR_16(a, 3);
r64 += y;
y = #VPEXTR_64(a, 1);
r64 += y;
y = #VPEXTR_64(a, -0x80);
r64 += y;

return r64;
}
Expand Down