From 9e580de53c219dd1a2cb8f90d659dc35cc424517 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Tue, 10 Nov 2020 21:15:50 +0300 Subject: [PATCH] correctly change target at compile time Signed-off-by: R4SAS --- libi2pd/Crypto.cpp | 4 ++++ libi2pd/Identity.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/libi2pd/Crypto.cpp b/libi2pd/Crypto.cpp index ff6e91a6..2abc6ca1 100644 --- a/libi2pd/Crypto.cpp +++ b/libi2pd/Crypto.cpp @@ -632,6 +632,7 @@ namespace crypto static const uint64_t opads[] = { OPAD, OPAD, OPAD, OPAD }; #if defined(__x86_64__) || defined(__i386__) +#pragma GCC push_options #pragma GCC target("avx") #endif void HMACMD5Digest (uint8_t * msg, size_t len, const MACKey& key, uint8_t * digest) @@ -694,6 +695,9 @@ namespace crypto // calculate digest MD5((uint8_t *)hash, 96, digest); } +#if defined(__x86_64__) || defined(__i386__) +#pragma GCC pop_options +#endif // AES #ifdef __AES__ diff --git a/libi2pd/Identity.cpp b/libi2pd/Identity.cpp index 3f62365b..10c20a71 100644 --- a/libi2pd/Identity.cpp +++ b/libi2pd/Identity.cpp @@ -826,6 +826,7 @@ namespace data } #if defined(__x86_64__) || defined(__i386__) +#pragma GCC push_options #pragma GCC target("avx") #endif XORMetric operator^(const IdentHash& key1, const IdentHash& key2) @@ -855,5 +856,9 @@ namespace data return m; } +#if defined(__x86_64__) || defined(__i386__) +#pragma GCC pop_options +#endif + } }