1 // RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
3 //===----------------------------------------------------------------------===//
5 //===----------------------------------------------------------------------===//
7 func @iequal_scalar(%arg0: i32, %arg1: i32) -> i1 {
8 // CHECK: spv.IEqual {{.*}}, {{.*}} : i32
9 %0 = spv.IEqual %arg0, %arg1 : i32
15 func @iequal_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
16 // CHECK: spv.IEqual {{.*}}, {{.*}} : vector<4xi32>
17 %0 = spv.IEqual %arg0, %arg1 : vector<4xi32>
18 return %0 : vector<4xi1>
23 //===----------------------------------------------------------------------===//
25 //===----------------------------------------------------------------------===//
27 func @inotequal_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
28 // CHECK: spv.INotEqual {{.*}}, {{.*}} : vector<4xi32>
29 %0 = spv.INotEqual %arg0, %arg1 : vector<4xi32>
30 return %0 : vector<4xi1>
35 //===----------------------------------------------------------------------===//
37 //===----------------------------------------------------------------------===//
39 func @sgt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
40 // CHECK: spv.SGreaterThan {{.*}}, {{.*}} : vector<4xi32>
41 %0 = spv.SGreaterThan %arg0, %arg1 : vector<4xi32>
42 return %0 : vector<4xi1>
47 //===----------------------------------------------------------------------===//
48 // spv.SGreaterThanEqual
49 //===----------------------------------------------------------------------===//
51 func @sge_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
52 // CHECK: spv.SGreaterThanEqual {{.*}}, {{.*}} : vector<4xi32>
53 %0 = spv.SGreaterThanEqual %arg0, %arg1 : vector<4xi32>
54 return %0 : vector<4xi1>
59 //===----------------------------------------------------------------------===//
61 //===----------------------------------------------------------------------===//
63 func @slt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
64 // CHECK: spv.SLessThan {{.*}}, {{.*}} : vector<4xi32>
65 %0 = spv.SLessThan %arg0, %arg1 : vector<4xi32>
66 return %0 : vector<4xi1>
71 //===----------------------------------------------------------------------===//
73 //===----------------------------------------------------------------------===//
75 func @slte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
76 // CHECK: spv.SLessThanEqual {{.*}}, {{.*}} : vector<4xi32>
77 %0 = spv.SLessThanEqual %arg0, %arg1 : vector<4xi32>
78 return %0 : vector<4xi1>
83 //===----------------------------------------------------------------------===//
85 //===----------------------------------------------------------------------===//
87 func @ugt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
88 // CHECK: spv.UGreaterThan {{.*}}, {{.*}} : vector<4xi32>
89 %0 = spv.UGreaterThan %arg0, %arg1 : vector<4xi32>
90 return %0 : vector<4xi1>
95 //===----------------------------------------------------------------------===//
96 // spv.UGreaterThanEqual
97 //===----------------------------------------------------------------------===//
99 func @ugte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
100 // CHECK: spv.UGreaterThanEqual {{.*}}, {{.*}} : vector<4xi32>
101 %0 = spv.UGreaterThanEqual %arg0, %arg1 : vector<4xi32>
102 return %0 : vector<4xi1>
107 //===----------------------------------------------------------------------===//
109 //===----------------------------------------------------------------------===//
111 func @ult_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
112 // CHECK: spv.ULessThan {{.*}}, {{.*}} : vector<4xi32>
113 %0 = spv.ULessThan %arg0, %arg1 : vector<4xi32>
114 return %0 : vector<4xi1>
119 //===----------------------------------------------------------------------===//
120 // spv.ULessThanEqual
121 //===----------------------------------------------------------------------===//
123 func @ulte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
124 // CHECK: spv.ULessThanEqual {{.*}}, {{.*}} : vector<4xi32>
125 %0 = spv.ULessThanEqual %arg0, %arg1 : vector<4xi32>
126 return %0 : vector<4xi1>