git: dbe826b8640b - main - security/nflib: Improve handling of SIMD instructions

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 07 Aug 2023 07:07:17 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dbe826b8640bbd7dc2952f796e7d4b8be691c37a

commit dbe826b8640bbd7dc2952f796e7d4b8be691c37a
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-08-07 07:06:41 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-08-07 07:07:15 +0000

    security/nflib: Improve handling of SIMD instructions
    
    PR:             272702
---
 security/nflib/Makefile                         |  2 +-
 security/nflib/files/patch-include_nfl_arch.hpp | 19 +++++++++++++++++++
 security/nflib/files/patch-include_nfl_ops.hpp  | 23 +++++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/security/nflib/Makefile b/security/nflib/Makefile
index 7f69a0b25581..dcc7c0a1e0f6 100644
--- a/security/nflib/Makefile
+++ b/security/nflib/Makefile
@@ -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
diff --git a/security/nflib/files/patch-include_nfl_arch.hpp b/security/nflib/files/patch-include_nfl_arch.hpp
new file mode 100644
index 000000000000..07f9c34daff6
--- /dev/null
+++ b/security/nflib/files/patch-include_nfl_arch.hpp
@@ -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
diff --git a/security/nflib/files/patch-include_nfl_ops.hpp b/security/nflib/files/patch-include_nfl_ops.hpp
new file mode 100644
index 000000000000..958354773ca1
--- /dev/null
+++ b/security/nflib/files/patch-include_nfl_ops.hpp
@@ -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