Skip to content

Commit 49e92a2

Browse files
committed
Improve powerpc subnormal flushing check
1 parent 5c6405b commit 49e92a2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ jobs:
186186
# - mips64-unknown-linux-gnuabi64
187187
target_feature: [default]
188188
include:
189+
- { target: powerpc-unknown-linux-gnu, target_feature: "+altivec" }
189190
- { target: powerpc64-unknown-linux-gnu, target_feature: "+vsx" }
190191
- { target: powerpc64le-unknown-linux-gnu, target_feature: "+vsx" }
191192
# We should test this, but cross currently can't run it
@@ -217,9 +218,6 @@ jobs:
217218
case "${{ matrix.target_feature }}" in
218219
default)
219220
echo "RUSTFLAGS=" >> $GITHUB_ENV;;
220-
native)
221-
echo "RUSTFLAGS=-Ctarget-cpu=native" >> $GITHUB_ENV
222-
;;
223221
*)
224222
echo "RUSTFLAGS=-Ctarget-feature=${{ matrix.target_feature }}" >> $GITHUB_ENV
225223
;;

crates/test_helpers/src/subnormals.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ macro_rules! impl_float {
1313
impl FlushSubnormals for $ty {
1414
fn flush(self) -> Self {
1515
let is_f32 = core::mem::size_of::<Self>() == 4;
16-
let ppc_flush = is_f32 && cfg!(all(target_arch = "powerpc64", target_endian = "big", not(target_feature = "vsx")));
16+
let ppc_flush = is_f32 && cfg!(all(
17+
any(target_arch = "powerpc", all(target_arch = "powerpc64", target_endian = "big")),
18+
target_feature = "altivec",
19+
not(target_feature = "vsx"),
20+
));
1721
let arm_flush = is_f32 && cfg!(all(target_arch = "arm", target_feature = "neon"));
1822
let flush = ppc_flush || arm_flush;
1923
if flush && self.is_subnormal() {

0 commit comments

Comments
 (0)