@@ -22,7 +22,7 @@ macro simd_cmp($fx:expr, $cc_u:ident|$cc_s:ident|$cc_f:ident($x:ident, $y:ident)
22
22
$x,
23
23
$y,
24
24
$ret,
25
- |fx, lane_layout, res_lane_layout, x_lane, y_lane| {
25
+ & |fx, lane_layout, res_lane_layout, x_lane, y_lane| {
26
26
let res_lane = match lane_layout. ty . kind ( ) {
27
27
ty:: Uint ( _) => fx. bcx . ins ( ) . icmp ( IntCC :: $cc_u, x_lane, y_lane) ,
28
28
ty:: Int ( _) => fx. bcx . ins ( ) . icmp ( IntCC :: $cc_s, x_lane, y_lane) ,
@@ -45,7 +45,7 @@ macro simd_int_binop($fx:expr, $op_u:ident|$op_s:ident($x:ident, $y:ident) -> $r
45
45
$x,
46
46
$y,
47
47
$ret,
48
- |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
48
+ & |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
49
49
match lane_layout. ty . kind ( ) {
50
50
ty:: Uint ( _) => fx. bcx . ins ( ) . $op_u( x_lane, y_lane) ,
51
51
ty:: Int ( _) => fx. bcx . ins ( ) . $op_s( x_lane, y_lane) ,
@@ -62,7 +62,7 @@ macro simd_int_flt_binop($fx:expr, $op_u:ident|$op_s:ident|$op_f:ident($x:ident,
62
62
$x,
63
63
$y,
64
64
$ret,
65
- |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
65
+ & |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
66
66
match lane_layout. ty . kind ( ) {
67
67
ty:: Uint ( _) => fx. bcx . ins ( ) . $op_u( x_lane, y_lane) ,
68
68
ty:: Int ( _) => fx. bcx . ins ( ) . $op_s( x_lane, y_lane) ,
@@ -80,7 +80,7 @@ macro simd_flt_binop($fx:expr, $op:ident($x:ident, $y:ident) -> $ret:ident) {
80
80
$x,
81
81
$y,
82
82
$ret,
83
- |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
83
+ & |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
84
84
match lane_layout. ty . kind ( ) {
85
85
ty:: Float ( _) => fx. bcx . ins ( ) . $op( x_lane, y_lane) ,
86
86
_ => unreachable ! ( "{:?}" , lane_layout. ty) ,
@@ -105,7 +105,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
105
105
106
106
simd_cast, ( c a) {
107
107
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
108
- simd_for_each_lane( fx, a, ret, |fx, lane_layout, ret_lane_layout, lane| {
108
+ simd_for_each_lane( fx, a, ret, & |fx, lane_layout, ret_lane_layout, lane| {
109
109
let ret_lane_ty = fx. clif_type( ret_lane_layout. ty) . unwrap( ) ;
110
110
111
111
let from_signed = type_sign( lane_layout. ty) ;
@@ -277,7 +277,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
277
277
278
278
simd_neg, ( c a) {
279
279
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
280
- simd_for_each_lane( fx, a, ret, |fx, lane_layout, _ret_lane_layout, lane| {
280
+ simd_for_each_lane( fx, a, ret, & |fx, lane_layout, _ret_lane_layout, lane| {
281
281
match lane_layout. ty. kind( ) {
282
282
ty:: Int ( _) => fx. bcx. ins( ) . ineg( lane) ,
283
283
ty:: Float ( _) => fx. bcx. ins( ) . fneg( lane) ,
@@ -288,14 +288,14 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
288
288
289
289
simd_fabs, ( c a) {
290
290
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
291
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
291
+ simd_for_each_lane( fx, a, ret, & |fx, _lane_layout, _ret_lane_layout, lane| {
292
292
fx. bcx. ins( ) . fabs( lane)
293
293
} ) ;
294
294
} ;
295
295
296
296
simd_fsqrt, ( c a) {
297
297
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
298
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
298
+ simd_for_each_lane( fx, a, ret, & |fx, _lane_layout, _ret_lane_layout, lane| {
299
299
fx. bcx. ins( ) . sqrt( lane)
300
300
} ) ;
301
301
} ;
@@ -318,7 +318,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
318
318
} ;
319
319
simd_rem, ( c x, c y) {
320
320
validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
321
- simd_pair_for_each_lane( fx, x, y, ret, |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
321
+ simd_pair_for_each_lane( fx, x, y, ret, & |fx, lane_layout, _ret_lane_layout, x_lane, y_lane| {
322
322
match lane_layout. ty. kind( ) {
323
323
ty:: Uint ( _) => fx. bcx. ins( ) . urem( x_lane, y_lane) ,
324
324
ty:: Int ( _) => fx. bcx. ins( ) . srem( x_lane, y_lane) ,
@@ -393,7 +393,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
393
393
394
394
simd_round, ( c a) {
395
395
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
396
- simd_for_each_lane( fx, a, ret, |fx, lane_layout, _ret_lane_layout, lane| {
396
+ simd_for_each_lane( fx, a, ret, & |fx, lane_layout, _ret_lane_layout, lane| {
397
397
match lane_layout. ty. kind( ) {
398
398
ty:: Float ( FloatTy :: F32 ) => fx. lib_call(
399
399
"roundf" ,
@@ -413,26 +413,26 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
413
413
} ;
414
414
simd_ceil, ( c a) {
415
415
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
416
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
416
+ simd_for_each_lane( fx, a, ret, & |fx, _lane_layout, _ret_lane_layout, lane| {
417
417
fx. bcx. ins( ) . ceil( lane)
418
418
} ) ;
419
419
} ;
420
420
simd_floor, ( c a) {
421
421
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
422
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
422
+ simd_for_each_lane( fx, a, ret, & |fx, _lane_layout, _ret_lane_layout, lane| {
423
423
fx. bcx. ins( ) . floor( lane)
424
424
} ) ;
425
425
} ;
426
426
simd_trunc, ( c a) {
427
427
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
428
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
428
+ simd_for_each_lane( fx, a, ret, & |fx, _lane_layout, _ret_lane_layout, lane| {
429
429
fx. bcx. ins( ) . trunc( lane)
430
430
} ) ;
431
431
} ;
432
432
433
433
simd_reduce_add_ordered | simd_reduce_add_unordered, ( c v, v acc) {
434
434
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
435
- simd_reduce( fx, v, Some ( acc) , ret, |fx, lane_layout, a, b| {
435
+ simd_reduce( fx, v, Some ( acc) , ret, & |fx, lane_layout, a, b| {
436
436
if lane_layout. ty. is_floating_point( ) {
437
437
fx. bcx. ins( ) . fadd( a, b)
438
438
} else {
@@ -443,7 +443,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
443
443
444
444
simd_reduce_mul_ordered | simd_reduce_mul_unordered, ( c v, v acc) {
445
445
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
446
- simd_reduce( fx, v, Some ( acc) , ret, |fx, lane_layout, a, b| {
446
+ simd_reduce( fx, v, Some ( acc) , ret, & |fx, lane_layout, a, b| {
447
447
if lane_layout. ty. is_floating_point( ) {
448
448
fx. bcx. ins( ) . fmul( a, b)
449
449
} else {
@@ -454,32 +454,32 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
454
454
455
455
simd_reduce_all, ( c v) {
456
456
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
457
- simd_reduce_bool( fx, v, ret, |fx, a, b| fx. bcx. ins( ) . band( a, b) ) ;
457
+ simd_reduce_bool( fx, v, ret, & |fx, a, b| fx. bcx. ins( ) . band( a, b) ) ;
458
458
} ;
459
459
460
460
simd_reduce_any, ( c v) {
461
461
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
462
- simd_reduce_bool( fx, v, ret, |fx, a, b| fx. bcx. ins( ) . bor( a, b) ) ;
462
+ simd_reduce_bool( fx, v, ret, & |fx, a, b| fx. bcx. ins( ) . bor( a, b) ) ;
463
463
} ;
464
464
465
465
simd_reduce_and, ( c v) {
466
466
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
467
- simd_reduce( fx, v, None , ret, |fx, _layout, a, b| fx. bcx. ins( ) . band( a, b) ) ;
467
+ simd_reduce( fx, v, None , ret, & |fx, _layout, a, b| fx. bcx. ins( ) . band( a, b) ) ;
468
468
} ;
469
469
470
470
simd_reduce_or, ( c v) {
471
471
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
472
- simd_reduce( fx, v, None , ret, |fx, _layout, a, b| fx. bcx. ins( ) . bor( a, b) ) ;
472
+ simd_reduce( fx, v, None , ret, & |fx, _layout, a, b| fx. bcx. ins( ) . bor( a, b) ) ;
473
473
} ;
474
474
475
475
simd_reduce_xor, ( c v) {
476
476
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
477
- simd_reduce( fx, v, None , ret, |fx, _layout, a, b| fx. bcx. ins( ) . bxor( a, b) ) ;
477
+ simd_reduce( fx, v, None , ret, & |fx, _layout, a, b| fx. bcx. ins( ) . bxor( a, b) ) ;
478
478
} ;
479
479
480
480
simd_reduce_min, ( c v) {
481
481
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
482
- simd_reduce( fx, v, None , ret, |fx, layout, a, b| {
482
+ simd_reduce( fx, v, None , ret, & |fx, layout, a, b| {
483
483
let lt = match layout. ty. kind( ) {
484
484
ty:: Int ( _) => fx. bcx. ins( ) . icmp( IntCC :: SignedLessThan , a, b) ,
485
485
ty:: Uint ( _) => fx. bcx. ins( ) . icmp( IntCC :: UnsignedLessThan , a, b) ,
@@ -492,7 +492,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
492
492
493
493
simd_reduce_max, ( c v) {
494
494
validate_simd_type( fx, intrinsic, span, v. layout( ) . ty) ;
495
- simd_reduce( fx, v, None , ret, |fx, layout, a, b| {
495
+ simd_reduce( fx, v, None , ret, & |fx, layout, a, b| {
496
496
let gt = match layout. ty. kind( ) {
497
497
ty:: Int ( _) => fx. bcx. ins( ) . icmp( IntCC :: SignedGreaterThan , a, b) ,
498
498
ty:: Uint ( _) => fx. bcx. ins( ) . icmp( IntCC :: UnsignedGreaterThan , a, b) ,
0 commit comments