Skip to content
Draft
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
1 change: 1 addition & 0 deletions ci/dox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dox() {
export CARGO_UNSTABLE_BUILD_STD=core
# amdgpu needs a target-cpu, any is fine
export RUSTFLAGS="${RUSTFLAGS} -Ctarget-cpu=gfx900"
export RUSTDOCFLAGS="${RUSTDOCFLAGS} -Ctarget-cpu=gfx900"
fi

cargo build --verbose --target "${1}" --manifest-path crates/core_arch/Cargo.toml
Expand Down
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ cargo_test() {
else
dir="debug"
fi
export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/deps::."
export CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/$dir/build::."
cmd="$cmd --nocapture"
;;
esac
Expand Down
8 changes: 4 additions & 4 deletions crates/core_arch/src/aarch64/sve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<T> SveInto<T> for T {
macro_rules! impl_sve_type {
($(($v:vis, $elem_type:ty, $name:ident, $elt:literal))*) => ($(
#[doc = concat!("Scalable vector of type ", stringify!($elem_type))]
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy)]
#[rustc_scalable_vector($elt)]
#[unstable(feature = "stdarch_aarch64_sve", issue = "145052")]
$v struct $name($elem_type);
Expand All @@ -52,21 +52,21 @@ macro_rules! impl_sve_tuple_type {
)*);
(@ ($v:vis, $vec_type:ty, 2, $name:ident)) => (
#[doc = concat!("Two-element tuple of scalable vectors of type ", stringify!($vec_type))]
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy)]
#[rustc_scalable_vector]
#[unstable(feature = "stdarch_aarch64_sve", issue = "145052")]
$v struct $name($vec_type, $vec_type);
);
(@ ($v:vis, $vec_type:ty, 3, $name:ident)) => (
#[doc = concat!("Three-element tuple of scalable vectors of type ", stringify!($vec_type))]
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy)]
#[rustc_scalable_vector]
#[unstable(feature = "stdarch_aarch64_sve", issue = "145052")]
$v struct $name($vec_type, $vec_type, $vec_type);
);
(@ ($v:vis, $vec_type:ty, 4, $name:ident)) => (
#[doc = concat!("Four-element tuple of scalable vectors of type ", stringify!($vec_type))]
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy)]
#[rustc_scalable_vector]
#[unstable(feature = "stdarch_aarch64_sve", issue = "145052")]
$v struct $name($vec_type, $vec_type, $vec_type, $vec_type);
Expand Down
1 change: 1 addition & 0 deletions crates/core_arch/src/amdgpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ pub unsafe fn sched_barrier<const MASK: u32>() {
/// sched_group_barrier::<8, 5, 0>()
/// ```
///
#[doc(cfg(target_arch = "amdgpu"))]
#[doc = include_str!("intrinsic_is_convergent.md")]
#[inline]
#[unstable(feature = "stdarch_amdgpu", issue = "149988")]
Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/wasm32/simd128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4323,7 +4323,7 @@ mod tests {
let vec = i64x2_load_extend_i32x2(arr.as_ptr());
compare_bytes(vec, i64x2(-1, 1));
let vec = i64x2_load_extend_u32x2(arr.as_ptr() as *const u32);
compare_bytes(vec, i64x2(u32::max_value().into(), 1));
compare_bytes(vec, i64x2(u32::MAX.into(), 1));
}
}

Expand Down
12 changes: 12 additions & 0 deletions crates/core_arch/src/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ types! {
/// # Examples
///
/// ```
/// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
/// #[cfg(target_arch = "x86")]
/// use std::arch::x86::*;
/// #[cfg(target_arch = "x86_64")]
Expand All @@ -56,6 +57,7 @@ types! {
/// # if is_x86_feature_detected!("sse2") { unsafe { foo() } }
/// # }
/// ```
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct __m128i(2 x i64);

/// 128-bit wide set of four `f32` types, x86-specific
Expand Down Expand Up @@ -83,6 +85,7 @@ types! {
/// # Examples
///
/// ```
/// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
/// #[cfg(target_arch = "x86")]
/// use std::arch::x86::*;
/// #[cfg(target_arch = "x86_64")]
Expand All @@ -99,6 +102,7 @@ types! {
/// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
/// # }
/// ```
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct __m128(4 x f32);

/// 128-bit wide set of two `f64` types, x86-specific
Expand Down Expand Up @@ -126,6 +130,7 @@ types! {
/// # Examples
///
/// ```
/// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
/// #[cfg(target_arch = "x86")]
/// use std::arch::x86::*;
/// #[cfg(target_arch = "x86_64")]
Expand All @@ -142,6 +147,7 @@ types! {
/// # if is_x86_feature_detected!("sse2") { unsafe { foo() } }
/// # }
/// ```
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct __m128d(2 x f64);

/// 256-bit wide integer vector type, x86-specific
Expand Down Expand Up @@ -173,6 +179,7 @@ types! {
/// # Examples
///
/// ```
/// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
/// #[cfg(target_arch = "x86")]
/// use std::arch::x86::*;
/// #[cfg(target_arch = "x86_64")]
Expand All @@ -189,6 +196,7 @@ types! {
/// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
/// # }
/// ```
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct __m256i(4 x i64);

/// 256-bit wide set of eight `f32` types, x86-specific
Expand Down Expand Up @@ -216,6 +224,7 @@ types! {
/// # Examples
///
/// ```
/// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
/// #[cfg(target_arch = "x86")]
/// use std::arch::x86::*;
/// #[cfg(target_arch = "x86_64")]
Expand All @@ -232,6 +241,7 @@ types! {
/// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
/// # }
/// ```
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct __m256(8 x f32);

/// 256-bit wide set of four `f64` types, x86-specific
Expand Down Expand Up @@ -259,6 +269,7 @@ types! {
/// # Examples
///
/// ```
/// #![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
/// #[cfg(target_arch = "x86")]
/// use std::arch::x86::*;
/// #[cfg(target_arch = "x86_64")]
Expand All @@ -275,6 +286,7 @@ types! {
/// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
/// # }
/// ```
#[doc(cfg(any(target_arch = "x86", target_arch = "x86_64")))]
pub struct __m256d(4 x f64);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/core_arch/src/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,7 @@ mod tests {
core_arch::{simd::*, x86::*},
hint::black_box,
};
use std::{boxed, f32, f64, mem, ptr};
use std::{boxed, mem, ptr};
use stdarch_test::simd_test;

const NAN: f64 = f64::NAN;
Expand Down
22 changes: 22 additions & 0 deletions crates/stdarch-test/src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use crate::Function;
use std::collections::HashSet;
use std::path::Path;

pub(crate) fn disassemble_myself() -> HashSet<Function> {
// Use `std::env::args` to find the path to our executable. Assume the
Expand All @@ -11,6 +12,27 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
let me = std::env::args()
.next()
.expect("failed to find current wasm file");
let me = Path::new(&me);
let me = if me.exists() {
// Old build-dir layout
me.to_path_buf()
} else {
// Cargo's build-dir layout stores an artifact named
// `<crate>-<hash>.wasm` at `<crate>/<hash>/out/<crate>-<hash>.wasm`.
// The build directory is mounted as the WASI working directory, so
// reconstruct that guest-visible path from the executable name.
let file_name = me
.file_name()
.and_then(|name| name.to_str())
.expect("current wasm file has a file name");
let stem = file_name
.strip_suffix(".wasm")
.expect("current wasm file does not have a .wasm extension");
let (crate_name, hash) = stem
.rsplit_once('-')
.expect("current wasm file name does not contain an artifact hash");
Path::new(crate_name).join(hash).join("out").join(file_name)
};
let output = wasmprinter::print_file(&me).unwrap();

let mut ret: HashSet<Function> = HashSet::new();
Expand Down
Loading