Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
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: 1 addition & 4 deletions cranelift-codegen/meta/src/isa/x86/encodings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,7 @@ pub fn define(
for &ty in &[B1, B8, B16, B32] {
e.enc_both(bconst.bind(ty), rec_pu_id_bool.opcodes(vec![0xb8]));
}
e.enc64(
bconst.bind(B64),
rec_pu_id_bool.opcodes(vec![0xb8]).rex().w(),
);
e.enc64(bconst.bind(B64), rec_pu_id_bool.opcodes(vec![0xb8]).rex());

// Shifts and rotates.
// Note that the dynamic shift amount is only masked by 5 or 6 bits; the 8-bit
Expand Down
10 changes: 10 additions & 0 deletions filetests/isa/x86/binary64-run.clif
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test run
target x86_64

; this verifies that returning b64 immediates does not result in a segmentation fault, see https://github.com/CraneStation/cranelift/issues/911
function %test_b64() -> b64 {
ebb0:
[-, %r10] v0 = bconst.b64 true
return v0
}
; run
7 changes: 7 additions & 0 deletions filetests/isa/x86/binary64.clif
Original file line number Diff line number Diff line change
Expand Up @@ -1642,3 +1642,10 @@ ebb0:

return
}

function %B64() {
ebb0:
[-, %rax] v1 = bconst.b64 true ; bin: 40 b8 00000001
[-, %r10] v0 = bconst.b64 true ; bin: 41 ba 00000001
return
}