Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7ff7680
intrinsic-test: run rustfmt on generated sources
davidtwco May 8, 2026
526ff83
intrinsic-test: remove all indentation logic
davidtwco May 19, 2026
41859bd
loongarch: Use `intrinsics::simd` for vilv{h,l}
heiher May 8, 2026
f78cd53
Merge pull request #2122 from davidtwco/intrinsic-test-fmt
sayantn May 20, 2026
fe3cff9
intrinsic-test: document arm intrinsic filtering
davidtwco May 7, 2026
1db61fe
intrinsic-test: document `--sample-percentage`
davidtwco May 8, 2026
d009a44
intrinsic-test: document `iter_specializations`
davidtwco May 8, 2026
938f85a
intrinsic-test: document `common::argument` module
davidtwco May 8, 2026
ad2d7e9
intrinsic-test: document `common::values`
davidtwco May 19, 2026
78dd79c
intrinsic-test: document `common::intrinsic_helpers`
davidtwco May 19, 2026
4c0577a
intrinsic-test: document `common::gen_c`
davidtwco May 19, 2026
dac92d0
intrinsic-test: document `common::gen_rust`
davidtwco May 19, 2026
9e8b1dc
Merge pull request #2124 from davidtwco/intrinsic-test-docs
adamgemmell May 20, 2026
536b7fb
intrinsic-test: simplify `ArmIntrinsicType`
davidtwco May 7, 2026
75a35f4
intrinsic-test: parsing of SVE types
davidtwco May 7, 2026
810bd04
intrinsic-test: add SVE-specific constraints
davidtwco May 8, 2026
374e25d
Merge pull request #2121 from davidtwco/intrinsic-test-sve-types
adamgemmell May 20, 2026
dfdde18
intrinsic-test: remove `arm::argument` module
davidtwco May 20, 2026
1055252
Merge pull request #2123 from heiher/vilv-h-l
adamgemmell May 20, 2026
4bd7165
Fix chunk count
adamgemmell May 21, 2026
ac4c70b
Don't run doctests
adamgemmell May 21, 2026
8684b3a
stdarch-gen-hexagon-scalar: Do not emit inline(always) if target_feat…
taiki-e May 23, 2026
8d74557
Workaround rustfmt issue around impl const
taiki-e May 23, 2026
3607369
Merge pull request #2133 from taiki-e/hexagon-scalar
folkertdev May 24, 2026
c1e2d63
Merge pull request #2130 from adamgemmell/dev/adagem01/chunk-size
folkertdev May 24, 2026
fd9acfb
Add intrinsic-test GCC run
sayantn May 11, 2026
44475cc
Add intrinsic-test ICX run
sayantn May 14, 2026
1c31f01
Merge pull request #2125 from sayantn/intrinsic-test-gcc
folkertdev May 24, 2026
bcf9001
feat: rename debug-info-for-profiling switch
May 24, 2026
57e7bf4
feat: add tests for `debuginfo-for-profiling`
May 10, 2026
035d7dd
loongarch: CRC intrinsics require loongarch64
Gelbpunkt May 23, 2026
606d022
loongarch: Align CRC intrinsic signatures with clang and GCC
Gelbpunkt May 24, 2026
e1dede4
Merge pull request #2127 from davidtwco/intrinsic-test-remove-arm-arg…
folkertdev May 24, 2026
b8e62d7
Merge pull request #2136 from Gelbpunkt/la64-crc
sayantn May 25, 2026
028b8b6
Simplify `//@ needs-asm-mnemonic: ret` to just `//@ needs-asm-ret`
Zalathar May 25, 2026
7457b34
Rollup merge of #156900 - folkertdev:stdarch-sync-2026-05-25, r=folke…
JonathanBrouwer May 25, 2026
c492235
Rollup merge of #156887 - zamazan4ik:rename-debuginfo-for-profiling-s…
JonathanBrouwer May 25, 2026
eed84d5
Rollup merge of #156901 - Zalathar:needs-asm-ret, r=folkertdev
JonathanBrouwer May 25, 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
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl ModuleConfig {
),
pgo_use: if_regular!(sess.opts.cg.profile_use.clone(), None),
pgo_sample_use: if_regular!(sess.opts.unstable_opts.profile_sample_use.clone(), None),
debug_info_for_profiling: sess.opts.unstable_opts.debug_info_for_profiling,
debug_info_for_profiling: sess.opts.unstable_opts.debuginfo_for_profiling,
instrument_coverage: if_regular!(sess.instrument_coverage(), false),

sanitizer: if_regular!(sess.sanitizers(), SanitizerSet::empty()),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ fn test_unstable_options_tracking_hash() {
);
tracked!(crate_attr, vec!["abc".to_string()]);
tracked!(cross_crate_inline_threshold, InliningThreshold::Always);
tracked!(debug_info_for_profiling, true);
tracked!(debug_info_type_line_numbers, true);
tracked!(debuginfo_for_profiling, true);
tracked!(default_visibility, Some(rustc_target::spec::SymbolVisibility::Hidden));
tracked!(dep_info_omit_d_target, true);
tracked!(direct_access_external_data, Some(true));
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2252,12 +2252,12 @@ options! {
"inject the given attribute in the crate"),
cross_crate_inline_threshold: InliningThreshold = (InliningThreshold::Sometimes(100), parse_inlining_threshold, [TRACKED],
"threshold to allow cross crate inlining of functions"),
debug_info_for_profiling: bool = (false, parse_bool, [TRACKED],
"emit discriminators and other data necessary for AutoFDO"),
debug_info_type_line_numbers: bool = (false, parse_bool, [TRACKED],
"emit type and line information for additional data types (default: no)"),
debuginfo_compression: DebugInfoCompression = (DebugInfoCompression::None, parse_debuginfo_compression, [TRACKED],
"compress debug info sections (none, zlib, zstd, default: none)"),
debuginfo_for_profiling: bool = (false, parse_bool, [TRACKED],
"emit discriminators and other data necessary for AutoFDO"),
deduplicate_diagnostics: bool = (true, parse_bool, [UNTRACKED],
"deduplicate identical diagnostics (default: yes)"),
default_visibility: Option<SymbolVisibility> = (None, parse_opt_symbol_visibility, [TRACKED],
Expand Down
20 changes: 17 additions & 3 deletions library/stdarch/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,19 @@ jobs:
- armv7-unknown-linux-gnueabihf
- x86_64-unknown-linux-gnu
profile: [dev, release]
cc: [clang, gcc]
include:
- target: aarch64_be-unknown-linux-gnu
build_std: true

- target: x86_64-unknown-linux-gnu
cc: icx
profile: dev
- target: x86_64-unknown-linux-gnu
cc: icx
profile: release
exclude:
- target: armv7-unknown-linux-gnueabihf
cc: gcc
steps:
- uses: actions/checkout@v6
- name: Install Rust
Expand All @@ -297,18 +306,19 @@ jobs:
rustup component add rust-src
echo "CARGO_UNSTABLE_BUILD_STD=std" >> $GITHUB_ENV
if: ${{ matrix.build_std }}
- run: rustup component add rustfmt

# Configure some env vars based on matrix configuration
- run: echo "PROFILE=${{ matrix.profile }}" >> $GITHUB_ENV
- run: ./ci/intrinsic-test-docker.sh ${{ matrix.target }}
- run: ./ci/intrinsic-test-docker.sh ${{ matrix.target }} ${{ matrix.cc }}
if: ${{ !startsWith(matrix.target, 'thumb') }}
env:
TARGET: ${{ matrix.target }}

# Check that the generated files agree with the checked-in versions.
check-stdarch-gen:
needs: [style]
name: Check stdarch-gen-{arm, loongarch, hexagon} output
name: Check stdarch-gen-{arm, loongarch, hexagon, hexagon-scalar} output
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -330,6 +340,10 @@ jobs:
run: |
cargo run -p stdarch-gen-hexagon --release
git diff --exit-code
- name: Check hexagon scalar
run: |
cargo run -p stdarch-gen-hexagon-scalar --release
git diff --exit-code

# Run some tests with Miri. Most stdarch functions use platform-specific intrinsics
# that Miri does not support. Also Miri is reltively slow.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ RUN wget https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-22.1.4-x86_64
RUN mkdir llvm
RUN tar -xvf llvm.tar.xz --strip-components=1 -C llvm

ENV PATH="/llvm/bin:$PATH"
ENV CLANG_PATH="/llvm/bin/clang"
ENV GCC_PATH=aarch64-linux-gnu-gcc

ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64 -cpu max -L /usr/aarch64-linux-gnu" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ RUN wget https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-22.1.4-x86_64
RUN mkdir llvm
RUN tar -xvf llvm.tar.xz --strip-components=1 -C llvm

ENV PATH="/llvm/bin:$PATH"

ENV AARCH64_BE_TOOLCHAIN="/toolchains/${TOOLCHAIN}"
ENV AARCH64_BE_LIBC="${AARCH64_BE_TOOLCHAIN}/aarch64_be-none-linux-gnu/libc"

ENV CLANG_PATH="/llvm/bin/clang"
ENV GCC_PATH="${AARCH64_BE_TOOLCHAIN}/bin/aarch64_be-none-linux-gnu-gcc"

ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER="${AARCH64_BE_TOOLCHAIN}/bin/aarch64_be-none-linux-gnu-gcc"
ENV CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER="qemu-aarch64_be -cpu max -L ${AARCH64_BE_LIBC}"
ENV OBJDUMP="${AARCH64_BE_TOOLCHAIN}/bin/aarch64_be-none-linux-gnu-objdump"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ RUN wget https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-22.1.4-x86_64
RUN mkdir llvm
RUN tar -xvf llvm.tar.xz --strip-components=1 -C llvm

ENV PATH="/llvm/bin:$PATH"
ENV CLANG_PATH="/llvm/bin/clang"
ENV GCC_PATH=arm-linux-gnueabihf-gcc

ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -cpu max -L /usr/arm-linux-gnueabihf" \
Expand Down
16 changes: 14 additions & 2 deletions library/stdarch/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
ca-certificates \
wget \
xz-utils
xz-utils \
gpg

RUN wget http://ci-mirrors.rust-lang.org/sde-external-10.8.0-2026-03-15-lin.tar.xz -O sde.tar.xz
RUN mkdir intel-sde
Expand All @@ -16,7 +17,18 @@ RUN wget https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-22.1.4-x86_64
RUN mkdir llvm
RUN tar -xvf llvm.tar.xz --strip-components=1 -C llvm

ENV PATH="/llvm/bin:$PATH"
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB |\
gpg --dearmor |\
tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null

RUN echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" |\
tee /etc/apt/sources.list.d/oneAPI.list

RUN apt-get update && apt-get install -y --no-install-recommends intel-oneapi-compiler-dpcpp-cpp

ENV CLANG_PATH="/llvm/bin/clang"
ENV GCC_PATH="gcc"
ENV ICX_PATH="/opt/intel/oneapi/compiler/2026.0/bin/icx"

ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/intel-sde/sde64 \
-cpuid-in /checkout/ci/docker/x86_64-unknown-linux-gnu/cpuid.def \
Expand Down
9 changes: 4 additions & 5 deletions library/stdarch/ci/intrinsic-test-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

set -ex

if [ $# -lt 1 ]; then
>&2 echo "Usage: $0 <TARGET>"
if [ $# -lt 2 ]; then
>&2 echo "Usage: $0 <TARGET> <CC>"
exit 1
fi

Expand All @@ -29,7 +29,6 @@ run() {
--user "$(id -u)":"$(id -g)" \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
--env TARGET="${1}" \
--env PROFILE \
--env "${HOST_LINKER}"="cc" \
--env STDARCH_DISABLE_ASSERT_INSTR \
Expand All @@ -48,12 +47,12 @@ run() {
--workdir /checkout \
--privileged \
stdarch \
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/intrinsic-test.sh"
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/intrinsic-test.sh ${1} ${2}"
}

if [ -z "$1" ]; then
>&2 echo "No target specified!"
exit 1
else
run "${1}"
run "${1}" "${2}"
fi
55 changes: 39 additions & 16 deletions library/stdarch/ci/intrinsic-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,30 @@

set -ex

: "${TARGET?The TARGET environment variable must be set.}"
if [ $# -lt 2 ]; then
>&2 echo "Usage: $0 <TARGET> <CC>"
exit 1
fi

case ${2} in
clang)
export CC="${CLANG_PATH}"
CC_ARG_STYLE=clang
;;
gcc)
export CC="${GCC_PATH}"
CC_ARG_STYLE=gcc
;;
icx)
export CC="${ICX_PATH}"
# `icx` uses clang-style arguments
CC_ARG_STYLE=clang
;;
*)
>&2 echo "Unknown compiler: ${2}"
exit 1
;;
esac

export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled -Z verify-llvm-ir"
export PROFILE="${PROFILE:="release"}"
Expand All @@ -12,49 +35,49 @@ echo "PROFILE=${PROFILE}"

INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml"

export CC="clang"

case ${TARGET} in
case ${1} 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"
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64_be.txt
ARCH=aarch64_be
;;

aarch64*)
export CFLAGS="-I/usr/aarch64-linux-gnu/include/"
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt
ARCH=aarch64
;;

armv7*)
export CFLAGS="-I/usr/arm-linux-gnueabihf/include/"
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_arm.txt
ARCH=arm
;;

x86_64*)
export CFLAGS="-I/usr/include/x86_64-linux-gnu/"
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_x86.txt
ARCH=x86
;;
*)
;;

esac

case "${TARGET}" in
case "${1}" in
x86_64-unknown-linux-gnu*)
env -u CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER \
cargo run "${INTRINSIC_TEST}" --release \
--bin intrinsic-test -- intrinsics_data/x86-intel.xml \
--skip "${TEST_SKIP_INTRINSICS}" \
--target "${TARGET}"

echo "${CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER}"
--skip "crates/intrinsic-test/missing_${ARCH}_common.txt" \
--skip "crates/intrinsic-test/missing_${ARCH}_${2}.txt" \
--target "${1}" \
--cc-arg-style "${CC_ARG_STYLE}"
;;
*)
cargo run "${INTRINSIC_TEST}" --release \
--bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \
--skip "${TEST_SKIP_INTRINSICS}" \
--target "${TARGET}"
--skip "crates/intrinsic-test/missing_${ARCH}_common.txt" \
--skip "crates/intrinsic-test/missing_${ARCH}_${2}.txt" \
--target "${1}" \
--cc-arg-style "${CC_ARG_STYLE}"
;;
esac

cargo test --manifest-path=rust_programs/Cargo.toml --target "${TARGET}" --profile "${PROFILE}"
cargo test --manifest-path=rust_programs/Cargo.toml --target "${1}" --profile "${PROFILE}" --tests
Loading
Loading