From fd97121e8aa3f74f5d232774e4af0984b7b5e066 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 6 Aug 2017 06:04:01 -0400 Subject: [PATCH] Fix VMULL_P64 and VMULL_HIGH_P64 on GCC117 GCC117 uses GCC 4.8, and it revealed a missing preprocessor code path --- gcm-simd.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gcm-simd.cpp b/gcm-simd.cpp index 3c7c9a29..366597a4 100644 --- a/gcm-simd.cpp +++ b/gcm-simd.cpp @@ -39,9 +39,9 @@ ANONYMOUS_NAMESPACE_BEGIN -// GCC 4.8 and 4.9 are missing PMULL gear +// GCC 4.8 is missing PMULL gear #if (CRYPTOPP_ARM_PMULL_AVAILABLE) -# if (CRYPTOPP_GCC_VERSION >= 40800) && (CRYPTOPP_GCC_VERSION < 50000) +# if (CRYPTOPP_GCC_VERSION >= 40800) && (CRYPTOPP_GCC_VERSION < 49000) inline poly128_t VMULL_P64(poly64_t a, poly64_t b) { return __builtin_aarch64_crypto_pmulldi_ppp (a, b); @@ -51,6 +51,16 @@ inline poly128_t VMULL_HIGH_P64(poly64x2_t a, poly64x2_t b) { return __builtin_aarch64_crypto_pmullv2di_ppp (a, b); } +# else +inline poly128_t VMULL_P64(poly64_t a, poly64_t b) +{ + return vmull_p64(a, b); +} + +inline poly128_t VMULL_HIGH_P64(poly64x2_t a, poly64x2_t b) +{ + return vmull_high_p64(a, b); +} # endif #endif