Reapply r54147 with a constraint to only use the 8-bit
[oota-llvm.git] / test / CodeGen / X86 / zext-inreg-2.ll
1 ; RUN: llvm-as < %s | llc -march=x86-64 > %t
2 ; RUN: not grep and %t
3 ; RUN: not grep movzbq %t
4 ; RUN: not grep movzwq %t
5 ; RUN: not grep movzlq %t
6
7 ; These should use movzbl instead of 'and 255'.
8 ; This related to not having a ZERO_EXTEND_REG opcode.
9
10 ; This test was split out of zext-inreg-0.ll because these
11 ; cases don't yet work on x86-32 due to the 8-bit subreg
12 ; issue.
13
14 define i32 @a(i32 %d) nounwind  {
15         %e = add i32 %d, 1
16         %retval = and i32 %e, 255
17         ret i32 %retval
18 }
19 define i32 @b(float %d) nounwind  {
20         %tmp12 = fptoui float %d to i8
21         %retval = zext i8 %tmp12 to i32
22         ret i32 %retval
23 }
24 define i64 @d(i64 %d) nounwind  {
25         %e = add i64 %d, 1
26         %retval = and i64 %e, 255
27         ret i64 %retval
28 }