@@ -33,9 +33,7 @@ macro simd_cmp($fx:expr, $cc_u:ident|$cc_s:ident|$cc_f:ident($x:ident, $y:ident)
33
33
let ty = fx. clif_type ( res_lane_layout. ty ) . unwrap ( ) ;
34
34
35
35
let res_lane = fx. bcx . ins ( ) . bint ( ty, res_lane) ;
36
- let res_lane = fx. bcx . ins ( ) . ineg ( res_lane) ;
37
-
38
- CValue :: by_val ( res_lane, res_lane_layout)
36
+ fx. bcx . ins ( ) . ineg ( res_lane)
39
37
} ,
40
38
) ;
41
39
}
@@ -47,13 +45,12 @@ macro simd_int_binop($fx:expr, $op_u:ident|$op_s:ident($x:ident, $y:ident) -> $r
47
45
$x,
48
46
$y,
49
47
$ret,
50
- |fx, lane_layout, ret_lane_layout , x_lane, y_lane| {
51
- let res_lane = match lane_layout. ty . kind ( ) {
48
+ |fx, lane_layout, _ret_lane_layout , x_lane, y_lane| {
49
+ match lane_layout. ty . kind ( ) {
52
50
ty:: Uint ( _) => fx. bcx . ins ( ) . $op_u( x_lane, y_lane) ,
53
51
ty:: Int ( _) => fx. bcx . ins ( ) . $op_s( x_lane, y_lane) ,
54
52
_ => unreachable ! ( "{:?}" , lane_layout. ty) ,
55
- } ;
56
- CValue :: by_val ( res_lane, ret_lane_layout)
53
+ }
57
54
} ,
58
55
) ;
59
56
}
@@ -65,14 +62,13 @@ macro simd_int_flt_binop($fx:expr, $op_u:ident|$op_s:ident|$op_f:ident($x:ident,
65
62
$x,
66
63
$y,
67
64
$ret,
68
- |fx, lane_layout, ret_lane_layout , x_lane, y_lane| {
69
- let res_lane = match lane_layout. ty . kind ( ) {
65
+ |fx, lane_layout, _ret_lane_layout , x_lane, y_lane| {
66
+ match lane_layout. ty . kind ( ) {
70
67
ty:: Uint ( _) => fx. bcx . ins ( ) . $op_u( x_lane, y_lane) ,
71
68
ty:: Int ( _) => fx. bcx . ins ( ) . $op_s( x_lane, y_lane) ,
72
69
ty:: Float ( _) => fx. bcx . ins ( ) . $op_f( x_lane, y_lane) ,
73
70
_ => unreachable ! ( "{:?}" , lane_layout. ty) ,
74
- } ;
75
- CValue :: by_val ( res_lane, ret_lane_layout)
71
+ }
76
72
} ,
77
73
) ;
78
74
}
@@ -84,12 +80,11 @@ macro simd_flt_binop($fx:expr, $op:ident($x:ident, $y:ident) -> $ret:ident) {
84
80
$x,
85
81
$y,
86
82
$ret,
87
- |fx, lane_layout, ret_lane_layout , x_lane, y_lane| {
88
- let res_lane = match lane_layout. ty . kind ( ) {
83
+ |fx, lane_layout, _ret_lane_layout , x_lane, y_lane| {
84
+ match lane_layout. ty . kind ( ) {
89
85
ty:: Float ( _) => fx. bcx . ins ( ) . $op( x_lane, y_lane) ,
90
86
_ => unreachable ! ( "{:?}" , lane_layout. ty) ,
91
- } ;
92
- CValue :: by_val ( res_lane, ret_lane_layout)
87
+ }
93
88
} ,
94
89
) ;
95
90
}
@@ -116,8 +111,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
116
111
let from_signed = type_sign( lane_layout. ty) ;
117
112
let to_signed = type_sign( ret_lane_layout. ty) ;
118
113
119
- let ret_lane = clif_int_or_float_cast( fx, lane, from_signed, ret_lane_ty, to_signed) ;
120
- CValue :: by_val( ret_lane, ret_lane_layout)
114
+ clif_int_or_float_cast( fx, lane, from_signed, ret_lane_ty, to_signed)
121
115
} ) ;
122
116
} ;
123
117
@@ -283,29 +277,26 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
283
277
284
278
simd_neg, ( c a) {
285
279
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
286
- simd_for_each_lane( fx, a, ret, |fx, lane_layout, ret_lane_layout , lane| {
287
- let ret_lane = match lane_layout. ty. kind( ) {
280
+ simd_for_each_lane( fx, a, ret, |fx, lane_layout, _ret_lane_layout , lane| {
281
+ match lane_layout. ty. kind( ) {
288
282
ty:: Int ( _) => fx. bcx. ins( ) . ineg( lane) ,
289
283
ty:: Float ( _) => fx. bcx. ins( ) . fneg( lane) ,
290
284
_ => unreachable!( ) ,
291
- } ;
292
- CValue :: by_val( ret_lane, ret_lane_layout)
285
+ }
293
286
} ) ;
294
287
} ;
295
288
296
289
simd_fabs, ( c a) {
297
290
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
298
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
299
- let ret_lane = fx. bcx. ins( ) . fabs( lane) ;
300
- CValue :: by_val( ret_lane, ret_lane_layout)
291
+ simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
292
+ fx. bcx. ins( ) . fabs( lane)
301
293
} ) ;
302
294
} ;
303
295
304
296
simd_fsqrt, ( c a) {
305
297
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
306
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
307
- let ret_lane = fx. bcx. ins( ) . sqrt( lane) ;
308
- CValue :: by_val( ret_lane, ret_lane_layout)
298
+ simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
299
+ fx. bcx. ins( ) . sqrt( lane)
309
300
} ) ;
310
301
} ;
311
302
@@ -327,8 +318,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
327
318
} ;
328
319
simd_rem, ( c x, c y) {
329
320
validate_simd_type( fx, intrinsic, span, x. layout( ) . ty) ;
330
- simd_pair_for_each_lane( fx, x, y, ret, |fx, lane_layout, ret_lane_layout , x_lane, y_lane| {
331
- let res_lane = match lane_layout. ty. kind( ) {
321
+ simd_pair_for_each_lane( fx, x, y, ret, |fx, lane_layout, _ret_lane_layout , x_lane, y_lane| {
322
+ match lane_layout. ty. kind( ) {
332
323
ty:: Uint ( _) => fx. bcx. ins( ) . urem( x_lane, y_lane) ,
333
324
ty:: Int ( _) => fx. bcx. ins( ) . srem( x_lane, y_lane) ,
334
325
ty:: Float ( FloatTy :: F32 ) => fx. lib_call(
@@ -344,8 +335,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
344
335
& [ x_lane, y_lane] ,
345
336
) [ 0 ] ,
346
337
_ => unreachable!( "{:?}" , lane_layout. ty) ,
347
- } ;
348
- CValue :: by_val( res_lane, ret_lane_layout)
338
+ }
349
339
} ) ;
350
340
} ;
351
341
simd_shl, ( c x, c y) {
@@ -403,8 +393,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
403
393
404
394
simd_round, ( c a) {
405
395
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
406
- simd_for_each_lane( fx, a, ret, |fx, lane_layout, ret_lane_layout , lane| {
407
- let res_lane = match lane_layout. ty. kind( ) {
396
+ simd_for_each_lane( fx, a, ret, |fx, lane_layout, _ret_lane_layout , lane| {
397
+ match lane_layout. ty. kind( ) {
408
398
ty:: Float ( FloatTy :: F32 ) => fx. lib_call(
409
399
"roundf" ,
410
400
vec![ AbiParam :: new( types:: F32 ) ] ,
@@ -418,29 +408,25 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
418
408
& [ lane] ,
419
409
) [ 0 ] ,
420
410
_ => unreachable!( "{:?}" , lane_layout. ty) ,
421
- } ;
422
- CValue :: by_val( res_lane, ret_lane_layout)
411
+ }
423
412
} ) ;
424
413
} ;
425
414
simd_ceil, ( c a) {
426
415
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
427
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
428
- let ret_lane = fx. bcx. ins( ) . ceil( lane) ;
429
- CValue :: by_val( ret_lane, ret_lane_layout)
416
+ simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
417
+ fx. bcx. ins( ) . ceil( lane)
430
418
} ) ;
431
419
} ;
432
420
simd_floor, ( c a) {
433
421
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
434
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
435
- let ret_lane = fx. bcx. ins( ) . floor( lane) ;
436
- CValue :: by_val( ret_lane, ret_lane_layout)
422
+ simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
423
+ fx. bcx. ins( ) . floor( lane)
437
424
} ) ;
438
425
} ;
439
426
simd_trunc, ( c a) {
440
427
validate_simd_type( fx, intrinsic, span, a. layout( ) . ty) ;
441
- simd_for_each_lane( fx, a, ret, |fx, _lane_layout, ret_lane_layout, lane| {
442
- let ret_lane = fx. bcx. ins( ) . trunc( lane) ;
443
- CValue :: by_val( ret_lane, ret_lane_layout)
428
+ simd_for_each_lane( fx, a, ret, |fx, _lane_layout, _ret_lane_layout, lane| {
429
+ fx. bcx. ins( ) . trunc( lane)
444
430
} ) ;
445
431
} ;
446
432
0 commit comments