1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
3 ; CHECK-DAG: OpName [[SHFv4:%.+]] "shuffle_v4"
4 ; CHECK-DAG: OpName [[INSv4:%.+]] "insert_v4"
5 ; CHECK-DAG: OpName [[EXTv4:%.+]] "extract_v4"
6 ; CHECK-DAG: OpName [[INSv4C:%.+]] "insert_v4C"
7 ; CHECK-DAG: OpName [[EXTv4C:%.+]] "extract_v4C"
10 ; CHECK: [[SHFv4]] = OpFunction
11 ; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter
12 ; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter
14 ; CHECK: [[R:%.+]] = OpVectorShuffle {{%.+}} [[A]] [[B]] 0 4 3 6
15 ; CHECK: OpReturnValue [[R]]
16 ; CHECK-NEXT: OpFunctionEnd
17 define <4 x float> @shuffle_v4(<8 x float> %A, <8 x float> %B) {
18 %r = shufflevector <8 x float> %A, <8 x float> %B, <4 x i32> <i32 0, i32 4, i32 3, i32 6>
22 ; CHECK: [[INSv4]] = OpFunction
23 ; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter
24 ; CHECK-NEXT: [[E:%.+]] = OpFunctionParameter
25 ; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter
27 ; CHECK: [[R:%.+]] = OpVectorInsertDynamic {{%.+}} [[V]] [[E]] [[C]]
28 ; CHECK: OpReturnValue [[R]]
29 ; CHECK-NEXT: OpFunctionEnd
30 define <4 x float> @insert_v4(<4 x float> %V, float %E, i32 %C) {
31 %r = insertelement <4 x float> %V, float %E, i32 %C
35 ; CHECK: [[EXTv4]] = OpFunction
36 ; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter
37 ; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter
39 ; CHECK: [[R:%.+]] = OpVectorExtractDynamic {{%.+}} [[V]] [[C]]
40 ; CHECK: OpReturnValue [[R]]
41 ; CHECK-NEXT: OpFunctionEnd
42 define float @extract_v4(<4 x float> %V, i32 %C) {
43 %r = extractelement <4 x float> %V, i32 %C
47 ; CHECK: [[INSv4C]] = OpFunction
48 ; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter
49 ; CHECK-NEXT: [[E:%.+]] = OpFunctionParameter
51 ; CHECK: [[R:%.+]] = OpCompositeInsert {{%.+}} [[E]] [[V]] 3
52 ; CHECK: OpReturnValue [[R]]
53 ; CHECK-NEXT: OpFunctionEnd
54 define <4 x float> @insert_v4C(<4 x float> %V, float %E) {
55 %r = insertelement <4 x float> %V, float %E, i32 3
59 ; CHECK: [[EXTv4C]] = OpFunction
60 ; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter
62 ; CHECK: [[R:%.+]] = OpCompositeExtract {{%.+}} [[V]] 2
63 ; CHECK: OpReturnValue [[R]]
64 ; CHECK-NEXT: OpFunctionEnd
65 define float @extract_v4C(<4 x float> %V) {
66 %r = extractelement <4 x float> %V, i32 2