Skip to content

Commit c1f686a

Browse files
Uncommented bitmask code
1 parent a06cb4c commit c1f686a

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

crates/core_arch/src/wasm32/simd128.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,14 +1452,14 @@ pub unsafe fn i8x16_all_true(a: v128) -> i32 {
14521452
llvm_i8x16_all_true(a.as_i8x16())
14531453
}
14541454

1455-
// FIXME: not available in our LLVM yet
1456-
// /// Extracts the high bit for each lane in `a` and produce a scalar mask with
1457-
// /// all bits concatenated.
1458-
// #[inline]
1459-
// #[cfg_attr(test, assert_instr(i8x16.all_true))]
1460-
// pub unsafe fn i8x16_bitmask(a: v128) -> i32 {
1461-
// llvm_bitmask_i8x16(transmute(a))
1462-
// }
1455+
/// Extracts the high bit for each lane in `a` and produce a scalar mask with
1456+
/// all bits concatenated.
1457+
#[inline]
1458+
#[cfg_attr(test, assert_instr(i8x16.bitmask))]
1459+
#[target_feature(enable = "simd128")]
1460+
pub unsafe fn i8x16_bitmask(a: v128) -> i32 {
1461+
llvm_bitmask_i8x16(transmute(a))
1462+
}
14631463

14641464
/// Converts two input vectors into a smaller lane vector by narrowing each
14651465
/// lane.
@@ -1662,14 +1662,14 @@ pub unsafe fn i16x8_all_true(a: v128) -> i32 {
16621662
llvm_i16x8_all_true(a.as_i16x8())
16631663
}
16641664

1665-
// FIXME: not available in our LLVM yet
1666-
// /// Extracts the high bit for each lane in `a` and produce a scalar mask with
1667-
// /// all bits concatenated.
1668-
// #[inline]
1669-
// #[cfg_attr(test, assert_instr(i16x8.all_true))]
1670-
// pub unsafe fn i16x8_bitmask(a: v128) -> i32 {
1671-
// llvm_bitmask_i16x8(transmute(a))
1672-
// }
1665+
/// Extracts the high bit for each lane in `a` and produce a scalar mask with
1666+
/// all bits concatenated.
1667+
#[inline]
1668+
#[cfg_attr(test, assert_instr(i16x8.bitmask))]
1669+
#[target_feature(enable = "simd128")]
1670+
pub unsafe fn i16x8_bitmask(a: v128) -> i32 {
1671+
llvm_bitmask_i16x8(transmute(a))
1672+
}
16731673

16741674
/// Converts two input vectors into a smaller lane vector by narrowing each
16751675
/// lane.
@@ -1913,14 +1913,14 @@ pub unsafe fn i32x4_all_true(a: v128) -> i32 {
19131913
llvm_i32x4_all_true(a.as_i32x4())
19141914
}
19151915

1916-
// FIXME: not available in our LLVM yet
1917-
// /// Extracts the high bit for each lane in `a` and produce a scalar mask with
1918-
// /// all bits concatenated.
1919-
// #[inline]
1920-
// #[cfg_attr(test, assert_instr(i32x4.all_true))]
1921-
// pub unsafe fn i32x4_bitmask(a: v128) -> i32 {
1922-
// llvm_bitmask_i32x4(transmute(a))
1923-
// }
1916+
/// Extracts the high bit for each lane in `a` and produce a scalar mask with
1917+
/// all bits concatenated.
1918+
#[inline]
1919+
#[cfg_attr(test, assert_instr(i32x4.bitmask))]
1920+
#[target_feature(enable = "simd128")]
1921+
pub unsafe fn i32x4_bitmask(a: v128) -> i32 {
1922+
llvm_bitmask_i32x4(transmute(a))
1923+
}
19241924

19251925
/// Converts low half of the smaller lane vector to a larger lane
19261926
/// vector, sign extended.

0 commit comments

Comments
 (0)