R600/SI: Add a stub GCNTargetMachine
[oota-llvm.git] / test / CodeGen / R600 / extract_vector_elt_i16.ll
1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs< %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2
3 ; FUNC-LABEL: {{^}}extract_vector_elt_v2i16:
4 ; SI: buffer_load_ushort
5 ; SI: buffer_load_ushort
6 ; SI: buffer_store_short
7 ; SI: buffer_store_short
8 define void @extract_vector_elt_v2i16(i16 addrspace(1)* %out, <2 x i16> %foo) nounwind {
9   %p0 = extractelement <2 x i16> %foo, i32 0
10   %p1 = extractelement <2 x i16> %foo, i32 1
11   %out1 = getelementptr i16 addrspace(1)* %out, i32 1
12   store i16 %p1, i16 addrspace(1)* %out, align 2
13   store i16 %p0, i16 addrspace(1)* %out1, align 2
14   ret void
15 }
16
17 ; FUNC-LABEL: {{^}}extract_vector_elt_v4i16:
18 ; SI: buffer_load_ushort
19 ; SI: buffer_load_ushort
20 ; SI: buffer_store_short
21 ; SI: buffer_store_short
22 define void @extract_vector_elt_v4i16(i16 addrspace(1)* %out, <4 x i16> %foo) nounwind {
23   %p0 = extractelement <4 x i16> %foo, i32 0
24   %p1 = extractelement <4 x i16> %foo, i32 2
25   %out1 = getelementptr i16 addrspace(1)* %out, i32 1
26   store i16 %p1, i16 addrspace(1)* %out, align 2
27   store i16 %p0, i16 addrspace(1)* %out1, align 2
28   ret void
29 }