logical-ops.mlir
4.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
//===----------------------------------------------------------------------===//
// spv.IEqual
//===----------------------------------------------------------------------===//
func @iequal_scalar(%arg0: i32, %arg1: i32) -> i1 {
// CHECK: spv.IEqual {{.*}}, {{.*}} : i32
%0 = spv.IEqual %arg0, %arg1 : i32
return %0 : i1
}
// -----
func @iequal_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.IEqual {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.IEqual %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.INotEqual
//===----------------------------------------------------------------------===//
func @inotequal_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.INotEqual {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.INotEqual %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.SGreaterThan
//===----------------------------------------------------------------------===//
func @sgt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.SGreaterThan {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.SGreaterThan %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.SGreaterThanEqual
//===----------------------------------------------------------------------===//
func @sge_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.SGreaterThanEqual {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.SGreaterThanEqual %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.SLessThan
//===----------------------------------------------------------------------===//
func @slt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.SLessThan {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.SLessThan %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.SLessThanEqual
//===----------------------------------------------------------------------===//
func @slte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.SLessThanEqual {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.SLessThanEqual %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.UGreaterThan
//===----------------------------------------------------------------------===//
func @ugt_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.UGreaterThan {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.UGreaterThan %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.UGreaterThanEqual
//===----------------------------------------------------------------------===//
func @ugte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.UGreaterThanEqual {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.UGreaterThanEqual %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.ULessThan
//===----------------------------------------------------------------------===//
func @ult_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.ULessThan {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.ULessThan %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}
// -----
//===----------------------------------------------------------------------===//
// spv.ULessThanEqual
//===----------------------------------------------------------------------===//
func @ulte_vector(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> vector<4xi1> {
// CHECK: spv.ULessThanEqual {{.*}}, {{.*}} : vector<4xi32>
%0 = spv.ULessThanEqual %arg0, %arg1 : vector<4xi32>
return %0 : vector<4xi1>
}