Skip to content

Commit e4ec127

Browse files
committed
simd intrinsics with mask: accept unsigned integer masks
1 parent 8f4236a commit e4ec127

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/helpers.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,11 @@ pub(crate) fn bool_to_simd_element(b: bool, size: Size) -> Scalar {
12951295
}
12961296

12971297
pub(crate) fn simd_element_to_bool(elem: ImmTy<'_>) -> InterpResult<'_, bool> {
1298+
assert!(
1299+
matches!(elem.layout.ty.kind(), ty::Int(_) | ty::Uint(_)),
1300+
"SIMD mask element type must be an integer, but this is `{}`",
1301+
elem.layout.ty
1302+
);
12981303
let val = elem.to_scalar().to_int(elem.layout.size)?;
12991304
interp_ok(match val {
13001305
0 => false,

0 commit comments

Comments
 (0)