@@ -447,9 +447,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
447
447
m_len == v_len,
448
448
InvalidMonomorphization :: MismatchedLengths { span, name, m_len, v_len }
449
449
) ;
450
+ // TODO: also support unsigned integers.
450
451
match * m_elem_ty. kind ( ) {
451
452
ty:: Int ( _) => { }
452
- _ => return_error ! ( InvalidMonomorphization :: MaskType { span, name, ty: m_elem_ty } ) ,
453
+ _ => return_error ! ( InvalidMonomorphization :: MaskWrongElementType {
454
+ span,
455
+ name,
456
+ ty: m_elem_ty
457
+ } ) ,
453
458
}
454
459
return Ok ( bx. vector_select ( args[ 0 ] . immediate ( ) , args[ 1 ] . immediate ( ) , args[ 2 ] . immediate ( ) ) ) ;
455
460
}
@@ -991,19 +996,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
991
996
assert_eq ! ( pointer_count - 1 , ptr_count( element_ty0) ) ;
992
997
assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
993
998
994
- // The element type of the third argument must be a signed integer type of any width:
999
+ // The element type of the third argument must be an integer type of any width:
1000
+ // TODO: also support unsigned integers.
995
1001
let ( _, element_ty2) = arg_tys[ 2 ] . simd_size_and_type ( bx. tcx ( ) ) ;
996
1002
match * element_ty2. kind ( ) {
997
1003
ty:: Int ( _) => ( ) ,
998
1004
_ => {
999
1005
require ! (
1000
1006
false ,
1001
- InvalidMonomorphization :: ThirdArgElementType {
1002
- span,
1003
- name,
1004
- expected_element: element_ty2,
1005
- third_arg: arg_tys[ 2 ]
1006
- }
1007
+ InvalidMonomorphization :: MaskWrongElementType { span, name, ty: element_ty2 }
1007
1008
) ;
1008
1009
}
1009
1010
}
@@ -1109,17 +1110,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
1109
1110
assert_eq ! ( underlying_ty, non_ptr( element_ty0) ) ;
1110
1111
1111
1112
// The element type of the third argument must be a signed integer type of any width:
1113
+ // TODO: also support unsigned integers.
1112
1114
match * element_ty2. kind ( ) {
1113
1115
ty:: Int ( _) => ( ) ,
1114
1116
_ => {
1115
1117
require ! (
1116
1118
false ,
1117
- InvalidMonomorphization :: ThirdArgElementType {
1118
- span,
1119
- name,
1120
- expected_element: element_ty2,
1121
- third_arg: arg_tys[ 2 ]
1122
- }
1119
+ InvalidMonomorphization :: MaskWrongElementType { span, name, ty: element_ty2 }
1123
1120
) ;
1124
1121
}
1125
1122
}
0 commit comments