AArch64: Check for SVE in ifuncs [BZ #28744]

Message ID AS8PR08MB6534F0C674A4C27FCC9D919F834B9@AS8PR08MB6534.eurprd08.prod.outlook.com
State New
Headers show
Series
  • AArch64: Check for SVE in ifuncs [BZ #28744]
Related show

Commit Message

Adhemerval Zanella via Libc-alpha Jan. 5, 2022, 4:31 p.m.
Add a check for SVE in the A64FX ifuncs for memcpy, memset and memmove.
This fixes BZ #28744, OK for commit?

---

Comments

Adhemerval Zanella via Libc-alpha Jan. 5, 2022, 7:10 p.m. | #1
The 01/05/2022 16:31, Wilco Dijkstra via Libc-alpha wrote:
> Add a check for SVE in the A64FX ifuncs for memcpy, memset and memmove.

> This fixes BZ #28744, OK for commit?

> 


This is OK, thanks.

> ---

> diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c

> index 7dac7b76e475ba07db7b3bee58b642921b51b654..a476dd548fd04fddcd0b39cc3263866769bb309a 100644

> --- a/sysdeps/aarch64/multiarch/memcpy.c

> +++ b/sysdeps/aarch64/multiarch/memcpy.c

> @@ -48,7 +48,7 @@ libc_ifunc (__libc_memcpy,

>  		      || IS_NEOVERSE_V1 (midr)

>  		      ? __memcpy_simd

>  # if HAVE_AARCH64_SVE_ASM

> -		     : (IS_A64FX (midr)

> +		     : (IS_A64FX (midr) && sve

>  			? __memcpy_a64fx

>  			: __memcpy_generic))))));

>  # else

> diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c

> index 48f8e4616644a0f29718357687445ed4002b726c..4f7d7eedfd943d1b6a54e90dc973406b30cc8db9 100644

> --- a/sysdeps/aarch64/multiarch/memmove.c

> +++ b/sysdeps/aarch64/multiarch/memmove.c

> @@ -48,7 +48,7 @@ libc_ifunc (__libc_memmove,

>  		      || IS_NEOVERSE_V1 (midr)

>  		      ? __memmove_simd

>  # if HAVE_AARCH64_SVE_ASM

> -		     : (IS_A64FX (midr)

> +		     : (IS_A64FX (midr) && sve

>  			? __memmove_a64fx

>  			: __memmove_generic))))));

>  # else

> diff --git a/sysdeps/aarch64/multiarch/memset.c b/sysdeps/aarch64/multiarch/memset.c

> index 3692b079e3bfaa4fa03dda7f5c2bef3486e8e05f..c4008f346b34ec5b4b767a1433cf72692572a714 100644

> --- a/sysdeps/aarch64/multiarch/memset.c

> +++ b/sysdeps/aarch64/multiarch/memset.c

> @@ -44,7 +44,7 @@ libc_ifunc (__libc_memset,

>  	      : (IS_EMAG (midr) && zva_size == 64

>  		? __memset_emag

>  # if HAVE_AARCH64_SVE_ASM

> -		: (IS_A64FX (midr)

> +		: (IS_A64FX (midr) && sve

>  		  ? __memset_a64fx

>  		  : __memset_generic))));

>  # else

>

Patch

diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
index 7dac7b76e475ba07db7b3bee58b642921b51b654..a476dd548fd04fddcd0b39cc3263866769bb309a 100644
--- a/sysdeps/aarch64/multiarch/memcpy.c
+++ b/sysdeps/aarch64/multiarch/memcpy.c
@@ -48,7 +48,7 @@  libc_ifunc (__libc_memcpy,
 		      || IS_NEOVERSE_V1 (midr)
 		      ? __memcpy_simd
 # if HAVE_AARCH64_SVE_ASM
-		     : (IS_A64FX (midr)
+		     : (IS_A64FX (midr) && sve
 			? __memcpy_a64fx
 			: __memcpy_generic))))));
 # else
diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
index 48f8e4616644a0f29718357687445ed4002b726c..4f7d7eedfd943d1b6a54e90dc973406b30cc8db9 100644
--- a/sysdeps/aarch64/multiarch/memmove.c
+++ b/sysdeps/aarch64/multiarch/memmove.c
@@ -48,7 +48,7 @@  libc_ifunc (__libc_memmove,
 		      || IS_NEOVERSE_V1 (midr)
 		      ? __memmove_simd
 # if HAVE_AARCH64_SVE_ASM
-		     : (IS_A64FX (midr)
+		     : (IS_A64FX (midr) && sve
 			? __memmove_a64fx
 			: __memmove_generic))))));
 # else
diff --git a/sysdeps/aarch64/multiarch/memset.c b/sysdeps/aarch64/multiarch/memset.c
index 3692b079e3bfaa4fa03dda7f5c2bef3486e8e05f..c4008f346b34ec5b4b767a1433cf72692572a714 100644
--- a/sysdeps/aarch64/multiarch/memset.c
+++ b/sysdeps/aarch64/multiarch/memset.c
@@ -44,7 +44,7 @@  libc_ifunc (__libc_memset,
 	      : (IS_EMAG (midr) && zva_size == 64
 		? __memset_emag
 # if HAVE_AARCH64_SVE_ASM
-		: (IS_A64FX (midr)
+		: (IS_A64FX (midr) && sve
 		  ? __memset_a64fx
 		  : __memset_generic))));
 # else