@@ -21,7 +21,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
21
21
} ;
22
22
23
23
simd_cast, ( c a) {
24
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
24
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
25
25
simd_for_each_lane( fx, a, ret, |fx, lane_layout, ret_lane_layout, lane| {
26
26
let ret_lane_ty = fx. clif_type( ret_lane_layout. ty) . unwrap( ) ;
27
27
@@ -34,27 +34,27 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
34
34
} ;
35
35
36
36
simd_eq, ( c x, c y) {
37
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
37
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
38
38
simd_cmp!( fx, Equal |Equal ( x, y) -> ret) ;
39
39
} ;
40
40
simd_ne, ( c x, c y) {
41
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
41
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
42
42
simd_cmp!( fx, NotEqual |NotEqual ( x, y) -> ret) ;
43
43
} ;
44
44
simd_lt, ( c x, c y) {
45
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
45
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
46
46
simd_cmp!( fx, UnsignedLessThan |SignedLessThan |LessThan ( x, y) -> ret) ;
47
47
} ;
48
48
simd_le, ( c x, c y) {
49
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
49
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
50
50
simd_cmp!( fx, UnsignedLessThanOrEqual |SignedLessThanOrEqual |LessThanOrEqual ( x, y) -> ret) ;
51
51
} ;
52
52
simd_gt, ( c x, c y) {
53
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
53
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
54
54
simd_cmp!( fx, UnsignedGreaterThan |SignedGreaterThan |GreaterThan ( x, y) -> ret) ;
55
55
} ;
56
56
simd_ge, ( c x, c y) {
57
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
57
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
58
58
simd_cmp!(
59
59
fx,
60
60
UnsignedGreaterThanOrEqual |SignedGreaterThanOrEqual |GreaterThanOrEqual
@@ -64,7 +64,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
64
64
65
65
// simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U
66
66
_ if intrinsic. as_str( ) . starts_with( "simd_shuffle" ) , ( c x, c y, o idx) {
67
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
67
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
68
68
69
69
// If this intrinsic is the older "simd_shuffleN" form, simply parse the integer.
70
70
// If there is no suffix, use the index array length.
@@ -166,7 +166,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
166
166
} ;
167
167
168
168
simd_extract, ( c v, o idx) {
169
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
169
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
170
170
let idx_const = if let Some ( idx_const) = crate :: constant:: mir_operand_get_const_val( fx, idx) {
171
171
idx_const
172
172
} else {
@@ -194,7 +194,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
194
194
} ;
195
195
196
196
simd_neg, ( c a) {
197
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
197
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
198
198
simd_for_each_lane( fx, a, ret, |fx, lane_layout, ret_lane_layout, lane| {
199
199
let ret_lane = match lane_layout. ty. kind( ) {
200
200
ty:: Int ( _) => fx. bcx. ins( ) . ineg( lane) ,
@@ -206,39 +206,39 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
206
206
} ;
207
207
208
208
simd_fabs, ( c a) {
209
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
209
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
210
210
simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
211
211
let ret_lane = fx. bcx. ins( ) . fabs( lane) ;
212
212
CValue :: by_val( ret_lane, ret_lane_layout)
213
213
} ) ;
214
214
} ;
215
215
216
216
simd_fsqrt, ( c a) {
217
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
217
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
218
218
simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
219
219
let ret_lane = fx. bcx. ins( ) . sqrt( lane) ;
220
220
CValue :: by_val( ret_lane, ret_lane_layout)
221
221
} ) ;
222
222
} ;
223
223
224
224
simd_add, ( c x, c y) {
225
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
225
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
226
226
simd_int_flt_binop!( fx, iadd|fadd( x, y) -> ret) ;
227
227
} ;
228
228
simd_sub, ( c x, c y) {
229
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
229
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
230
230
simd_int_flt_binop!( fx, isub|fsub( x, y) -> ret) ;
231
231
} ;
232
232
simd_mul, ( c x, c y) {
233
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
233
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
234
234
simd_int_flt_binop!( fx, imul|fmul( x, y) -> ret) ;
235
235
} ;
236
236
simd_div, ( c x, c y) {
237
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
237
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
238
238
simd_int_flt_binop!( fx, udiv|sdiv|fdiv( x, y) -> ret) ;
239
239
} ;
240
240
simd_rem, ( c x, c y) {
241
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
241
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
242
242
simd_pair_for_each_lane( fx, x, y, ret, |fx, lane_layout, ret_lane_layout, x_lane, y_lane| {
243
243
let res_lane = match lane_layout. ty. kind( ) {
244
244
ty:: Uint ( _) => fx. bcx. ins( ) . urem( x_lane, y_lane) ,
@@ -261,28 +261,28 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
261
261
} ) ;
262
262
} ;
263
263
simd_shl, ( c x, c y) {
264
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
264
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
265
265
simd_int_binop!( fx, ishl( x, y) -> ret) ;
266
266
} ;
267
267
simd_shr, ( c x, c y) {
268
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
268
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
269
269
simd_int_binop!( fx, ushr|sshr( x, y) -> ret) ;
270
270
} ;
271
271
simd_and, ( c x, c y) {
272
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
272
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
273
273
simd_int_binop!( fx, band( x, y) -> ret) ;
274
274
} ;
275
275
simd_or, ( c x, c y) {
276
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
276
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
277
277
simd_int_binop!( fx, bor( x, y) -> ret) ;
278
278
} ;
279
279
simd_xor, ( c x, c y) {
280
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
280
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
281
281
simd_int_binop!( fx, bxor( x, y) -> ret) ;
282
282
} ;
283
283
284
284
simd_fma, ( c a, c b, c c) {
285
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
285
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
286
286
assert_eq!( a. layout( ) , b. layout( ) ) ;
287
287
assert_eq!( a. layout( ) , c. layout( ) ) ;
288
288
let layout = a. layout( ) ;
@@ -305,16 +305,16 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
305
305
} ;
306
306
307
307
simd_fmin, ( c x, c y) {
308
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
308
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
309
309
simd_flt_binop!( fx, fmin( x, y) -> ret) ;
310
310
} ;
311
311
simd_fmax, ( c x, c y) {
312
- validate_simd_type! ( fx, intrinsic, span, x. layout( ) . ty) ;
312
+ validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
313
313
simd_flt_binop!( fx, fmax( x, y) -> ret) ;
314
314
} ;
315
315
316
316
simd_round, ( c a) {
317
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
317
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
318
318
simd_for_each_lane( fx, a, ret, |fx, lane_layout, ret_lane_layout, lane| {
319
319
let res_lane = match lane_layout. ty. kind( ) {
320
320
ty:: Float ( FloatTy :: F32 ) => fx. lib_call(
@@ -335,29 +335,29 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
335
335
} ) ;
336
336
} ;
337
337
simd_ceil, ( c a) {
338
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
338
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
339
339
simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
340
340
let ret_lane = fx. bcx. ins( ) . ceil( lane) ;
341
341
CValue :: by_val( ret_lane, ret_lane_layout)
342
342
} ) ;
343
343
} ;
344
344
simd_floor, ( c a) {
345
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
345
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
346
346
simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
347
347
let ret_lane = fx. bcx. ins( ) . floor( lane) ;
348
348
CValue :: by_val( ret_lane, ret_lane_layout)
349
349
} ) ;
350
350
} ;
351
351
simd_trunc, ( c a) {
352
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
352
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
353
353
simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
354
354
let ret_lane = fx. bcx. ins( ) . trunc( lane) ;
355
355
CValue :: by_val( ret_lane, ret_lane_layout)
356
356
} ) ;
357
357
} ;
358
358
359
359
simd_reduce_add_ordered | simd_reduce_add_unordered, ( c v, v acc) {
360
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
360
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
361
361
simd_reduce( fx, v, Some ( acc) , ret, |fx, lane_layout, a, b| {
362
362
if lane_layout. ty. is_floating_point( ) {
363
363
fx. bcx. ins( ) . fadd( a, b)
@@ -368,7 +368,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
368
368
} ;
369
369
370
370
simd_reduce_mul_ordered | simd_reduce_mul_unordered, ( c v, v acc) {
371
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
371
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
372
372
simd_reduce( fx, v, Some ( acc) , ret, |fx, lane_layout, a, b| {
373
373
if lane_layout. ty. is_floating_point( ) {
374
374
fx. bcx. ins( ) . fmul( a, b)
@@ -379,32 +379,32 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
379
379
} ;
380
380
381
381
simd_reduce_all, ( c v) {
382
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
382
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
383
383
simd_reduce_bool( fx, v, ret, |fx, a, b| fx. bcx. ins( ) . band( a, b) ) ;
384
384
} ;
385
385
386
386
simd_reduce_any, ( c v) {
387
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
387
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
388
388
simd_reduce_bool( fx, v, ret, |fx, a, b| fx. bcx. ins( ) . bor( a, b) ) ;
389
389
} ;
390
390
391
391
simd_reduce_and, ( c v) {
392
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
392
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
393
393
simd_reduce( fx, v, None , ret, |fx, _layout, a, b| fx. bcx. ins( ) . band( a, b) ) ;
394
394
} ;
395
395
396
396
simd_reduce_or, ( c v) {
397
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
397
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
398
398
simd_reduce( fx, v, None , ret, |fx, _layout, a, b| fx. bcx. ins( ) . bor( a, b) ) ;
399
399
} ;
400
400
401
401
simd_reduce_xor, ( c v) {
402
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
402
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
403
403
simd_reduce( fx, v, None , ret, |fx, _layout, a, b| fx. bcx. ins( ) . bxor( a, b) ) ;
404
404
} ;
405
405
406
406
simd_reduce_min, ( c v) {
407
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
407
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
408
408
simd_reduce( fx, v, None , ret, |fx, layout, a, b| {
409
409
let lt = match layout. ty. kind( ) {
410
410
ty:: Int ( _) => fx. bcx. ins( ) . icmp( IntCC :: SignedLessThan , a, b) ,
@@ -417,7 +417,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
417
417
} ;
418
418
419
419
simd_reduce_max, ( c v) {
420
- validate_simd_type! ( fx, intrinsic, span, v. layout( ) . ty) ;
420
+ validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
421
421
simd_reduce( fx, v, None , ret, |fx, layout, a, b| {
422
422
let gt = match layout. ty. kind( ) {
423
423
ty:: Int ( _) => fx. bcx. ins( ) . icmp( IntCC :: SignedGreaterThan , a, b) ,
@@ -430,8 +430,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
430
430
} ;
431
431
432
432
simd_select, ( c m, c a, c b) {
433
- validate_simd_type! ( fx, intrinsic, span, m. layout( ) . ty) ;
434
- validate_simd_type! ( fx, intrinsic, span, a. layout( ) . ty) ;
433
+ validate_simd_type( fx, intrinsic, span, m. layout( ) . ty) ;
434
+ validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
435
435
assert_eq!( a. layout( ) , b. layout( ) ) ;
436
436
437
437
let ( lane_count, lane_ty) = a. layout( ) . ty. simd_size_and_type( fx. tcx) ;
0 commit comments