@@ -4,83 +4,91 @@ module attributes { spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Kerne
4
4
5
5
// CHECK-LABEL: @float32_unary_scalar
6
6
func.func @float32_unary_scalar (%arg0: f32 ) {
7
+ // CHECK: spirv.CL.atan %{{.*}}: f32
8
+ %0 = math.atan %arg0 : f32
7
9
// CHECK: spirv.CL.cos %{{.*}}: f32
8
- %0 = math.cos %arg0 : f32
10
+ %1 = math.cos %arg0 : f32
9
11
// CHECK: spirv.CL.exp %{{.*}}: f32
10
- %1 = math.exp %arg0 : f32
12
+ %2 = math.exp %arg0 : f32
11
13
// CHECK: %[[EXP:.+]] = spirv.CL.exp %arg0
12
14
// CHECK: %[[ONE:.+]] = spirv.Constant 1.000000e+00 : f32
13
15
// CHECK: spirv.FSub %[[EXP]], %[[ONE]]
14
- %2 = math.expm1 %arg0 : f32
16
+ %3 = math.expm1 %arg0 : f32
15
17
// CHECK: spirv.CL.log %{{.*}}: f32
16
- %3 = math.log %arg0 : f32
18
+ %4 = math.log %arg0 : f32
17
19
// CHECK: %[[ONE:.+]] = spirv.Constant 1.000000e+00 : f32
18
20
// CHECK: %[[ADDONE:.+]] = spirv.FAdd %[[ONE]], %{{.+}}
19
21
// CHECK: spirv.CL.log %[[ADDONE]]
20
- %4 = math.log1p %arg0 : f32
22
+ %5 = math.log1p %arg0 : f32
21
23
// CHECK: spirv.CL.rint %{{.*}}: f32
22
- %5 = math.roundeven %arg0 : f32
24
+ %6 = math.roundeven %arg0 : f32
23
25
// CHECK: spirv.CL.rsqrt %{{.*}}: f32
24
- %6 = math.rsqrt %arg0 : f32
26
+ %7 = math.rsqrt %arg0 : f32
25
27
// CHECK: spirv.CL.sqrt %{{.*}}: f32
26
- %7 = math.sqrt %arg0 : f32
28
+ %8 = math.sqrt %arg0 : f32
27
29
// CHECK: spirv.CL.tanh %{{.*}}: f32
28
- %8 = math.tanh %arg0 : f32
30
+ %9 = math.tanh %arg0 : f32
29
31
// CHECK: spirv.CL.sin %{{.*}}: f32
30
- %9 = math.sin %arg0 : f32
32
+ %10 = math.sin %arg0 : f32
31
33
// CHECK: spirv.CL.fabs %{{.*}}: f32
32
- %10 = math.absf %arg0 : f32
34
+ %11 = math.absf %arg0 : f32
33
35
// CHECK: spirv.CL.ceil %{{.*}}: f32
34
- %11 = math.ceil %arg0 : f32
36
+ %12 = math.ceil %arg0 : f32
35
37
// CHECK: spirv.CL.floor %{{.*}}: f32
36
- %12 = math.floor %arg0 : f32
38
+ %13 = math.floor %arg0 : f32
37
39
// CHECK: spirv.CL.erf %{{.*}}: f32
38
- %13 = math.erf %arg0 : f32
40
+ %14 = math.erf %arg0 : f32
39
41
// CHECK: spirv.CL.round %{{.*}}: f32
40
- %14 = math.round %arg0 : f32
42
+ %15 = math.round %arg0 : f32
41
43
return
42
44
}
43
45
44
46
// CHECK-LABEL: @float32_unary_vector
45
47
func.func @float32_unary_vector (%arg0: vector <3 xf32 >) {
48
+ // CHECK: spirv.CL.atan %{{.*}}: vector<3xf32>
49
+ %0 = math.atan %arg0 : vector <3 xf32 >
46
50
// CHECK: spirv.CL.cos %{{.*}}: vector<3xf32>
47
- %0 = math.cos %arg0 : vector <3 xf32 >
51
+ %1 = math.cos %arg0 : vector <3 xf32 >
48
52
// CHECK: spirv.CL.exp %{{.*}}: vector<3xf32>
49
- %1 = math.exp %arg0 : vector <3 xf32 >
53
+ %2 = math.exp %arg0 : vector <3 xf32 >
50
54
// CHECK: %[[EXP:.+]] = spirv.CL.exp %arg0
51
55
// CHECK: %[[ONE:.+]] = spirv.Constant dense<1.000000e+00> : vector<3xf32>
52
56
// CHECK: spirv.FSub %[[EXP]], %[[ONE]]
53
- %2 = math.expm1 %arg0 : vector <3 xf32 >
57
+ %3 = math.expm1 %arg0 : vector <3 xf32 >
54
58
// CHECK: spirv.CL.log %{{.*}}: vector<3xf32>
55
- %3 = math.log %arg0 : vector <3 xf32 >
59
+ %4 = math.log %arg0 : vector <3 xf32 >
56
60
// CHECK: %[[ONE:.+]] = spirv.Constant dense<1.000000e+00> : vector<3xf32>
57
61
// CHECK: %[[ADDONE:.+]] = spirv.FAdd %[[ONE]], %{{.+}}
58
62
// CHECK: spirv.CL.log %[[ADDONE]]
59
- %4 = math.log1p %arg0 : vector <3 xf32 >
63
+ %5 = math.log1p %arg0 : vector <3 xf32 >
60
64
// CHECK: spirv.CL.rint %{{.*}}: vector<3xf32>
61
- %5 = math.roundeven %arg0 : vector <3 xf32 >
65
+ %6 = math.roundeven %arg0 : vector <3 xf32 >
62
66
// CHECK: spirv.CL.rsqrt %{{.*}}: vector<3xf32>
63
- %6 = math.rsqrt %arg0 : vector <3 xf32 >
67
+ %7 = math.rsqrt %arg0 : vector <3 xf32 >
64
68
// CHECK: spirv.CL.sqrt %{{.*}}: vector<3xf32>
65
- %7 = math.sqrt %arg0 : vector <3 xf32 >
69
+ %8 = math.sqrt %arg0 : vector <3 xf32 >
66
70
// CHECK: spirv.CL.tanh %{{.*}}: vector<3xf32>
67
- %8 = math.tanh %arg0 : vector <3 xf32 >
71
+ %9 = math.tanh %arg0 : vector <3 xf32 >
68
72
// CHECK: spirv.CL.sin %{{.*}}: vector<3xf32>
69
- %9 = math.sin %arg0 : vector <3 xf32 >
73
+ %10 = math.sin %arg0 : vector <3 xf32 >
70
74
return
71
75
}
72
76
73
77
// CHECK-LABEL: @float32_binary_scalar
74
78
func.func @float32_binary_scalar (%lhs: f32 , %rhs: f32 ) {
79
+ // CHECK: spirv.CL.atan2 %{{.*}}: f32
80
+ %0 = math.atan2 %lhs , %rhs : f32
75
81
// CHECK: spirv.CL.pow %{{.*}}: f32
76
- %0 = math.powf %lhs , %rhs : f32
82
+ %1 = math.powf %lhs , %rhs : f32
77
83
return
78
84
}
79
85
80
86
// CHECK-LABEL: @float32_binary_vector
81
87
func.func @float32_binary_vector (%lhs: vector <4 xf32 >, %rhs: vector <4 xf32 >) {
88
+ // CHECK: spirv.CL.atan2 %{{.*}}: vector<4xf32>
89
+ %0 = math.atan2 %lhs , %rhs : vector <4 xf32 >
82
90
// CHECK: spirv.CL.pow %{{.*}}: vector<4xf32>
83
- %0 = math.powf %lhs , %rhs : vector <4 xf32 >
91
+ %1 = math.powf %lhs , %rhs : vector <4 xf32 >
84
92
return
85
93
}
86
94
@@ -118,18 +126,20 @@ module attributes {
118
126
119
127
// CHECK-LABEL: @vector_2d
120
128
func.func @vector_2d (%arg0: vector <2 x2 xf32 >) {
129
+ // CHECK-NEXT: math.atan {{.+}} : vector<2x2xf32>
130
+ %0 = math.atan %arg0 : vector <2 x2 xf32 >
121
131
// CHECK-NEXT: math.cos {{.+}} : vector<2x2xf32>
122
- %0 = math.cos %arg0 : vector <2 x2 xf32 >
132
+ %1 = math.cos %arg0 : vector <2 x2 xf32 >
123
133
// CHECK-NEXT: math.exp {{.+}} : vector<2x2xf32>
124
- %1 = math.exp %arg0 : vector <2 x2 xf32 >
134
+ %2 = math.exp %arg0 : vector <2 x2 xf32 >
125
135
// CHECK-NEXT: math.absf {{.+}} : vector<2x2xf32>
126
- %2 = math.absf %arg0 : vector <2 x2 xf32 >
136
+ %3 = math.absf %arg0 : vector <2 x2 xf32 >
127
137
// CHECK-NEXT: math.ceil {{.+}} : vector<2x2xf32>
128
- %3 = math.ceil %arg0 : vector <2 x2 xf32 >
138
+ %4 = math.ceil %arg0 : vector <2 x2 xf32 >
129
139
// CHECK-NEXT: math.floor {{.+}} : vector<2x2xf32>
130
- %4 = math.floor %arg0 : vector <2 x2 xf32 >
140
+ %5 = math.floor %arg0 : vector <2 x2 xf32 >
131
141
// CHECK-NEXT: math.powf {{.+}}, {{%.+}} : vector<2x2xf32>
132
- %5 = math.powf %arg0 , %arg0 : vector <2 x2 xf32 >
142
+ %6 = math.powf %arg0 , %arg0 : vector <2 x2 xf32 >
133
143
// CHECK-NEXT: return
134
144
return
135
145
}
@@ -138,18 +148,20 @@ func.func @vector_2d(%arg0: vector<2x2xf32>) {
138
148
139
149
// CHECK-LABEL: @tensor_1d
140
150
func.func @tensor_1d (%arg0: tensor <2 xf32 >) {
151
+ // CHECK-NEXT: math.atan {{.+}} : tensor<2xf32>
152
+ %0 = math.atan %arg0 : tensor <2 xf32 >
141
153
// CHECK-NEXT: math.cos {{.+}} : tensor<2xf32>
142
- %0 = math.cos %arg0 : tensor <2 xf32 >
154
+ %1 = math.cos %arg0 : tensor <2 xf32 >
143
155
// CHECK-NEXT: math.exp {{.+}} : tensor<2xf32>
144
- %1 = math.exp %arg0 : tensor <2 xf32 >
156
+ %2 = math.exp %arg0 : tensor <2 xf32 >
145
157
// CHECK-NEXT: math.absf {{.+}} : tensor<2xf32>
146
- %2 = math.absf %arg0 : tensor <2 xf32 >
158
+ %3 = math.absf %arg0 : tensor <2 xf32 >
147
159
// CHECK-NEXT: math.ceil {{.+}} : tensor<2xf32>
148
- %3 = math.ceil %arg0 : tensor <2 xf32 >
160
+ %4 = math.ceil %arg0 : tensor <2 xf32 >
149
161
// CHECK-NEXT: math.floor {{.+}} : tensor<2xf32>
150
- %4 = math.floor %arg0 : tensor <2 xf32 >
162
+ %5 = math.floor %arg0 : tensor <2 xf32 >
151
163
// CHECK-NEXT: math.powf {{.+}}, {{%.+}} : tensor<2xf32>
152
- %5 = math.powf %arg0 , %arg0 : tensor <2 xf32 >
164
+ %6 = math.powf %arg0 , %arg0 : tensor <2 xf32 >
153
165
// CHECK-NEXT: return
154
166
return
155
167
}
0 commit comments