Skip to content
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

use remaining SIMD intrinsics via libcore #1538

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/core_arch/src/aarch64/neon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ pub use self::generated::*;
// FIXME: replace neon with asimd

use crate::{
core_arch::{arm_shared::*, simd::*, simd_llvm::*},
core_arch::{arm_shared::*, simd::*},
hint::unreachable_unchecked,
intrinsics::simd::*,
mem::{transmute, zeroed},
ptr::{read_unaligned, write_unaligned},
};
Expand Down
4 changes: 1 addition & 3 deletions crates/core_arch/src/arm_shared/neon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ mod generated;
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800"))]
pub use self::generated::*;

use crate::{
core_arch::simd::*, core_arch::simd_llvm::*, hint::unreachable_unchecked, mem::transmute,
};
use crate::{core_arch::simd::*, hint::unreachable_unchecked, intrinsics::simd::*, mem::transmute};
#[cfg(test)]
use stdarch_test::assert_instr;

Expand Down
1 change: 0 additions & 1 deletion crates/core_arch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![feature(
custom_inner_attributes,
link_llvm_intrinsics,
platform_intrinsics,
repr_simd,
simd_ffi,
proc_macro_hygiene,
Expand Down
2 changes: 0 additions & 2 deletions crates/core_arch/src/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ pub mod arch {
}
}

mod simd_llvm;

#[cfg(any(target_arch = "x86", target_arch = "x86_64", doc))]
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
mod x86;
Expand Down
6 changes: 1 addition & 5 deletions crates/core_arch/src/powerpc/altivec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@

#![allow(non_camel_case_types)]

use crate::{
core_arch::{simd::*, simd_llvm::*},
mem,
mem::transmute,
};
use crate::{core_arch::simd::*, intrinsics::simd::*, mem, mem::transmute};

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/powerpc/vsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#![allow(non_camel_case_types)]

use crate::core_arch::simd_llvm::*;
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
16 changes: 0 additions & 16 deletions crates/core_arch/src/simd_llvm.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/core_arch/src/v64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use crate::prelude::v1::*;

use crate::core_arch::simd_llvm::*;
use crate::intrinsics::simd::*;

define_ty_doc! {
f32x2, f32, f32 |
Expand Down
6 changes: 1 addition & 5 deletions crates/core_arch/src/wasm32/simd128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
#![allow(non_camel_case_types)]
#![allow(unused_imports)]

use crate::{
core_arch::{simd, simd_llvm::*},
marker::Sized,
mem, ptr,
};
use crate::{core_arch::simd, intrinsics::simd::*, marker::Sized, mem, ptr};

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
//! [wiki]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions

use crate::{
core_arch::{simd::*, simd_llvm::*, x86::*},
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
mem, ptr,
};

Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
//! [wiki_avx]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
//! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate

use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512bf16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
//!
//! [AVX512BF16 intrinsics]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=1769&avx512techs=AVX512_BF16

use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/x86/avx512bitalg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::core_arch::simd::i16x8;
use crate::core_arch::simd::i8x16;
use crate::core_arch::simd::i8x32;
use crate::core_arch::simd::i8x64;
use crate::core_arch::simd_llvm::simd_select_bitmask;
use crate::core_arch::x86::__m128i;
use crate::core_arch::x86::__m256i;
use crate::core_arch::x86::__m512i;
Expand All @@ -27,6 +26,7 @@ use crate::core_arch::x86::_mm_setzero_si128;
use crate::core_arch::x86::m128iExt;
use crate::core_arch::x86::m256iExt;
use crate::core_arch::x86::m512iExt;
use crate::intrinsics::simd::simd_select_bitmask;
use crate::mem::transmute;

#[cfg(test)]
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512bw.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{
arch::asm,
core_arch::{simd::*, simd_llvm::*, x86::*},
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
mem, ptr,
};

Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512cd.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512f.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{
arch::asm,
core_arch::{simd::*, simd_llvm::*, x86::*},
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
mem, ptr,
};

Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512vbmi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512vbmi2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{
arch::asm,
core_arch::{simd::*, simd_llvm::*, x86::*},
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
};

#[cfg(test)]
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/avx512vnni.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/x86/avx512vpopcntdq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::core_arch::simd::i32x8;
use crate::core_arch::simd::i64x2;
use crate::core_arch::simd::i64x4;
use crate::core_arch::simd::i64x8;
use crate::core_arch::simd_llvm::simd_select_bitmask;
use crate::core_arch::x86::__m128i;
use crate::core_arch::x86::__m256i;
use crate::core_arch::x86::__m512i;
Expand All @@ -25,6 +24,7 @@ use crate::core_arch::x86::_mm_setzero_si128;
use crate::core_arch::x86::m128iExt;
use crate::core_arch::x86::m256iExt;
use crate::core_arch::x86::m512iExt;
use crate::intrinsics::simd::simd_select_bitmask;
use crate::mem::transmute;

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/x86/fma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
//! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate

use crate::core_arch::simd_llvm::simd_fma;
use crate::core_arch::x86::*;
use crate::intrinsics::simd::simd_fma;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/x86/gfni.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use crate::core_arch::simd::i8x16;
use crate::core_arch::simd::i8x32;
use crate::core_arch::simd::i8x64;
use crate::core_arch::simd_llvm::simd_select_bitmask;
use crate::core_arch::x86::__m128i;
use crate::core_arch::x86::__m256i;
use crate::core_arch::x86::__m512i;
Expand All @@ -23,6 +22,7 @@ use crate::core_arch::x86::_mm_setzero_si128;
use crate::core_arch::x86::m128iExt;
use crate::core_arch::x86::m256iExt;
use crate::core_arch::x86::m512iExt;
use crate::intrinsics::simd::simd_select_bitmask;
use crate::mem::transmute;

#[cfg(test)]
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/sse.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Streaming SIMD Extensions (SSE)

use crate::{
core_arch::{simd::*, simd_llvm::*, x86::*},
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
mem, ptr,
};

Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use stdarch_test::assert_instr;

use crate::{
core_arch::{simd::*, simd_llvm::*, x86::*},
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
mem, ptr,
};

Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/sse3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Streaming SIMD Extensions 3 (SSE3)

use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86/sse41.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Streaming SIMD Extensions 4.1 (SSE4.1)

use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::core_arch::{simd::*, x86::*};
use crate::intrinsics::simd::*;

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
5 changes: 4 additions & 1 deletion crates/core_arch/src/x86/sse42.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
#[cfg(test)]
use stdarch_test::assert_instr;

use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::{
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
};

/// String contains unsigned 8-bit characters *(Default)*
#[stable(feature = "simd_x86", since = "1.27.0")]
Expand Down
5 changes: 4 additions & 1 deletion crates/core_arch/src/x86/ssse3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Supplemental Streaming SIMD Extensions 3 (SSSE3)

use crate::core_arch::{simd::*, simd_llvm::*, x86::*};
use crate::{
core_arch::{simd::*, x86::*},
intrinsics::simd::*,
};

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down
5 changes: 1 addition & 4 deletions crates/core_arch/src/x86_64/avx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
//! [amd64_ref]: http://support.amd.com/TechDocs/24594.pdf
//! [wiki]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions

use crate::{
core_arch::{simd_llvm::*, x86::*},
mem::transmute,
};
use crate::{core_arch::x86::*, intrinsics::simd::*, mem::transmute};

/// Copies `a` to result, and insert the 64-bit integer `i` into result
/// at the location specified by `index`.
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86_64/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
//! [wiki_avx]: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
//! [wiki_fma]: https://en.wikipedia.org/wiki/Fused_multiply-accumulate

use crate::core_arch::{simd_llvm::*, x86::*};
use crate::core_arch::x86::*;
use crate::intrinsics::simd::*;

/// Extracts a 64-bit integer from `a`, selected with `INDEX`.
///
Expand Down
3 changes: 2 additions & 1 deletion crates/core_arch/src/x86_64/avx512f.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{
core_arch::{simd::*, simd_llvm::*, x86::*, x86_64::*},
core_arch::{simd::*, x86::*, x86_64::*},
intrinsics::simd::*,
mem::transmute,
};

Expand Down
4 changes: 2 additions & 2 deletions crates/core_arch/src/x86_64/sse2.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! `x86_64`'s Streaming SIMD Extensions 2 (SSE2)

use crate::{
core_arch::{simd_llvm::*, x86::*},
intrinsics,
core_arch::x86::*,
intrinsics::{self, simd::*},
};

#[cfg(test)]
Expand Down
5 changes: 1 addition & 4 deletions crates/core_arch/src/x86_64/sse41.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//! `i686`'s Streaming SIMD Extensions 4.1 (SSE4.1)

use crate::{
core_arch::{simd_llvm::*, x86::*},
mem::transmute,
};
use crate::{core_arch::x86::*, intrinsics::simd::*, mem::transmute};

#[cfg(test)]
use stdarch_test::assert_instr;
Expand Down