From: Mark Wooding Date: Fri, 15 Nov 2019 17:09:01 +0000 (+0000) Subject: *.c: Check for ARM64 SIMD before using the accelerated code. X-Git-Tag: 2.6.0~7 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/54d36e7b0c6471567376158a5790756d90fb9f80 *.c: Check for ARM64 SIMD before using the accelerated code. I don't expect ARM64 processors to omit the SIMD instructions, but it's convenient to have a way to inhibit the accelerated code (e.g., for performance measurement). --- diff --git a/math/mpmont.c b/math/mpmont.c index 6109c856..b4bf982e 100644 --- a/math/mpmont.c +++ b/math/mpmont.c @@ -125,7 +125,8 @@ static redccore__functype *pick_redccore(void) cpu_feature_p(CPUFEAT_ARM_NEON)); #endif #if CPUFAM_ARM64 - DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_arm64_simd, 1); + DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_arm64_simd, + cpu_feature_p(CPUFEAT_ARM_NEON)); #endif DISPATCH_PICK_FALLBACK(mpmont_reduce, simple_redccore); } @@ -246,7 +247,8 @@ static mulcore__functype *pick_mulcore(void) cpu_feature_p(CPUFEAT_ARM_NEON)); #endif #if CPUFAM_ARM64 - DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_arm64_simd, 1); + DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_arm64_simd, + cpu_feature_p(CPUFEAT_ARM_NEON)); #endif DISPATCH_PICK_FALLBACK(mpmont_mul, simple_mulcore); } diff --git a/math/mpx.c b/math/mpx.c index d3d0a04a..ac826883 100644 --- a/math/mpx.c +++ b/math/mpx.c @@ -958,7 +958,8 @@ static mpx_umul__functype *pick_umul(void) cpu_feature_p(CPUFEAT_ARM_NEON)); #endif #if CPUFAM_ARM64 - DISPATCH_PICK_COND(mpx_umul, maybe_umul4_arm64_simd, 1); + DISPATCH_PICK_COND(mpx_umul, maybe_umul4_arm64_simd, + cpu_feature_p(CPUFEAT_ARM_NEON)); #endif DISPATCH_PICK_FALLBACK(mpx_umul, simple_umul); }