Eliminate more uses of llvm-as and llvm-dis.
[oota-llvm.git] / test / CodeGen / X86 / h-registers-0.ll
1 ; RUN: llc < %s -march=x86-64 | grep {movzbl    %\[abcd\]h,} | count 4
2 ; RUN: llc < %s -march=x86    > %t
3 ; RUN: grep {incb       %ah} %t | count 3
4 ; RUN: grep {movzbl     %ah,} %t | count 3
5
6 ; Use h registers. On x86-64, codegen doesn't support general allocation
7 ; of h registers yet, due to x86 encoding complications.
8
9 define void @bar64(i64 inreg %x, i8* inreg %p) nounwind {
10   %t0 = lshr i64 %x, 8
11   %t1 = trunc i64 %t0 to i8
12   %t2 = add i8 %t1, 1
13   store i8 %t2, i8* %p
14   ret void
15 }
16
17 define void @bar32(i32 inreg %x, i8* inreg %p) nounwind {
18   %t0 = lshr i32 %x, 8
19   %t1 = trunc i32 %t0 to i8
20   %t2 = add i8 %t1, 1
21   store i8 %t2, i8* %p
22   ret void
23 }
24
25 define void @bar16(i16 inreg %x, i8* inreg %p) nounwind {
26   %t0 = lshr i16 %x, 8
27   %t1 = trunc i16 %t0 to i8
28   %t2 = add i8 %t1, 1
29   store i8 %t2, i8* %p
30   ret void
31 }
32
33 define i64 @qux64(i64 inreg %x) nounwind {
34   %t0 = lshr i64 %x, 8
35   %t1 = and i64 %t0, 255
36   ret i64 %t1
37 }
38
39 define i32 @qux32(i32 inreg %x) nounwind {
40   %t0 = lshr i32 %x, 8
41   %t1 = and i32 %t0, 255
42   ret i32 %t1
43 }
44
45 define i16 @qux16(i16 inreg %x) nounwind {
46   %t0 = lshr i16 %x, 8
47   ret i16 %t0
48 }