Fix x86 encoding of uextend/sextend from 8-bit inputs.
The x86-32 and non-REX encodings of movsbl and movzbl require one of the ABCD registers as input.
This commit is contained in:
13
cranelift/filetests/isa/x86/abcd.cton
Normal file
13
cranelift/filetests/isa/x86/abcd.cton
Normal file
@@ -0,0 +1,13 @@
|
||||
test regalloc
|
||||
isa x86
|
||||
|
||||
; %rdi can't be used in a movsbl instruction, so test that the register
|
||||
; allocator can move it to a register that can be.
|
||||
|
||||
function %test(i32 [%rdi]) -> i32 system_v {
|
||||
ebb0(v0: i32 [%rdi]):
|
||||
v1 = ireduce.i8 v0
|
||||
v2 = sextend.i32 v1
|
||||
return v2
|
||||
}
|
||||
; check: regmove v1, %rdi -> %rax
|
||||
Reference in New Issue
Block a user