代码拉取完成,页面将自动刷新
From dbcfb0123374d83fbf44fcb80d9282969c702759 Mon Sep 17 00:00:00 2001
From: Solar Designer <solar@openwall.com>
Date: Sun, 9 Mar 2025 19:53:00 +0100
Subject: [PATCH] yescrypt: Use AVX512VL XOP-like bit rotates for faster
Salsa20
---
lib/alg-yescrypt-opt.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/alg-yescrypt-opt.c b/lib/alg-yescrypt-opt.c
index a33c6e40..fc6e95e5 100644
--- a/lib/alg-yescrypt-opt.c
+++ b/lib/alg-yescrypt-opt.c
@@ -1,6 +1,6 @@
/*-
* Copyright 2009 Colin Percival
- * Copyright 2012-2018 Alexander Peslyak
+ * Copyright 2012-2025 Alexander Peslyak
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,6 +47,8 @@
#if 0
#ifdef __XOP__
#warning "Note: XOP is enabled. That's great."
+#elif defined(__AVX512VL__)
+#warning "Note: AVX512VL is enabled. That's great."
#elif defined(__AVX__)
#warning "Note: AVX is enabled, which is great for classic scrypt and YESCRYPT_WORM, but is sometimes slightly slower than plain SSE2 for YESCRYPT_RW"
#elif defined(__SSE2__)
@@ -81,6 +83,8 @@
#include <emmintrin.h>
#ifdef __XOP__
#include <x86intrin.h>
+#elif defined(__AVX512VL__)
+#include <immintrin.h>
#endif
#elif defined(__SSE__)
#include <xmmintrin.h>
@@ -179,6 +183,9 @@ static inline void salsa20_simd_unshuffle(const salsa20_blk_t *Bin,
#ifdef __XOP__
#define ARX(out, in1, in2, s) \
out = _mm_xor_si128(out, _mm_roti_epi32(_mm_add_epi32(in1, in2), s));
+#elif defined(__AVX512VL__)
+#define ARX(out, in1, in2, s) \
+ out = _mm_xor_si128(out, _mm_rol_epi32(_mm_add_epi32(in1, in2), s));
#else
#define ARX(out, in1, in2, s) { \
__m128i tmp = _mm_add_epi32(in1, in2); \
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。