Skip to content

Stdarch push #59

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

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
603eb4c
std_detect: RISC-V platform guide documentation (non-table part)
a4lg Apr 30, 2025
55caf7d
Feat: Moved majority of the code to `arm` module.
madhav-madhusoodanan Mar 25, 2025
368a376
Chore: Added `SupportedArchitectureTest` trait which must be implemen…
madhav-madhusoodanan Mar 25, 2025
eda329a
chore: Added `ProcessedCli` to extract the logic to pre-process CLI s…
madhav-madhusoodanan Mar 26, 2025
c658282
chore: separated common logic within file creations, compile_c, compi…
madhav-madhusoodanan Mar 27, 2025
bae4d84
chore: code consolidation
madhav-madhusoodanan Mar 27, 2025
18a0177
chore: added match block in `src/main.rs`
madhav-madhusoodanan Mar 27, 2025
db00aea
fixed `too many files open` issue
madhav-madhusoodanan Mar 30, 2025
c3c824d
maintaining special list of targets which need different execution co…
madhav-madhusoodanan Apr 2, 2025
62c11af
rename struct for naming consistency
madhav-madhusoodanan Apr 2, 2025
ba61006
test commit to check if `load_Values_c` can be dissociated from targe…
madhav-madhusoodanan Apr 13, 2025
d04f970
added target field within `IntrinsicType` to perform target level che…
madhav-madhusoodanan Apr 14, 2025
0c2edc8
Updated `Argument::from_c` to remove `ArgPrep` specific argument
madhav-madhusoodanan Apr 14, 2025
b1be712
introduced generic types and code refactor
madhav-madhusoodanan Apr 16, 2025
dc83a0a
Added a macro to simplify <Arch>IntrinsicType definitions
madhav-madhusoodanan Apr 16, 2025
1553d3c
renamed `a64_only` data member in `Intrinsic` to `arch_tags`
madhav-madhusoodanan Apr 16, 2025
41d9d48
Removed aarch64-be specific execution command for rust test files
madhav-madhusoodanan Apr 17, 2025
42a058a
moved the C compilation commands into a struct for easier handling
madhav-madhusoodanan Apr 18, 2025
0876b4b
Added dynamic dispatch for easier management of `<arch>ArchitectureTe…
madhav-madhusoodanan Apr 19, 2025
ff0f1e1
code cleanup
madhav-madhusoodanan Apr 19, 2025
5e9936f
chore: file renaming
madhav-madhusoodanan Apr 23, 2025
ee7e038
feat: made constraint common
madhav-madhusoodanan Apr 28, 2025
4d126bc
fix: aarch64_be issues wthin compilation
madhav-madhusoodanan May 4, 2025
75a7c75
moved more code generation functionality to `common`
madhav-madhusoodanan May 10, 2025
dc7e314
feat: merging changes related to f16 formatting
madhav-madhusoodanan May 21, 2025
d74d842
Fix: removed BaseIntrinsicTypeDefinition + code cleanup
madhav-madhusoodanan May 25, 2025
6a8aca7
fix: moved f16 formatting code to common module
madhav-madhusoodanan May 25, 2025
45b8bca
fix: moved common code (that required no architecture-specific
madhav-madhusoodanan May 25, 2025
759782a
fix: code cleanup and renaming
madhav-madhusoodanan May 26, 2025
b63351c
Check cfg on features that stage0 compiler support
a4lg May 14, 2025
5a9574f
cmpxchg16b: use atomic_compare_exchange from libcore
RalfJung May 29, 2025
02a386f
mark gfni, vaes, vpclmulqdq intrinsics as safe
usamoi May 29, 2025
bc716c6
Fix `ldpte` and `lddir` signature
sayantn May 27, 2025
15f9525
Fix PPC shift and rotate intrinsics
sayantn May 27, 2025
438d179
Fix s390x intrinsics
sayantn May 27, 2025
59996d2
Use the new definition of `rdtscp` intrinsic
sayantn May 27, 2025
5b37dce
Upgrade more intrinsics to the new version
sayantn May 28, 2025
f8ec2d2
Add back `std_detect_env_override`
sayantn May 22, 2025
86877dc
RISC-V: Linux: Imply Zicntr from the IMA base behavior
a4lg May 26, 2025
d458ca3
stdarch-gen-arm: Modernization of the coding style
a4lg May 31, 2025
bf3d936
stdarch-gen-loongarch: Modernization of the coding style
a4lg May 31, 2025
db93f4d
stdarch-test: Modernization of the coding style
a4lg May 31, 2025
9791d46
stdarch-verify: Modernization of the coding style
a4lg May 31, 2025
1bd585f
stdarch_examples: Modernization of the coding style
a4lg May 31, 2025
2424f76
intrinsic-test: Modernization of the coding style
a4lg May 31, 2025
21e8509
Stabilize keylocker intrinsics and runtime detection
sayantn May 7, 2025
9a79c71
Stabilize `sha512`, `sm3` and `sm4` intrinsics and runtime detection
sayantn May 7, 2025
dded875
intrinsic-test: Use `c_prefix` to generate type names
a4lg May 31, 2025
054b350
intrinsic-test: Reverse `has_constraints()` condition
a4lg May 31, 2025
68b9026
use `simd_bitreverse` on `aarch64`
folkertdev May 30, 2025
ab88608
RISC-V: Linux 6.15 `riscv_hwprobe` support
a4lg May 31, 2025
f282add
Removed library/stdarch submodule
Kobzol Jun 2, 2025
64131ba
Merge `stdarch` as a Josh subtree
Kobzol Jun 2, 2025
66f684f
Add autolabel and mentions entries to triagebot.toml
Kobzol Jun 2, 2025
0a0eab7
WIP1
Kobzol Jun 2, 2025
631bac0
WIP2
Kobzol Jun 2, 2025
e5417b0
rust-version
Kobzol Jun 2, 2025
65b73e4
Preparing for merge from rustc
Kobzol Jun 2, 2025
4936216
Merge from rustc
Kobzol Jun 2, 2025
e532d39
Merge pull request #1 from Kobzol/josh-pull
Kobzol Jun 2, 2025
34acb2c
WIP
Kobzol Jun 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
path = src/doc/rust-by-example
url = https://github.com/rust-lang/rust-by-example.git
shallow = true
[submodule "library/stdarch"]
path = library/stdarch
url = https://github.com/rust-lang/stdarch.git
shallow = true
[submodule "src/doc/edition-guide"]
path = src/doc/edition-guide
url = https://github.com/rust-lang/edition-guide.git
Expand Down
2 changes: 2 additions & 0 deletions COPYRIGHT
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Longer version:
Copyrights in the Rust project are retained by their contributors. No
copyright assignment is required to contribute to the Rust project.

FOO

Some files include explicit copyright notices and/or license notices.
For full authorship information, see the version control history or
<https://thanks.rust-lang.org>
Expand Down
1 change: 0 additions & 1 deletion library/stdarch
Submodule stdarch deleted from b6e224
17 changes: 17 additions & 0 deletions library/stdarch/.cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
task:
name: x86_64-unknown-freebsd
freebsd_instance:
image_family: freebsd-13-4
env:
# FIXME(freebsd): FreeBSD has a segfault when `RUST_BACKTRACE` is set
# https://github.com/rust-lang/rust/issues/132185
RUST_BACKTRACE: "0"
setup_script:
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh --default-toolchain nightly -y
- . $HOME/.cargo/env
- rustup default nightly
test_script:
- . $HOME/.cargo/env
- cargo build --all
# FOO
4 changes: 4 additions & 0 deletions library/stdarch/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Use `git config blame.ignorerevsfile .git-blame-ignore-revs` to make `git blame` ignore the following commits.

# format with style edition 2024
fc87bd98d689590a0b6f5ee4110c5b9f962faa66
288 changes: 288 additions & 0 deletions library/stdarch/.github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
name: CI
on:
pull_request:
merge_group:

jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: ci/style.sh

docs:
name: Build Documentation
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: ci/dox.sh
env:
CI: 1

verify:
name: Automatic intrinsic verification
needs: [style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: cargo test --manifest-path crates/stdarch-verify/Cargo.toml

test:
needs: [style]
name: Test
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
profile:
- dev
- release
target:
# Dockers that are run through docker on linux
- tuple: i686-unknown-linux-gnu
os: ubuntu-latest
- tuple: x86_64-unknown-linux-gnu
os: ubuntu-latest
- tuple: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- tuple: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- tuple: aarch64-unknown-linux-gnu
os: ubuntu-latest
- tuple: aarch64_be-unknown-linux-gnu
os: ubuntu-latest
- tuple: riscv32gc-unknown-linux-gnu
os: ubuntu-latest
- tuple: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc64-unknown-linux-gnu
os: ubuntu-latest
- tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- tuple: mips-unknown-linux-gnu
# os: ubuntu-latest
#- tuple: mips64-unknown-linux-gnuabi64
# os: ubuntu-latest
#- tuple: mips64el-unknown-linux-gnuabi64
# os: ubuntu-latest
#- tuple: mipsel-unknown-linux-musl
# os: ubuntu-latest
- tuple: s390x-unknown-linux-gnu
os: ubuntu-latest
- tuple: i586-unknown-linux-gnu
os: ubuntu-latest
- tuple: nvptx64-nvidia-cuda
os: ubuntu-latest
- tuple: thumbv6m-none-eabi
os: ubuntu-latest
- tuple: thumbv7m-none-eabi
os: ubuntu-latest
- tuple: thumbv7em-none-eabi
os: ubuntu-latest
- tuple: thumbv7em-none-eabihf
os: ubuntu-latest
- tuple: loongarch64-unknown-linux-gnu
os: ubuntu-latest
- tuple: wasm32-wasip1
os: ubuntu-latest

# macOS targets
- tuple: x86_64-apple-darwin
os: macos-15-large
- tuple: x86_64-apple-ios-macabi
os: macos-15-large
- tuple: aarch64-apple-darwin
os: macos-15
- tuple: aarch64-apple-ios-macabi
os: macos-15
# FIXME: gh-actions build environment doesn't have linker support
# - tuple: i686-apple-darwin
# os: macos-13

# Windows targets
- tuple: x86_64-pc-windows-msvc
os: windows-2025
- tuple: i686-pc-windows-msvc
os: windows-2025
- tuple: aarch64-pc-windows-msvc
os: windows-11-arm
- tuple: x86_64-pc-windows-gnu
os: windows-2025
# - tuple: i686-pc-windows-gnu
# os: windows-latest

# Add additional variables to the matrix variations generated above using `include`:
include:
# `TEST_EVERYTHING` setups - there should be at least 1 for each architecture
- target:
tuple: aarch64-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: aarch64_be-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
build_std: true
- target:
tuple: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
test_everything: true
- target:
tuple: loongarch64-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: powerpc-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
test_everything: true
- target:
tuple: powerpc64-unknown-linux-gnu
os: ubuntu-latest
disable_assert_instr: true
test_everything: true
- target:
tuple: powerpc64le-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: riscv32gc-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
build_std: true
- target:
tuple: riscv64gc-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: s390x-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
- target:
tuple: x86_64-unknown-linux-gnu
os: ubuntu-latest
test_everything: true
# MIPS targets disabled since they are dropped to tier 3.
# See https://github.com/rust-lang/compiler-team/issues/648
#- target:
# tuple: mips-unknown-linux-gnu
# os: ubuntu-latest
# norun: true
#- target:
# tuple: mips64-unknown-linux-gnuabi64
# os: ubuntu-latest
# norun: true
#- target:
# tuple: mips64el-unknown-linux-gnuabi64
# os: ubuntu-latest
# norun: true
#- target:
# tuple: mipsel-unknown-linux-musl
# os: ubuntu-latest
# norun: true
- target:
tuple: aarch64-apple-darwin
os: macos-15
norun: true # https://github.com/rust-lang/stdarch/issues/1206
- target:
tuple: aarch64-apple-ios-macabi
os: macos-15
norun: true # https://github.com/rust-lang/stdarch/issues/1206

steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update nightly --no-self-update
rustup default nightly
shell: bash
if: matrix.target.os != 'windows-11-arm'
- name: Install Rust for `windows-11-arm` runners
# The arm runners don't have Rust pre-installed (https://github.com/actions/partner-runner-images/issues/77)
run: |
curl https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
shell: bash
if: matrix.target.os == 'windows-11-arm'

- run: rustup target add ${{ matrix.target.tuple }}
shell: bash
if: matrix.build_std == ''
- run: |
rustup component add rust-src
echo "CARGO_UNSTABLE_BUILD_STD=std" >> $GITHUB_ENV
shell: bash
if: matrix.build_std != ''

# Configure some env vars based on matrix configuration
- run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
shell: bash
- run: echo "NORUN=1" >> $GITHUB_ENV
shell: bash
if: matrix.norun != '' || startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'
- run: echo "STDARCH_TEST_EVERYTHING=1" >> $GITHUB_ENV
shell: bash
if: matrix.test_everything != ''
- run: echo "STDARCH_DISABLE_ASSERT_INSTR=1" >> $GITHUB_ENV
shell: bash
if: matrix.disable_assert_instr != ''
- run: echo "NOSTD=1" >> $GITHUB_ENV
shell: bash
if: startsWith(matrix.target.tuple, 'thumb') || matrix.target.tuple == 'nvptx64-nvidia-cuda'

# Windows & OSX go straight to `run.sh` ...
- run: ./ci/run.sh
shell: bash
if: matrix.target.os != 'ubuntu-latest' || startsWith(matrix.target.tuple, 'thumb')
env:
TARGET: ${{ matrix.target.tuple }}

# ... while Linux goes to `run-docker.sh`
- run: ./ci/run-docker.sh ${{ matrix.target.tuple }}
shell: bash
if: matrix.target.os == 'ubuntu-latest' && !startsWith(matrix.target.tuple, 'thumb')
env:
TARGET: ${{ matrix.target.tuple }}

build-std-detect:
needs: [style]
name: Build std_detect
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: ./ci/build-std-detect.sh

conclusion:
needs:
- docs
- verify
- test
- build-std-detect
runs-on: ubuntu-latest
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
#
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
if: ${{ !cancelled() }} # make sure this is never "skipped"
steps:
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
10 changes: 10 additions & 0 deletions library/stdarch/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Cargo.lock
.*.swp
target
tags
crates/stdarch-gen-arm/aarch64.rs
crates/stdarch-gen-arm/arm.rs
crates/stdarch-gen-loongarch/lasx.c
crates/stdarch-gen-loongarch/lsx.c
c_programs/*
rust_programs/*
Empty file added library/stdarch/.gitmodules
Empty file.
Loading
Loading