security/nflib: Improve handling of SIMD instructions

PR:		272702
2023Q4
Daniel Engberg 2023-08-07 00:06:41 -07:00 committed by Yuri Victorovich
parent 4091219243
commit dbe826b864
3 changed files with 43 additions and 1 deletions

View File

@ -2,7 +2,7 @@ PORTNAME= nflib
DISTVERSIONPREFIX= v
DISTVERSION= 1.0.0-23
DISTVERSIONSUFFIX= -g5cf40ed
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= security math
MAINTAINER= yuri@FreeBSD.org

View File

@ -0,0 +1,19 @@
--- include/nfl/arch.hpp.orig 2023-07-24 21:28:33 UTC
+++ include/nfl/arch.hpp
@@ -3,14 +3,10 @@
#include "nfl/arch/common.hpp"
-#ifdef NFL_OPTIMIZED
-
-#if defined __AVX2__ && defined NTT_AVX2
+#if defined __AVX2__ && defined __SSE4_2__
#define CC_SIMD nfl::simd::avx2
-#elif defined __SSE4_2__ && defined NTT_SSE
+#elif defined __SSE4_2__ && !defined __AVX2__
#define CC_SIMD nfl::simd::sse
-#endif
-
#endif
#ifndef CC_SIMD

View File

@ -0,0 +1,23 @@
--- include/nfl/ops.hpp.orig 2023-07-24 21:30:23 UTC
+++ include/nfl/ops.hpp
@@ -281,18 +281,14 @@ struct _make_op<shoup<type, tag0>, expr<mulmod<type, t
} // nfl
-#ifdef NFL_OPTIMIZED
-
#include "nfl/opt/ops.hpp"
-#if defined __SSE4_2__ && defined NTT_SSE
+#if defined __SSE4_2__ && !defined __AVX2__
#include "nfl/opt/arch/sse.hpp"
#endif
-#if defined __AVX2__ && defined NTT_AVX2
+#if defined __AVX2__ && defined __SSE4_2__
#include "nfl/opt/arch/avx2.hpp"
-#endif
-
#endif
#endif