Make the side-numbering of instructions used by metadata (which is needed to
[oota-llvm.git] / test / CodeGen / X86 / vector-of-i1.ll
1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3 ; Vectors of i1 are stored with each element having a
4 ; different address. Since the address unit on x86 is 8 bits,
5 ; that means each i1 value takes 8 bits of storage.
6
7 ; CHECK: store:
8 ; CHECK: movb  $1, 7(%rdi)
9 ; CHECK: movb  $1, 6(%rdi)
10 ; CHECK: movb  $0, 5(%rdi)
11 ; CHECK: movb  $0, 4(%rdi)
12 ; CHECK: movb  $1, 3(%rdi)
13 ; CHECK: movb  $0, 2(%rdi)
14 ; CHECK: movb  $1, 1(%rdi)
15 ; CHECK: movb  $0, (%rdi)
16 define void @store(<8 x i1>* %p) nounwind {
17   store <8 x i1> <i1 0, i1 1, i1 0, i1 1, i1 0, i1 0, i1 1, i1 1>, <8 x i1>* %p
18   ret void
19 }
20
21 ; CHECK: variable_extract:
22 ; CHECK: movb  7(%rdi), 
23 ; CHECK: movb  6(%rdi), 
24 ; CHECK: movb  5(%rdi), 
25 define i32 @variable_extract(<8 x i1>* %p, i32 %n) nounwind {
26   %t = load <8 x i1>* %p
27   %s = extractelement <8 x i1> %t, i32 %n
28   %e = zext i1 %s to i32
29   ret i32 %e
30 }
31
32 ; CHECK: constant_extract:
33 ; CHECK: movzbl 3(%rdi), %eax
34 define i32 @constant_extract(<8 x i1>* %p, i32 %n) nounwind {
35   %t = load <8 x i1>* %p
36   %s = extractelement <8 x i1> %t, i32 3
37   %e = zext i1 %s to i32
38   ret i32 %e
39 }