1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
3 ; CHECK-SPIRV: %[[#bool:]] = OpTypeBool
4 ; CHECK-SPIRV: %[[#bool2:]] = OpTypeVector %[[#bool]] 2
6 ; CHECK-SPIRV: OpFunction
7 ; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
8 ; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
9 ; CHECK-SPIRV: %[[#]] = OpFUnordEqual %[[#bool2]] %[[#A]] %[[#B]]
10 ; CHECK-SPIRV: OpFunctionEnd
12 @var = addrspace(1) global <2 x i1> zeroinitializer
13 define spir_kernel void @testFUnordEqual(<2 x float> %a, <2 x float> %b) {
15 %0 = fcmp ueq <2 x float> %a, %b
16 store <2 x i1> %0, <2 x i1> addrspace(1)* @var
20 ; CHECK-SPIRV: OpFunction
21 ; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
22 ; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
23 ; CHECK-SPIRV: %[[#]] = OpFUnordGreaterThan %[[#bool2]] %[[#A]] %[[#B]]
24 ; CHECK-SPIRV: OpFunctionEnd
26 define spir_kernel void @testFUnordGreaterThan(<2 x float> %a, <2 x float> %b) {
28 %0 = fcmp ugt <2 x float> %a, %b
29 store <2 x i1> %0, <2 x i1> addrspace(1)* @var
33 ; CHECK-SPIRV: OpFunction
34 ; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
35 ; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
36 ; CHECK-SPIRV: %[[#]] = OpFUnordGreaterThanEqual %[[#bool2]] %[[#A]] %[[#B]]
37 ; CHECK-SPIRV: OpFunctionEnd
39 define spir_kernel void @testFUnordGreaterThanEqual(<2 x float> %a, <2 x float> %b) {
41 %0 = fcmp uge <2 x float> %a, %b
42 store <2 x i1> %0, <2 x i1> addrspace(1)* @var
46 ; CHECK-SPIRV: OpFunction
47 ; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
48 ; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
49 ; CHECK-SPIRV: %[[#]] = OpFUnordLessThan %[[#bool2]] %[[#A]] %[[#B]]
50 ; CHECK-SPIRV: OpFunctionEnd
52 define spir_kernel void @testFUnordLessThan(<2 x float> %a, <2 x float> %b) {
54 %0 = fcmp ult <2 x float> %a, %b
55 store <2 x i1> %0, <2 x i1> addrspace(1)* @var
59 ; CHECK-SPIRV: OpFunction
60 ; CHECK-SPIRV-NEXT: %[[#A:]] = OpFunctionParameter %[[#]]
61 ; CHECK-SPIRV-NEXT: %[[#B:]] = OpFunctionParameter %[[#]]
62 ; CHECK-SPIRV: %[[#]] = OpFUnordLessThanEqual %[[#bool2]] %[[#A]] %[[#B]]
63 ; CHECK-SPIRV: OpFunctionEnd
65 define spir_kernel void @testFUnordLessThanEqual(<2 x float> %a, <2 x float> %b) {
67 %0 = fcmp ule <2 x float> %a, %b
68 store <2 x i1> %0, <2 x i1> addrspace(1)* @var