Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
1040ec5
docs: Fix typo in `__get_cpuid_max` description
tyilo Sep 28, 2026
0983196
assert_instr: add support for explicit exclusion of bad instructions
RalfJung Aug 19, 2026
6a28c46
make assert_instr total instruction limit configurable per-test
RalfJung Aug 19, 2026
06cdd56
make x86-64 asm more consistent
RalfJung Aug 20, 2026
0f2d45d
add the new tests to more intrinsics
RalfJung Aug 20, 2026
0c7dd1e
Add `$` to bash string interpolation
Jamesbarford Oct 14, 2026
a15341d
bfloat16 types
Jamesbarford Oct 20, 2026
fdaa683
Update Arm intrinsic generator
Jamesbarford Oct 20, 2026
b5bf510
Update test harness
Jamesbarford Oct 20, 2026
ac43d47
Add bf16 intrinsics to YAML, JSON & re-generate
Jamesbarford Oct 20, 2026
bf098d9
add tracking issue number
Jamesbarford Oct 26, 2026
15f0d64
Merge pull request #2257 from Jamesbarford/fix/correct-string-interpo…
folkertdev Oct 27, 2026
3a22eb8
amdgpu: document that ds_permute/ds_bpermute take a byte address
bernardogv Oct 17, 2026
6973b86
Merge pull request #2258 from bernardogv/amdgpu-permute-byte-address
adamgemmell Oct 27, 2026
4543923
refactor: move RISC-V bit manipulation intrinsics into zb.rs
TechnoPorg Oct 20, 2026
558c0ac
refactor: make RISC-V bit manip intrinsics match C API
TechnoPorg Oct 20, 2026
cac7fb7
refactor: make LLVM RISC-V intrinsics use unsigned types
TechnoPorg Oct 26, 2026
1b99c25
Merge pull request #2247 from TechnoPorg/push-oltzmvxwsyno
tgross35 Oct 27, 2026
dae3a88
cleanup: remove rustc_legacy_const_generics from unstable intrinsics
TechnoPorg Oct 12, 2026
9c05e66
Merge pull request #2254 from TechnoPorg/push-mwwoxvvolwwx
tgross35 Oct 28, 2026
1d32319
simd-test: Update old import style, remove outdated lint
tgross35 Oct 29, 2026
70ea346
simd-test: Update proc macros to syn 3
tgross35 Oct 29, 2026
b510ea1
simd-test: Handle target-specific behavior within generated code
tgross35 Oct 29, 2026
2a0437e
Merge pull request #2261 from tgross35/test-updates
folkertdev Oct 29, 2026
e855210
Merge pull request #2256 from Jamesbarford/feature/aarch64-neon-bf16-…
folkertdev Oct 29, 2026
ca9e290
Correct llvm intrinsic type parameters in AArch64
sayantn Nov 1, 2026
5b4c933
Merge pull request #2212 from RalfJung/assert_instr_not
sayantn Nov 1, 2026
ad0911f
fix shift immediate widths
folkertdev Oct 28, 2026
b0c9d3f
use better test inputs
folkertdev Oct 28, 2026
fa502db
use better inputs that don't get folded away
folkertdev Oct 28, 2026
65b8447
use better inputs that don't get folded away
folkertdev Oct 28, 2026
441deff
fixup docker files
folkertdev Oct 28, 2026
2d06ea8
loads and stores now always use the `.d` variant
folkertdev Oct 28, 2026
caf6684
`copy_u_d` uses the signed instruction; there is no sign/zero extensi…
folkertdev Oct 28, 2026
4e05dff
clang ends up using the negated variant; fine
folkertdev Oct 28, 2026
6762899
clang uses just an `andi.b` for `bclri_b`
folkertdev Oct 28, 2026
fc31e66
correct FMA test results
folkertdev Oct 28, 2026
8ef038b
run qemu with a CPU that has +msa
folkertdev Oct 28, 2026
bf502cf
work around LLVM emitting a different instruction than the intrinsic …
folkertdev Oct 28, 2026
b3ad729
loongarch: Use `intrinsics::simd` for vclo
heiher Nov 10, 2026
bf8350a
Prepare for merging from rust-lang/rust
invalid-email-address Nov 12, 2026
ac9d75c
ref: replace debug_tuple helpers with debug struct ones
panstromek Oct 29, 2026
a8f1df2
add `core::arch::{x86, x86_64}::x87_f80`
folkertdev Sep 23, 2026
ef186ec
disable `assert_instr` on some amx tests
folkertdev Nov 15, 2026
be665a3
avx512ifma: fix docs for masked intrinsics
RalfJung Nov 15, 2026
b4e6163
Merge pull request #2264 from rust-lang/rustc-pull
folkertdev Nov 15, 2026
8c52e82
Merge pull request #2262 from sayantn/correct-overloaded-intrinsics
folkertdev Nov 15, 2026
e91673a
Merge pull request #2233 from tyilo/patch-1
folkertdev Nov 15, 2026
d2a12fd
Merge pull request #2260 from folkertdev/mips-fixes
folkertdev Nov 15, 2026
4c22f63
Merge pull request #2265 from heiher/loong-vclo
folkertdev Nov 15, 2026
1098785
powerpc: Implement vclzlsbb and vctzlsbb
Gelbpunkt Nov 11, 2026
b167284
Add some test cases
Gelbpunkt Nov 15, 2026
8e99d87
Skip power9-vector feature on 32-bit powerpc
Gelbpunkt Nov 15, 2026
5e12b34
Merge pull request #2267 from RalfJung/avx512ifma-mask
folkertdev Nov 15, 2026
a5cf8dd
Merge pull request #2266 from Gelbpunkt/powerpc-vclzlsbb-vctzlsbb
folkertdev Nov 15, 2026
780712f
Prepare for merging from rust-lang/rust
folkertdev Nov 16, 2026
f57b2a3
Merge ref '4de190d26178' from rust-lang/rust
folkertdev Nov 16, 2026
3151c0f
Merge pull request #2270 from folkertdev/main
folkertdev Nov 16, 2026
e4ae358
add `feature(cfg_target_has_reliable_f16b)` to `core`
folkertdev Nov 16, 2026
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 library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#![feature(asm_experimental_arch)]
#![feature(byte_str_internals)]
#![feature(cfg_target_has_reliable_f16_f128)]
#![feature(cfg_target_has_reliable_f16b)]
#![feature(const_cmp)]
#![feature(const_destruct)]
#![feature(const_eval_select)]
Expand Down
35 changes: 23 additions & 12 deletions library/stdarch/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 3.0.9",
]

[[package]]
Expand Down Expand Up @@ -145,7 +145,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
"syn",
"syn 2.0.117",
]

[[package]]
Expand Down Expand Up @@ -213,7 +213,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
"syn",
"syn 2.0.117",
]

[[package]]
Expand All @@ -224,7 +224,7 @@ checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d"
dependencies = [
"darling_core",
"quote",
"syn",
"syn 2.0.117",
]

[[package]]
Expand Down Expand Up @@ -520,7 +520,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn",
"syn 2.0.117",
]

[[package]]
Expand Down Expand Up @@ -745,7 +745,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 2.0.117",
]

[[package]]
Expand Down Expand Up @@ -780,7 +780,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
"syn",
"syn 2.0.117",
]

[[package]]
Expand All @@ -807,7 +807,7 @@ version = "0.1.0"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 3.0.9",
]

[[package]]
Expand Down Expand Up @@ -881,7 +881,7 @@ dependencies = [
"quote",
"serde",
"serde_json",
"syn",
"syn 3.0.9",
]

[[package]]
Expand Down Expand Up @@ -910,6 +910,17 @@ dependencies = [
"unicode-ident",
]

[[package]]
name = "syn"
version = "3.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]

[[package]]
name = "syscalls"
version = "0.6.18"
Expand Down Expand Up @@ -1094,7 +1105,7 @@ dependencies = [
"heck",
"indexmap 2.13.1",
"prettyplease",
"syn",
"syn 2.0.117",
"wasm-metadata",
"wit-bindgen-core",
"wit-component",
Expand All @@ -1110,7 +1121,7 @@ dependencies = [
"prettyplease",
"proc-macro2",
"quote",
"syn",
"syn 2.0.117",
"wit-bindgen-core",
"wit-bindgen-rust",
]
Expand Down Expand Up @@ -1178,7 +1189,7 @@ checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
dependencies = [
"proc-macro2",
"quote",
"syn",
"syn 2.0.117",
]

[[package]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM ubuntu:25.04 # gcc-mips64-linux-gnuabi64 not available in 25.10
FROM ubuntu:25.10

# gcc-mips64-linux-gnuabi64 not available by default in 25.10
RUN echo "deb http://archive.ubuntu.com/ubuntu noble main universe" >> /etc/apt/sources.list.d/noble-copies.list

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-mips64-linux-gnuabi64 libc6-dev-mips64-cross \
qemu-system-mips64 qemu-user

# Use Loongson-3A4000, a CPU with MSA support. Qemu does not define a max CPU for MIPS.
ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_LINKER=mips64-linux-gnuabi64-gcc \
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64 -L /usr/mips64-linux-gnuabi64" \
OBJDUMP=mips64-linux-gnuabi64-objdump
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64 -cpu Loongson-3A4000 -L /usr/mips64-linux-gnuabi64" \
OBJDUMP=mips64-linux-gnuabi64-objdump
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM ubuntu:25.04 # gcc-mips64el-linux-gnuabi64 not available in 25.10
FROM ubuntu:25.10

# gcc-mips64el-linux-gnuabi64 not available by default in 25.10
RUN echo "deb http://archive.ubuntu.com/ubuntu noble main universe" >> /etc/apt/sources.list.d/noble-copies.list

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc libc6-dev qemu-user ca-certificates \
gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \
qemu-system-mips64el

# Use Loongson-3A4000, a CPU with MSA support. Qemu does not define a max CPU for MIPS.
ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -L /usr/mips64el-linux-gnuabi64" \
OBJDUMP=mips64el-linux-gnuabi64-objdump
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -cpu Loongson-3A4000 -L /usr/mips64el-linux-gnuabi64" \
OBJDUMP=mips64el-linux-gnuabi64-objdump
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \
CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -cpu mpc8610 -L /usr/powerpc-linux-gnu" \
CC=powerpc-linux-gnu-gcc \
OBJDUMP=powerpc-linux-gnu-objdump \
STDARCH_TEST_SKIP_FEATURE=vsx
STDARCH_TEST_SKIP_FEATURE=vsx,power9-vector
2 changes: 1 addition & 1 deletion library/stdarch/ci/intrinsic-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml"

case ${TARGET} in
aarch64_be*)
export CFLAGS="-I${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc/usr/include --sysroot={AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc -Wno-nonportable-vector-initialization"
export CFLAGS="-I${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc/usr/include --sysroot=${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc -Wno-nonportable-vector-initialization"
ARCH=aarch64_be
RUNTIME_RUSTFLAGS=
;;
Expand Down
10 changes: 8 additions & 2 deletions library/stdarch/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ case ${TARGET} in
;;
# Some x86_64 targets enable by default more features beyond SSE2,
# which cause some instruction assertion checks to fail.
# (This does not disable tests that need more features, they get enabled based on
# what the host actually supports.)
x86_64-*)
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=-sse3"
# We want frame pointers to be consistent across targets. On the ios_macabi target
# we cannot turn them off, so let's turn them on everywhere.
# If we ever turn these off, a bunch of `limit(...)` clauses should be reduced to
# avoid tests becoming less strict!
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=-sse3 -Cforce-frame-pointers=on"
;;
#Unoptimized build uses fast-isel which breaks with msa
mips-* | mipsel-*)
Expand Down Expand Up @@ -113,7 +119,7 @@ case ${TARGET} in
# cargo_test
# ;;
mips64*)
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa"
export RUSTFLAGS="${RUSTFLAGS} -C target-cpu=mips64r5 -C target-feature=+msa"
cargo_test
;;
s390x*)
Expand Down
2 changes: 1 addition & 1 deletion library/stdarch/crates/assert-instr-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test = false
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
syn = { version = "3.0", features = ["full"] }

[lints.rust]
unexpected_cfgs = {level = "warn", check-cfg = ['cfg(optimized)'] }
103 changes: 74 additions & 29 deletions library/stdarch/crates/assert-instr-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ pub fn assert_instr(
};

let instr = &invoc.instr;
let not = invoc.not;
let limit = match invoc.limit {
None => quote! { None },
Some(l) => quote! { Some(#l) },
};

let name = &func.sig.ident;
let maybe_allow_deprecated = if func
.attrs
Expand Down Expand Up @@ -107,6 +113,7 @@ pub fn assert_instr(
let generic_ty_value = syn::TypePath {
qself: qself.clone(),
path: path.clone(),
attrs: Vec::new(),
};

// Replace any function arguments that use generic parameters with the
Expand Down Expand Up @@ -179,7 +186,7 @@ pub fn assert_instr(
fn #assert_name() {
#to_test

::stdarch_test::assert(#shim_name as usize, stringify!(#shim_name), #instr);
::stdarch_test::assert(#shim_name as usize, stringify!(#shim_name), #instr, &[#(#not),*], #limit);
}
};

Expand All @@ -192,51 +199,89 @@ pub fn assert_instr(

struct Invoc {
instr: String,
not: Vec<String>,
limit: Option<syn::LitInt>,
args: Vec<(syn::Ident, syn::Expr)>,
}

fn parse_instr(input: syn::parse::ParseStream<'_>) -> syn::Result<String> {
use syn::{Token, ext::IdentExt};

let mut instr = String::new();
while !input.is_empty() {
if let Ok(ident) = syn::Ident::parse_any(input) {
instr.push_str(&ident.to_string());
continue;
}
if input.parse::<Token![.]>().is_ok() {
instr.push('.');
continue;
}
if let Ok(s) = input.parse::<syn::LitStr>() {
instr.push_str(&s.value());
continue;
}
// Some other token, must be start of the next thing.
break;
}
if instr.is_empty() {
return Err(input.error("expected an instruction"));
}
Ok(instr)
}

impl syn::parse::Parse for Invoc {
fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
use syn::{Token, ext::IdentExt};
use syn::{Token, parenthesized};

let instr = parse_instr(input)?;
let mut not = Vec::new();
let mut limit = None;
let mut args = Vec::new();

let mut instr = String::new();
while !input.is_empty() {
if input.parse::<Token![,]>().is_ok() {
break;
// Parse the comma after the previous thing
if input.parse::<Token![,]>().is_err() {
return Err(input.error("extra tokens at end"));
}
if let Ok(ident) = syn::Ident::parse_any(input) {
instr.push_str(&ident.to_string());
continue;
// Handle trailing comma.
if input.is_empty() {
break;
}
if input.parse::<Token![.]>().is_ok() {
instr.push('.');

// This is either `not(instr)` or `limit(n)` or `arg = val`.
// We treat `not` and `limit` as a magic identifier here.

let name = input.parse::<syn::Ident>()?;

if name == "not" {
let content;
parenthesized!(content in input);
let not_instr = parse_instr(&content)?;
if !content.is_empty() {
return Err(input.error("expected just an instruction in `not(...)`"));
}
not.push(not_instr);
continue;
}
if let Ok(s) = input.parse::<syn::LitStr>() {
instr.push_str(&s.value());
if name == "limit" {
let content;
parenthesized!(content in input);
let n = content.parse::<syn::LitInt>()?;
limit = Some(n);
continue;
}
println!("{:?}", input.cursor().token_stream());
return Err(input.error("expected an instruction"));
}
if instr.is_empty() {
return Err(input.error("expected an instruction before comma"));
}
let mut args = Vec::new();
while !input.is_empty() {
let name = input.parse::<syn::Ident>()?;

input.parse::<Token![=]>()?;
let expr = input.parse::<syn::Expr>()?;
args.push((name, expr));

if input.parse::<Token![,]>().is_err() {
if !input.is_empty() {
return Err(input.error("extra tokens at end"));
}
break;
}
}
Ok(Self { instr, args })
Ok(Self {
instr,
not,
limit,
args,
})
}
}

Expand Down
5 changes: 4 additions & 1 deletion library/stdarch/crates/core_arch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ stdarch-test = { version = "0.*", path = "../stdarch-test" }
syscalls = { version = "0.6.18", default-features = false }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_has_reliable_f16)'] }
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_has_reliable_f16b)',
'cfg(target_has_reliable_f16)',
] }

[lints.clippy]
too_long_first_doc_paragraph = "allow"
Expand Down
Loading
Loading