@@ -63,6 +63,30 @@ func.func @erf_caller(%float: f32, %double: f64) -> (f32, f64) {
63
63
return %float_result , %double_result : f32 , f64
64
64
}
65
65
66
+ // CHECK-LABEL: func @erf_vec_caller(
67
+ // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
68
+ // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
69
+ func.func @erf_vec_caller (%float: vector <2 xf32 >, %double: vector <2 xf64 >) -> (vector <2 xf32 >, vector <2 xf64 >) {
70
+ // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
71
+ // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
72
+ // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : vector<2xf32>
73
+ // CHECK: %[[OUT0_F32:.*]] = call @erff(%[[IN0_F32]]) : (f32) -> f32
74
+ // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
75
+ // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : vector<2xf32>
76
+ // CHECK: %[[OUT1_F32:.*]] = call @erff(%[[IN1_F32]]) : (f32) -> f32
77
+ // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
78
+ %float_result = math.erf %float : vector <2 xf32 >
79
+ // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : vector<2xf64>
80
+ // CHECK: %[[OUT0_F64:.*]] = call @erf(%[[IN0_F64]]) : (f64) -> f64
81
+ // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
82
+ // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : vector<2xf64>
83
+ // CHECK: %[[OUT1_F64:.*]] = call @erf(%[[IN1_F64]]) : (f64) -> f64
84
+ // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
85
+ %double_result = math.erf %double : vector <2 xf64 >
86
+ // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
87
+ return %float_result , %double_result : vector <2 xf32 >, vector <2 xf64 >
88
+ }
89
+
66
90
// CHECK-LABEL: func @expm1_caller
67
91
// CHECK-SAME: %[[FLOAT:.*]]: f32
68
92
// CHECK-SAME: %[[DOUBLE:.*]]: f64
@@ -157,3 +181,27 @@ func.func @sin_caller(%float: f32, %double: f64) -> (f32, f64) {
157
181
// CHECK: return %[[FLOAT_RESULT]], %[[DOUBLE_RESULT]]
158
182
return %float_result , %double_result : f32 , f64
159
183
}
184
+
185
+ // CHECK-LABEL: func @round_vec_caller(
186
+ // CHECK-SAME: %[[VAL_0:.*]]: vector<2xf32>,
187
+ // CHECK-SAME: %[[VAL_1:.*]]: vector<2xf64>) -> (vector<2xf32>, vector<2xf64>) {
188
+ func.func @round_vec_caller (%float: vector <2 xf32 >, %double: vector <2 xf64 >) -> (vector <2 xf32 >, vector <2 xf64 >) {
189
+ // CHECK-DAG: %[[CVF:.*]] = arith.constant dense<0.000000e+00> : vector<2xf32>
190
+ // CHECK-DAG: %[[CVD:.*]] = arith.constant dense<0.000000e+00> : vector<2xf64>
191
+ // CHECK: %[[IN0_F32:.*]] = vector.extract %[[VAL_0]][0] : vector<2xf32>
192
+ // CHECK: %[[OUT0_F32:.*]] = call @roundf(%[[IN0_F32]]) : (f32) -> f32
193
+ // CHECK: %[[VAL_8:.*]] = vector.insert %[[OUT0_F32]], %[[CVF]] [0] : f32 into vector<2xf32>
194
+ // CHECK: %[[IN1_F32:.*]] = vector.extract %[[VAL_0]][1] : vector<2xf32>
195
+ // CHECK: %[[OUT1_F32:.*]] = call @roundf(%[[IN1_F32]]) : (f32) -> f32
196
+ // CHECK: %[[VAL_11:.*]] = vector.insert %[[OUT1_F32]], %[[VAL_8]] [1] : f32 into vector<2xf32>
197
+ %float_result = math.round %float : vector <2 xf32 >
198
+ // CHECK: %[[IN0_F64:.*]] = vector.extract %[[VAL_1]][0] : vector<2xf64>
199
+ // CHECK: %[[OUT0_F64:.*]] = call @round(%[[IN0_F64]]) : (f64) -> f64
200
+ // CHECK: %[[VAL_14:.*]] = vector.insert %[[OUT0_F64]], %[[CVD]] [0] : f64 into vector<2xf64>
201
+ // CHECK: %[[IN1_F64:.*]] = vector.extract %[[VAL_1]][1] : vector<2xf64>
202
+ // CHECK: %[[OUT1_F64:.*]] = call @round(%[[IN1_F64]]) : (f64) -> f64
203
+ // CHECK: %[[VAL_17:.*]] = vector.insert %[[OUT1_F64]], %[[VAL_14]] [1] : f64 into vector<2xf64>
204
+ %double_result = math.round %double : vector <2 xf64 >
205
+ // CHECK: return %[[VAL_11]], %[[VAL_17]] : vector<2xf32>, vector<2xf64>
206
+ return %float_result , %double_result : vector <2 xf32 >, vector <2 xf64 >
207
+ }
0 commit comments