-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a whole bunch more x86 vendor intrinsics #1380
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
missing intrinsics
stdarch patchdiff --git a/crates/assert-instr-macro/src/lib.rs b/crates/assert-instr-macro/src/lib.rs
index 99e37c91..ee666063 100644
--- a/crates/assert-instr-macro/src/lib.rs
+++ b/crates/assert-instr-macro/src/lib.rs
@@ -181,7 +181,7 @@ pub fn assert_instr(
let tokens: TokenStream = quote! {
#item
- #tokens
+ //#tokens
};
tokens.into()
}
diff --git a/crates/core_arch/src/x86/avx.rs b/crates/core_arch/src/x86/avx.rs
index fafee5c0..097a17f9 100644
--- a/crates/core_arch/src/x86/avx.rs
+++ b/crates/core_arch/src/x86/avx.rs
@@ -738,7 +738,7 @@ pub const _CMP_TRUE_US: i32 = 0x1f;
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm_cmp_pd<const IMM5: i32>(a: __m128d, b: __m128d) -> __m128d {
static_assert_uimm_bits!(IMM5, 5);
- vcmppd(a, b, IMM5 as i8)
+ vcmppd(a, b, const { IMM5 as i8 })
}
/// Compares packed double-precision (64-bit) floating-point
@@ -768,7 +768,7 @@ pub unsafe fn _mm256_cmp_pd<const IMM5: i32>(a: __m256d, b: __m256d) -> __m256d
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm_cmp_ps<const IMM5: i32>(a: __m128, b: __m128) -> __m128 {
static_assert_uimm_bits!(IMM5, 5);
- vcmpps(a, b, IMM5 as i8)
+ vcmpps(a, b, const { IMM5 as i8 })
}
/// Compares packed single-precision (32-bit) floating-point
@@ -783,7 +783,7 @@ pub unsafe fn _mm_cmp_ps<const IMM5: i32>(a: __m128, b: __m128) -> __m128 {
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm256_cmp_ps<const IMM5: i32>(a: __m256, b: __m256) -> __m256 {
static_assert_uimm_bits!(IMM5, 5);
- vcmpps256(a, b, IMM5 as u8)
+ vcmpps256(a, b, const { IMM5 as u8 })
}
/// Compares the lower double-precision (64-bit) floating-point element in
diff --git a/crates/core_arch/src/x86/mod.rs b/crates/core_arch/src/x86/mod.rs
index ee8b7e75..f013a9ea 100644
--- a/crates/core_arch/src/x86/mod.rs
+++ b/crates/core_arch/src/x86/mod.rs
@@ -1,6 +1,6 @@
//! `x86` and `x86_64` intrinsics.
-use crate::{intrinsics, marker::Sized, mem::transmute};
+use crate::{marker::Sized, mem::transmute};
#[macro_use]
mod macros;
@@ -807,6 +807,7 @@ pub use self::adx::*;
#[cfg(test)]
use stdarch_test::assert_instr;
+/*
mod avx512f;
pub use self::avx512f::*;
@@ -854,3 +855,4 @@ pub use self::f16c::*;
mod avx512bf16;
pub use self::avx512bf16::*;
+*/
diff --git a/crates/core_arch/src/x86/test.rs b/crates/core_arch/src/x86/test.rs
index ec429803..20cb774f 100644
--- a/crates/core_arch/src/x86/test.rs
+++ b/crates/core_arch/src/x86/test.rs
@@ -124,7 +124,7 @@ mod x86_polyfill {
pub use crate::core_arch::x86_64::{_mm256_insert_epi64, _mm_insert_epi64};
}
pub use self::x86_polyfill::*;
-
+/*
pub unsafe fn assert_eq_m512i(a: __m512i, b: __m512i) {
assert_eq!(transmute::<_, [i32; 16]>(a), transmute::<_, [i32; 16]>(b))
}
@@ -142,3 +142,4 @@ pub unsafe fn assert_eq_m512d(a: __m512d, b: __m512d) {
panic!("{:?} != {:?}", a, b);
}
}
+*/
diff --git a/crates/core_arch/src/x86_64/mod.rs b/crates/core_arch/src/x86_64/mod.rs
index 461874ec..468dbc45 100644
--- a/crates/core_arch/src/x86_64/mod.rs
+++ b/crates/core_arch/src/x86_64/mod.rs
@@ -36,8 +36,10 @@ pub use self::bmi2::*;
mod avx2;
pub use self::avx2::*;
+/*
mod avx512f;
pub use self::avx512f::*;
+*/
mod bswap;
pub use self::bswap::*; patch to disable fake cpuiddiff --git a/src/inline_asm.rs b/src/inline_asm.rs
index 3ba530c0..ea3c2f8e 100644
--- a/src/inline_asm.rs
+++ b/src/inline_asm.rs
@@ -51,7 +51,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
}
// Used by stdarch
- if template[0] == InlineAsmTemplatePiece::String("mov ".to_string())
+ /*if template[0] == InlineAsmTemplatePiece::String("mov ".to_string())
&& matches!(
template[1],
InlineAsmTemplatePiece::Placeholder {
@@ -129,7 +129,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
let destination_block = fx.get_block(destination.unwrap());
fx.bcx.ins().jump(destination_block, &[]);
return;
- }
+ }*/
// Used by compiler-builtins
if fx.tcx.symbol_name(fx.instance).name.starts_with("___chkstk") { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ignoring AVX512 I'm now down to 190 failing tests for stdarch out of 725.
Helps with #1289 and #1222