| 1 |
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 2 |
|
| 3 |
; CHECK-SPIRV: %[[#bool:]] = OpTypeBool |
| 4 |
; CHECK-SPIRV: %[[#bool2:]] = OpTypeVector %[[#bool]] 2 |
| 5 |
|
| 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 |
| 11 |
|
| 12 |
@var = addrspace(1) global <2 x i1> zeroinitializer |
| 13 |
define spir_kernel void @testFUnordEqual(<2 x float> %a, <2 x float> %b) { |
| 14 |
entry: |
| 15 |
%0 = fcmp ueq <2 x float> %a, %b |
| 16 |
store <2 x i1> %0, ptr addrspace(1) @var |
| 17 |
ret void |
| 18 |
} |
| 19 |
|
| 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 |
| 25 |
|
| 26 |
define spir_kernel void @testFUnordGreaterThan(<2 x float> %a, <2 x float> %b) { |
| 27 |
entry: |
| 28 |
%0 = fcmp ugt <2 x float> %a, %b |
| 29 |
store <2 x i1> %0, ptr addrspace(1) @var |
| 30 |
ret void |
| 31 |
} |
| 32 |
|
| 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 |
| 38 |
|
| 39 |
define spir_kernel void @testFUnordGreaterThanEqual(<2 x float> %a, <2 x float> %b) { |
| 40 |
entry: |
| 41 |
%0 = fcmp uge <2 x float> %a, %b |
| 42 |
store <2 x i1> %0, ptr addrspace(1) @var |
| 43 |
ret void |
| 44 |
} |
| 45 |
|
| 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 |
| 51 |
|
| 52 |
define spir_kernel void @testFUnordLessThan(<2 x float> %a, <2 x float> %b) { |
| 53 |
entry: |
| 54 |
%0 = fcmp ult <2 x float> %a, %b |
| 55 |
store <2 x i1> %0, ptr addrspace(1) @var |
| 56 |
ret void |
| 57 |
} |
| 58 |
|
| 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 |
| 64 |
|
| 65 |
define spir_kernel void @testFUnordLessThanEqual(<2 x float> %a, <2 x float> %b) { |
| 66 |
entry: |
| 67 |
%0 = fcmp ule <2 x float> %a, %b |
| 68 |
store <2 x i1> %0, ptr addrspace(1) @var |
| 69 |
ret void |
| 70 |
} |