[PATCH 3/4] chacha20-ppc: fix implicit conversion between vector types warnings

Jussi Kivilinna jussi.kivilinna at iki.fi
Sat Jun 22 16:40:49 CEST 2024


* cipher/chacha20-ppc.c (chacha20_ppc_blocks4)
(chacha20_ppc_blocks4, chacha20_poly1305_ppc_blocks4): Explicitly
convert return values from vec_cmplt.
--

Commit solves new warning type:

warning: Implicit conversion between vector types (''__vector __bool
unsigned int' (vector of 4 'unsigned int' values)' and
''vector4x_u32' (vector of 4 'unsigned int' values)') is deprecated.
In the future, the behavior implied by '-fno-lax-vector-conversions'
will be the default. [-Wdeprecate-lax-vec-conv-all]

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 cipher/chacha20-ppc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cipher/chacha20-ppc.c b/cipher/chacha20-ppc.c
index fe991b08..e640010a 100644
--- a/cipher/chacha20-ppc.c
+++ b/cipher/chacha20-ppc.c
@@ -330,7 +330,7 @@ chacha20_ppc_blocks4(u32 *state, byte *dst, const byte *src, size_t nblks)
       v15 = vec_splat(state3, 3);
 
       v12 += counters_0123;
-      v13 -= vec_cmplt(v12, counters_0123);
+      v13 -= (vector4x_u32)vec_cmplt(v12, counters_0123);
 
       for (i = 20; i > 0; i -= 2)
 	{
@@ -355,7 +355,7 @@ chacha20_ppc_blocks4(u32 *state, byte *dst, const byte *src, size_t nblks)
       tmp = vec_splat(state3, 0);
       tmp += counters_0123;
       v12 += tmp;
-      v13 += vec_splat(state3, 1) - vec_cmplt(tmp, counters_0123);
+      v13 += vec_splat(state3, 1) - (vector4x_u32)vec_cmplt(tmp, counters_0123);
       v14 += vec_splat(state3, 2);
       v15 += vec_splat(state3, 3);
       ADD_U64(state3, counter_4); /* update counter */
@@ -532,7 +532,7 @@ chacha20_poly1305_ppc_blocks4(u32 *state, byte *dst, const byte *src,
       v15 = vec_splat(state3, 3);
 
       v12 += counters_0123;
-      v13 -= vec_cmplt(v12, counters_0123);
+      v13 -= (vector4x_u32)vec_cmplt(v12, counters_0123);
 
       for (o = 20; o; o -= 10)
 	{
@@ -570,7 +570,7 @@ chacha20_poly1305_ppc_blocks4(u32 *state, byte *dst, const byte *src,
       tmp = vec_splat(state3, 0);
       tmp += counters_0123;
       v12 += tmp;
-      v13 += vec_splat(state3, 1) - vec_cmplt(tmp, counters_0123);
+      v13 += vec_splat(state3, 1) - (vector4x_u32)vec_cmplt(tmp, counters_0123);
       v14 += vec_splat(state3, 2);
       v15 += vec_splat(state3, 3);
       ADD_U64(state3, counter_4); /* update counter */
-- 
2.43.0




More information about the Gcrypt-devel mailing list