You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.1 KiB

  1. From ca3b8191510c1006d031d02c50edcf6b4f6a6e8f Mon Sep 17 00:00:00 2001
  2. From: R4SAS <r4sas@i2pmail.org>
  3. Date: Thu, 10 Dec 2020 18:32:41 +0300
  4. Subject: [PATCH] [avx] check ig c++ target supports AVX
  5. Signed-off-by: R4SAS <r4sas@i2pmail.org>
  6. ---
  7. libi2pd/Crypto.cpp | 2 +-
  8. 1 file changed, 1 insertion(+), 1 deletion(-)
  9. --- a/libi2pd/Crypto.cpp
  10. +++ b/libi2pd/Crypto.cpp
  11. @@ -638,7 +638,7 @@ namespace crypto
  12. {
  13. uint64_t buf[256];
  14. uint64_t hash[12]; // 96 bytes
  15. -#if defined(__x86_64__) || defined(__i386__)
  16. +#if (defined(__x86_64__) || defined(__i386__)) && defined(__AVX__) // not all X86 targets supports AVX (like old Pentium, see #1600)
  17. if(i2p::cpu::avx)
  18. {
  19. __asm__
  20. --- a/libi2pd/Identity.cpp
  21. +++ b/libi2pd/Identity.cpp
  22. @@ -828,7 +828,7 @@ namespace data
  23. XORMetric operator^(const IdentHash& key1, const IdentHash& key2)
  24. {
  25. XORMetric m;
  26. -#if defined(__x86_64__) || defined(__i386__)
  27. +#if (defined(__x86_64__) || defined(__i386__)) && defined(__AVX__) // not all X86 targets supports AVX (like old Pentium, see #1600)
  28. if(i2p::cpu::avx)
  29. {
  30. __asm__