Module Name:    src
Committed By:   rin
Date:           Mon Aug  7 01:14:19 UTC 2023

Modified Files:
        src/sys/crypto/arch/arm: arm_neon.h

Log Message:
sys/crypto: aarch64: Catch up with builtin rename for GCC12

Kernel self tests successfully pass for aarch64{,eb}.

Same binary generated by GCC10 and GCC12 for:
---
#include <sys/types.h>
#include "arm_neon.h"

uint32x4_t my_vshrq_n_u32(uint32x4_t v, uint8_t bits)
{
        return vshrq_n_u32(v, bits);
}

uint8x16_t my_vshrq_n_u8(uint8x16_t v, uint8_t bits)
{
        return vshrq_n_u8(v, bits);
}
---


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/arch/arm/arm_neon.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/crypto/arch/arm/arm_neon.h
diff -u src/sys/crypto/arch/arm/arm_neon.h:1.1 src/sys/crypto/arch/arm/arm_neon.h:1.2
--- src/sys/crypto/arch/arm/arm_neon.h:1.1	Mon Aug  7 01:07:36 2023
+++ src/sys/crypto/arch/arm/arm_neon.h	Mon Aug  7 01:14:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm_neon.h,v 1.1 2023/08/07 01:07:36 rin Exp $	*/
+/*	$NetBSD: arm_neon.h,v 1.2 2023/08/07 01:14:19 rin Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -522,7 +522,11 @@ static __inline uint32x4_t
 vshrq_n_u32(uint32x4_t __v, uint8_t __bits)
 {
 #ifdef __aarch64__
+#  if __GNUC_PREREQ__(12, 0)
+	return __builtin_aarch64_lshrv4si_uus(__v, __bits);
+#  else
 	return (uint32x4_t)__builtin_aarch64_lshrv4si((int32x4_t)__v, __bits);
+#  endif
 #else
 	return (uint32x4_t)__builtin_neon_vshru_nv4si((int32x4_t)__v, __bits);
 #endif
@@ -538,7 +542,11 @@ static __inline uint8x16_t
 vshrq_n_u8(uint8x16_t __v, uint8_t __bits)
 {
 #ifdef __aarch64__
+#  if __GNUC_PREREQ__(12, 0)
+	return __builtin_aarch64_lshrv16qi_uus(__v, __bits);
+#  else
 	return (uint8x16_t)__builtin_aarch64_lshrv16qi((int8x16_t)__v, __bits);
+#  endif
 #else
 	return (uint8x16_t)__builtin_neon_vshru_nv16qi((int8x16_t)__v, __bits);
 #endif

Reply via email to