From 49e92a2918f9f3d95ad8a0060a2d63d6f7b52950 Mon Sep 17 00:00:00 2001 From: Caleb Zulawski Date: Sat, 22 Jul 2023 14:18:16 -0400 Subject: [PATCH] Improve powerpc subnormal flushing check --- .github/workflows/ci.yml | 4 +--- crates/test_helpers/src/subnormals.rs | 6 +++++- 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::() == 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() {