Skip to content

Commit 799b92c

Browse files
committed
[bmi] add some more code-gen tests
1 parent 602915a commit 799b92c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/arm/v8.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn _rbit_u64(x: u64) -> u64 {
3636
/// When all bits of the operand are set it returns the size of the operand in
3737
/// bits.
3838
#[inline(always)]
39-
// #[cfg_attr(test, assert_instr(cls))] // LLVM Bug: https://bugs.llvm.org/show_bug.cgi?id=31802
39+
// LLVM Bug (should be cls): https://bugs.llvm.org/show_bug.cgi?id=31802
4040
#[cfg_attr(test, assert_instr(clz))]
4141
pub fn _cls_u32(x: u32) -> u32 {
4242
u32::leading_zeros(!x) as u32
@@ -47,7 +47,7 @@ pub fn _cls_u32(x: u32) -> u32 {
4747
/// When all bits of the operand are set it returns the size of the operand in
4848
/// bits.
4949
#[inline(always)]
50-
// #[cfg_attr(test, assert_instr(cls))] // LLVM Bug: https://bugs.llvm.org/show_bug.cgi?id=31802
50+
// LLVM Bug (should be cls): https://bugs.llvm.org/show_bug.cgi?id=31802
5151
#[cfg_attr(test, assert_instr(clz))]
5252
pub fn _cls_u64(x: u64) -> u64 {
5353
u64::leading_zeros(!x) as u64

src/x86/bmi2.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! The reference is [Intel 64 and IA-32 Architectures Software Developer's
44
//! Manual Volume 2: Instruction Set Reference,
5-
//! A-Z](http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf).
5+
//! A-Z](http://www.intel.de/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectu res-software-developer-instruction-set-reference-manual-325383.pdf).
66
//!
77
//! [Wikipedia](https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#BMI2_.28Bit_Manipulation_Instruction_Set_2.29)
88
//! provides a quick overview of the available instructions.
@@ -15,6 +15,8 @@ use assert_instr::assert_instr;
1515
/// Unsigned multiplication of `a` with `b` returning a pair `(lo, hi)` with
1616
/// the low half and the high half of the result.
1717
#[inline(always)]
18+
// LLVM BUG (should be mulxl): https://bugs.llvm.org/show_bug.cgi?id=34232
19+
#[cfg_attr(test, assert_instr(imul))]
1820
#[target_feature = "+bmi2"]
1921
pub fn _mulx_u32(a: u32, b: u32) -> (u32, u32) {
2022
let result: u64 = (a as u64) * (b as u64);
@@ -27,6 +29,7 @@ pub fn _mulx_u32(a: u32, b: u32) -> (u32, u32) {
2729
/// Unsigned multiplication of `a` with `b` returning a pair `(lo, hi)` with
2830
/// the low half and the high half of the result.
2931
#[inline(always)]
32+
#[cfg_attr(test, assert_instr(mulx))]
3033
#[target_feature = "+bmi2"]
3134
pub fn _mulx_u64(a: u64, b: u64) -> (u64, u64) {
3235
let result: u128 = (a as u128) * (b as u128);

0 commit comments

Comments
 (0)