From bedbafd4d8952e08800943b7f99f81b635f81e0d Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 5 Jul 2025 15:56:44 -0400 Subject: [PATCH 1/5] Add native CI for Aarch64 --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c8e7d62816..ef7e7e569f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,14 +17,17 @@ env: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ${{ matrix.os.image }} strategy: fail-fast: false matrix: + os: + - { image: ubuntu-24.04, asset_name_suffix: "" } + - { image: ubuntu-24.04-arm, asset_name_suffix: "-aarch64" } libgccjit_version: - - { gcc: "gcc-15.deb" } - - { gcc: "gcc-15-without-int128.deb" } + - { gcc: "gcc-15" } + - { gcc: "gcc-15-without-int128" } commands: [ "--std-tests", # FIXME: re-enable asm tests when GCC can emit in the right syntax. @@ -56,11 +59,11 @@ jobs: run: rustup component add rustfmt clippy - name: Download artifact - run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }} + run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }}${{ matrix.os.asset_name_suffix }}.deb - name: Setup path to libgccjit run: | - sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }} + sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }}${{ matrix.os.asset_name_suffix }}.deb echo 'gcc-path = "/usr/lib/"' > config.toml # Some run-make tests fail if we use our forked GCC because it doesn't From 9b166cc62a7191435a0c233d4ed0c76ea98ac4f3 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 25 Oct 2025 12:59:51 -0400 Subject: [PATCH 2/5] Do not update cc to point to GCC 14 on Aarch64 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef7e7e569f7..9cc70cf4f6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,6 +70,7 @@ jobs: # bundle libstdc++, so we switch to gcc-14 to have a GCC that has # libstdc++. - name: Set default GCC to gcc-14 + if: ${{ matrix.os.image == 'ubuntu-24.04' }} # TODO: check why this breaks the CI on Aarch64. run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 30 - name: Set env From 8026bafb011dbc7f9e64b46e58a200261dae97ab Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 25 Oct 2025 13:23:00 -0400 Subject: [PATCH 3/5] Do not disable neon feature --- src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9854f3843c4..45a8a0beb48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -479,10 +479,6 @@ fn to_gcc_opt_level(optlevel: Option) -> OptimizationLevel { /// Returns the features that should be set in `cfg(target_feature)`. fn target_config(sess: &Session, target_info: &LockedTargetInfo) -> TargetConfig { let (unstable_target_features, target_features) = cfg_target_feature(sess, |feature| { - // TODO: we disable Neon for now since we don't support the LLVM intrinsics for it. - if feature == "neon" { - return false; - } target_info.cpu_supports(feature) // cSpell:disable /* From d391457ddac9ab6b7871acb0dc1db22a0656e391 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sat, 25 Oct 2025 14:28:29 -0400 Subject: [PATCH 4/5] Add missing neon intrinsics --- src/intrinsic/llvm.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/intrinsic/llvm.rs b/src/intrinsic/llvm.rs index 39dba28b24c..37bbfeaa8d5 100644 --- a/src/intrinsic/llvm.rs +++ b/src/intrinsic/llvm.rs @@ -1567,6 +1567,8 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function "llvm.x86.avx512.uitofp.round.v8f32.v8i64" => "__builtin_ia32_cvtuqq2ps512_mask", "llvm.x86.avx512.uitofp.round.v4f32.v4i64" => "__builtin_ia32_cvtuqq2ps256_mask", + "llvm.aarch64.neon.umaxp.v16i8" => "__builtin_aarch64_umaxpv16qi", + // TODO: support the tile builtins: "llvm.x86.ldtilecfg" => "__builtin_trap", "llvm.x86.sttilecfg" => "__builtin_trap", From 9ea25b105743e1f2fde84bd7a46a00629436f798 Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Sun, 26 Oct 2025 16:28:47 -0400 Subject: [PATCH 5/5] Update GCC version --- libgccjit.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgccjit.version b/libgccjit.version index b8d4166542b..a284613ac27 100644 --- a/libgccjit.version +++ b/libgccjit.version @@ -1 +1 @@ -28b84db392ac0a572f1a2a2a1317aa5f2bc742cb +2a958ef3631207f0f02872ad7b950101b774f9b9