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:
Dan Gohman
2018-04-20 12:08:01 -07:00
parent e876529152
commit dfb24f1934
2 changed files with 18 additions and 4 deletions

View 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