about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Zulawski <caleb.zulawski@gmail.com>2023-07-22 14:18:16 -0400
committerCaleb Zulawski <caleb.zulawski@gmail.com>2023-07-22 14:18:16 -0400
commit49e92a2918f9f3d95ad8a0060a2d63d6f7b52950 (patch)
treece6988c4df8becae47cb098ba92af47a7dec60f2
parent5c6405ba8956d5a0252789b7152fb0c5b684b67f (diff)
downloadrust-49e92a2918f9f3d95ad8a0060a2d63d6f7b52950.tar.gz
rust-49e92a2918f9f3d95ad8a0060a2d63d6f7b52950.zip
Improve powerpc subnormal flushing check
-rw-r--r--.github/workflows/ci.yml4
-rw-r--r--crates/test_helpers/src/subnormals.rs6
2 files changed, 6 insertions, 4 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c0429a1332c..42172968341 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -186,6 +186,7 @@ jobs:
           # - mips64-unknown-linux-gnuabi64
         target_feature: [default]
         include:
+          - { target: powerpc-unknown-linux-gnu, target_feature: "+altivec" }
           - { target: powerpc64-unknown-linux-gnu, target_feature: "+vsx" }
           - { target: powerpc64le-unknown-linux-gnu, target_feature: "+vsx" }
           # We should test this, but cross currently can't run it
@@ -217,9 +218,6 @@ jobs:
           case "${{ matrix.target_feature }}" in
             default)
               echo "RUSTFLAGS=" >> $GITHUB_ENV;;
-            native)
-              echo "RUSTFLAGS=-Ctarget-cpu=native" >> $GITHUB_ENV
-              ;;
             *)
               echo "RUSTFLAGS=-Ctarget-feature=${{ matrix.target_feature }}" >> $GITHUB_ENV
               ;;
diff --git a/crates/test_helpers/src/subnormals.rs b/crates/test_helpers/src/subnormals.rs
index 122304f96db..d46e8524116 100644
--- a/crates/test_helpers/src/subnormals.rs
+++ b/crates/test_helpers/src/subnormals.rs
@@ -13,7 +13,11 @@ macro_rules! impl_float {
         impl FlushSubnormals for $ty {
             fn flush(self) -> Self {
                 let is_f32 = core::mem::size_of::<Self>() == 4;
-                let ppc_flush = is_f32 && cfg!(all(target_arch = "powerpc64", target_endian = "big", not(target_feature = "vsx")));
+                let ppc_flush = is_f32 && cfg!(all(
+                    any(target_arch = "powerpc", all(target_arch = "powerpc64", target_endian = "big")),
+                    target_feature = "altivec",
+                    not(target_feature = "vsx"),
+                ));
                 let arm_flush = is_f32 && cfg!(all(target_arch = "arm", target_feature = "neon"));
                 let flush = ppc_flush || arm_flush;
                 if flush && self.is_subnormal() {