Skip to content

Check that the checked-in version of stdarch-gen-{arm, loongarch} is up-to-date #1877

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

Merged
merged 2 commits into from
Jul 18, 2025
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
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,28 @@ jobs:
env:
TARGET: ${{ matrix.target.tuple }}

# Check that the generated files agree with the checked-in versions.
check-stdarch-gen:
needs: [style]
name: Check stdarch-gen-{arm, loongarch} output
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- name: Check arm spec
run: |
cargo run --bin=stdarch-gen-arm --release -- crates/stdarch-gen-arm/spec
git diff --exit-code
- name: Check lsx.spec
run: |
cargo run --bin=stdarch-gen-loongarch --release -- crates/stdarch-gen-loongarch/lsx.spec
git diff --exit-code
- name: Check lasx.spec
run: |
cargo run --bin=stdarch-gen-loongarch --release -- crates/stdarch-gen-loongarch/lasx.spec
git diff --exit-code
build-std-detect:
needs: [style]
name: Build std_detect
Expand All @@ -271,6 +293,7 @@ jobs:
- verify
- test
- build-std-detect
- check-stdarch-gen
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
Expand Down
4 changes: 2 additions & 2 deletions crates/stdarch-gen-loongarch/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ fn gen_bind_body(
let fn_output = if out_t.to_lowercase() == "void" {
String::new()
} else {
format!("-> {}", type_to_rst(out_t, is_store))
format!(" -> {}", type_to_rst(out_t, is_store))
};
let fn_inputs = match para_num {
1 => format!("(a: {})", type_to_rst(in_t[0], is_store)),
Expand All @@ -304,7 +304,7 @@ fn gen_bind_body(
),
_ => panic!("unsupported parameter number"),
};
format!("fn __{current_name}{fn_inputs} {fn_output};")
format!("fn __{current_name}{fn_inputs}{fn_output};")
};
let function = format!(
r#" #[link_name = "llvm.loongarch.{}"]
Expand Down