@@ -71,11 +71,11 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
71
71
let expected_bytes = len / 8 + ( ( len % 8 > 0 ) as u64 ) ;
72
72
73
73
let mask_ty = arg_tys[ 0 ] ;
74
- let mut mask = match mask_ty. kind ( ) {
74
+ let mut mask = match * mask_ty. kind ( ) {
75
75
ty:: Int ( i) if i. bit_width ( ) == Some ( expected_int_bits) => args[ 0 ] . immediate ( ) ,
76
76
ty:: Uint ( i) if i. bit_width ( ) == Some ( expected_int_bits) => args[ 0 ] . immediate ( ) ,
77
77
ty:: Array ( elem, len)
78
- if matches ! ( elem. kind( ) , ty:: Uint ( ty:: UintTy :: U8 ) )
78
+ if matches ! ( * elem. kind( ) , ty:: Uint ( ty:: UintTy :: U8 ) )
79
79
&& len. try_eval_target_usize ( bx. tcx , ty:: ParamEnv :: reveal_all ( ) )
80
80
== Some ( expected_bytes) =>
81
81
{
@@ -353,8 +353,8 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
353
353
if name == sym:: simd_shuffle {
354
354
// Make sure this is actually an array, since typeck only checks the length-suffixed
355
355
// version of this intrinsic.
356
- let n: u64 = match args[ 2 ] . layout . ty . kind ( ) {
357
- ty:: Array ( ty, len) if matches ! ( ty. kind( ) , ty:: Uint ( ty:: UintTy :: U32 ) ) => {
356
+ let n: u64 = match * args[ 2 ] . layout . ty . kind ( ) {
357
+ ty:: Array ( ty, len) if matches ! ( * ty. kind( ) , ty:: Uint ( ty:: UintTy :: U32 ) ) => {
358
358
len. try_eval_target_usize ( bx. cx . tcx , ty:: ParamEnv :: reveal_all ( ) ) . unwrap_or_else (
359
359
|| span_bug ! ( span, "could not evaluate shuffle index array length" ) ,
360
360
)
@@ -427,7 +427,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
427
427
m_len == v_len,
428
428
InvalidMonomorphization :: MismatchedLengths { span, name, m_len, v_len }
429
429
) ;
430
- match m_elem_ty. kind ( ) {
430
+ match * m_elem_ty. kind ( ) {
431
431
ty:: Int ( _) => { }
432
432
_ => return_error ! ( InvalidMonomorphization :: MaskType { span, name, ty: m_elem_ty } ) ,
433
433
}
@@ -460,13 +460,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
460
460
Unsupported ,
461
461
}
462
462
463
- let in_style = match in_elem. kind ( ) {
463
+ let in_style = match * in_elem. kind ( ) {
464
464
ty:: Int ( _) | ty:: Uint ( _) => Style :: Int ,
465
465
ty:: Float ( _) => Style :: Float ,
466
466
_ => Style :: Unsupported ,
467
467
} ;
468
468
469
- let out_style = match out_elem. kind ( ) {
469
+ let out_style = match * out_elem. kind ( ) {
470
470
ty:: Int ( _) | ty:: Uint ( _) => Style :: Int ,
471
471
ty:: Float ( _) => Style :: Float ,
472
472
_ => Style :: Unsupported ,
@@ -493,7 +493,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
493
493
macro_rules! arith_binary {
494
494
( $( $name: ident: $( $( $p: ident) ,* => $call: ident) ,* ; ) * ) => {
495
495
$( if name == sym:: $name {
496
- match in_elem. kind( ) {
496
+ match * in_elem. kind( ) {
497
497
$( $( ty:: $p( _) ) |* => {
498
498
return Ok ( bx. $call( args[ 0 ] . immediate( ) , args[ 1 ] . immediate( ) ) )
499
499
} ) *
@@ -543,13 +543,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
543
543
shift += 1 ;
544
544
}
545
545
546
- match ret_ty. kind ( ) {
546
+ match * ret_ty. kind ( ) {
547
547
ty:: Uint ( i) if i. bit_width ( ) == Some ( expected_int_bits) => {
548
548
// Zero-extend iN to the bitmask type:
549
549
return Ok ( result) ;
550
550
}
551
551
ty:: Array ( elem, len)
552
- if matches ! ( elem. kind( ) , ty:: Uint ( ty:: UintTy :: U8 ) )
552
+ if matches ! ( * elem. kind( ) , ty:: Uint ( ty:: UintTy :: U8 ) )
553
553
&& len. try_eval_target_usize ( bx. tcx , ty:: ParamEnv :: reveal_all ( ) )
554
554
== Some ( expected_bytes) =>
555
555
{
@@ -588,7 +588,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
588
588
return Err ( ( ) ) ;
589
589
} } ;
590
590
}
591
- let ( elem_ty_str, elem_ty) = if let ty:: Float ( f) = in_elem. kind ( ) {
591
+ let ( elem_ty_str, elem_ty) = if let ty:: Float ( ref f) = * in_elem. kind ( ) {
592
592
let elem_ty = bx. cx . type_float_from_ty ( * f) ;
593
593
match f. bit_width ( ) {
594
594
32 => ( "f" , elem_ty) ,
@@ -795,15 +795,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
795
795
796
796
// This counts how many pointers
797
797
fn ptr_count ( t : Ty < ' _ > ) -> usize {
798
- match t. kind ( ) {
798
+ match * t. kind ( ) {
799
799
ty:: RawPtr ( p) => 1 + ptr_count ( p. ty ) ,
800
800
_ => 0 ,
801
801
}
802
802
}
803
803
804
804
// Non-ptr type
805
805
fn non_ptr ( t : Ty < ' _ > ) -> Ty < ' _ > {
806
- match t. kind ( ) {
806
+ match * t. kind ( ) {
807
807
ty:: RawPtr ( p) => non_ptr ( p. ty ) ,
808
808
_ => t,
809
809
}
@@ -813,7 +813,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
813
813
// to the element type of the first argument
814
814
let ( _, element_ty0) = arg_tys[ 0 ] . simd_size_and_type ( bx. tcx ( ) ) ;
815
815
let ( _, element_ty1) = arg_tys[ 1 ] . simd_size_and_type ( bx. tcx ( ) ) ;
816
- let ( pointer_count, underlying_ty) = match element_ty1. kind ( ) {
816
+ let ( pointer_count, underlying_ty) = match * element_ty1. kind ( ) {
817
817
ty:: RawPtr ( p) if p. ty == in_elem => ( ptr_count ( element_ty1) , non_ptr ( element_ty1) ) ,
818
818
_ => {
819
819
require ! (
@@ -837,7 +837,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
837
837
838
838
// The element type of the third argument must be a signed integer type of any width:
839
839
let ( _, element_ty2) = arg_tys[ 2 ] . simd_size_and_type ( bx. tcx ( ) ) ;
840
- match element_ty2. kind ( ) {
840
+ match * element_ty2. kind ( ) {
841
841
ty:: Int ( _) => ( ) ,
842
842
_ => {
843
843
require ! (
@@ -909,15 +909,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
909
909
910
910
// This counts how many pointers
911
911
fn ptr_count ( t : Ty < ' _ > ) -> usize {
912
- match t. kind ( ) {
912
+ match * t. kind ( ) {
913
913
ty:: RawPtr ( p) => 1 + ptr_count ( p. ty ) ,
914
914
_ => 0 ,
915
915
}
916
916
}
917
917
918
918
// Non-ptr type
919
919
fn non_ptr ( t : Ty < ' _ > ) -> Ty < ' _ > {
920
- match t. kind ( ) {
920
+ match * t. kind ( ) {
921
921
ty:: RawPtr ( p) => non_ptr ( p. ty ) ,
922
922
_ => t,
923
923
}
@@ -928,7 +928,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
928
928
let ( _, element_ty0) = arg_tys[ 0 ] . simd_size_and_type ( bx. tcx ( ) ) ;
929
929
let ( _, element_ty1) = arg_tys[ 1 ] . simd_size_and_type ( bx. tcx ( ) ) ;
930
930
let ( _, element_ty2) = arg_tys[ 2 ] . simd_size_and_type ( bx. tcx ( ) ) ;
931
- let ( pointer_count, underlying_ty) = match element_ty1. kind ( ) {
931
+ let ( pointer_count, underlying_ty) = match * element_ty1. kind ( ) {
932
932
ty:: RawPtr ( p) if p. ty == in_elem && p. mutbl == hir:: Mutability :: Mut => {
933
933
( ptr_count ( element_ty1) , non_ptr ( element_ty1) )
934
934
}
@@ -953,7 +953,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
953
953
assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
954
954
955
955
// The element type of the third argument must be a signed integer type of any width:
956
- match element_ty2. kind ( ) {
956
+ match * element_ty2. kind ( ) {
957
957
ty:: Int ( _) => ( ) ,
958
958
_ => {
959
959
require ! (
@@ -1011,7 +1011,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1011
1011
macro_rules! arith_unary {
1012
1012
( $( $name: ident: $( $( $p: ident) ,* => $call: ident) ,* ; ) * ) => {
1013
1013
$( if name == sym:: $name {
1014
- match in_elem. kind( ) {
1014
+ match * in_elem. kind( ) {
1015
1015
$( $( ty:: $p( _) ) |* => {
1016
1016
return Ok ( bx. $call( args[ 0 ] . immediate( ) ) )
1017
1017
} ) *
@@ -1135,7 +1135,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1135
1135
ret_ty == in_elem,
1136
1136
InvalidMonomorphization :: ReturnType { span, name, in_elem, in_ty, ret_ty }
1137
1137
) ;
1138
- return match in_elem. kind( ) {
1138
+ return match * in_elem. kind( ) {
1139
1139
ty:: Int ( _) | ty:: Uint ( _) => {
1140
1140
let r = bx. vector_reduce_op( args[ 0 ] . immediate( ) , $vec_op) ;
1141
1141
if $ordered {
@@ -1204,7 +1204,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1204
1204
ret_ty == in_elem,
1205
1205
InvalidMonomorphization :: ReturnType { span, name, in_elem, in_ty, ret_ty }
1206
1206
) ;
1207
- return match in_elem. kind( ) {
1207
+ return match * in_elem. kind( ) {
1208
1208
ty:: Int ( _) | ty:: Uint ( _) => Ok ( bx. $int_red( args[ 0 ] . immediate( ) ) ) ,
1209
1209
ty:: Float ( _) => Ok ( bx. $float_red( args[ 0 ] . immediate( ) ) ) ,
1210
1210
_ => return_error!( InvalidMonomorphization :: UnsupportedSymbol {
@@ -1233,7 +1233,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1233
1233
) ;
1234
1234
args[ 0 ] . immediate( )
1235
1235
} else {
1236
- match in_elem. kind( ) {
1236
+ match * in_elem. kind( ) {
1237
1237
ty:: Int ( _) | ty:: Uint ( _) => { }
1238
1238
_ => return_error!( InvalidMonomorphization :: UnsupportedSymbol {
1239
1239
span,
@@ -1247,7 +1247,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1247
1247
1248
1248
args[ 0 ] . immediate( )
1249
1249
} ;
1250
- return match in_elem. kind( ) {
1250
+ return match * in_elem. kind( ) {
1251
1251
ty:: Int ( _) | ty:: Uint ( _) => {
1252
1252
let r = bx. vector_reduce_op( input, $op) ;
1253
1253
Ok ( if !$boolean {
0 commit comments