From bbeec63f52cd5711bc7061f5d717a215a927840f Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Thu, 21 Sep 2017 08:53:13 +0200 Subject: [PATCH] [bmi] add some more code-gen tests --- library/stdarch/src/arm/v8.rs | 4 ++-- library/stdarch/src/x86/bmi2.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/library/stdarch/src/arm/v8.rs b/library/stdarch/src/arm/v8.rs index 92b1507aada1..e49ca4fe1f25 100644 --- a/library/stdarch/src/arm/v8.rs +++ b/library/stdarch/src/arm/v8.rs @@ -36,7 +36,7 @@ pub fn _rbit_u64(x: u64) -> u64 { /// When all bits of the operand are set it returns the size of the operand in /// bits. #[inline(always)] -// #[cfg_attr(test, assert_instr(cls))] // LLVM Bug: https://bugs.llvm.org/show_bug.cgi?id=31802 +// LLVM Bug (should be cls): https://bugs.llvm.org/show_bug.cgi?id=31802 #[cfg_attr(test, assert_instr(clz))] pub fn _cls_u32(x: u32) -> u32 { u32::leading_zeros(!x) as u32 @@ -47,7 +47,7 @@ pub fn _cls_u32(x: u32) -> u32 { /// When all bits of the operand are set it returns the size of the operand in /// bits. #[inline(always)] -// #[cfg_attr(test, assert_instr(cls))] // LLVM Bug: https://bugs.llvm.org/show_bug.cgi?id=31802 +// LLVM Bug (should be cls): https://bugs.llvm.org/show_bug.cgi?id=31802 #[cfg_attr(test, assert_instr(clz))] pub fn _cls_u64(x: u64) -> u64 { u64::leading_zeros(!x) as u64 diff --git a/library/stdarch/src/x86/bmi2.rs b/library/stdarch/src/x86/bmi2.rs index 321df40777f1..67f8740399e4 100644 --- a/library/stdarch/src/x86/bmi2.rs +++ b/library/stdarch/src/x86/bmi2.rs @@ -2,7 +2,7 @@ //! //! The reference is [Intel 64 and IA-32 Architectures Software Developer's //! Manual Volume 2: Instruction Set Reference, -//! 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). +//! 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). //! //! [Wikipedia](https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets#BMI2_.28Bit_Manipulation_Instruction_Set_2.29) //! provides a quick overview of the available instructions. @@ -15,6 +15,8 @@ use assert_instr::assert_instr; /// Unsigned multiplication of `a` with `b` returning a pair `(lo, hi)` with /// the low half and the high half of the result. #[inline(always)] +// LLVM BUG (should be mulxl): https://bugs.llvm.org/show_bug.cgi?id=34232 +#[cfg_attr(test, assert_instr(imul))] #[target_feature = "+bmi2"] pub fn _mulx_u32(a: u32, b: u32) -> (u32, u32) { let result: u64 = (a as u64) * (b as u64); @@ -27,6 +29,7 @@ pub fn _mulx_u32(a: u32, b: u32) -> (u32, u32) { /// Unsigned multiplication of `a` with `b` returning a pair `(lo, hi)` with /// the low half and the high half of the result. #[inline(always)] +#[cfg_attr(test, assert_instr(mulx))] #[target_feature = "+bmi2"] pub fn _mulx_u64(a: u64, b: u64) -> (u64, u64) { let result: u128 = (a as u128) * (b as u128);