From 54d36e7b0c6471567376158a5790756d90fb9f80 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 15 Nov 2019 17:09:01 +0000 Subject: [PATCH] *.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). --- math/mpmont.c | 6 ++++-- math/mpx.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) 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); } -- 2.11.0