public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] Fix issue with dst bias in memset
@ 2018-11-08 16:46 Wilco Dijkstra
  2018-11-12 18:03 ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 2+ messages in thread
From: Wilco Dijkstra @ 2018-11-08 16:46 UTC (permalink / raw)
  To: newlib; +Cc: nd

This patch fixes an issue in the previous memset loop change. If the
zva size is >= 256 and there are more than 64 bytes left, we could enter
the loop and thus need to rebias dst by 32 as well.

Since no known CPUs use this size this can't be tested natively, so I've
tested it on a simulator initialized with a large zva size.

--

diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S
index 7c8fe583bf88722d73b90ec470c72b509e5be137..103e3f8bb0f20a5d02578f2379620687eae10a52 100644
--- a/newlib/libc/machine/aarch64/memset.S
+++ b/newlib/libc/machine/aarch64/memset.S
@@ -233,6 +233,7 @@ L(zva_other):
 	subs	count, count, zva_len
 	b.hs	3b
 4:	add	count, count, zva_len
+	sub	dst, dst, 32		/* Bias dst for tail loop.  */
 	b	L(tail64)
 
 	.size	memset, . - memset

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][AArch64] Fix issue with dst bias in memset
  2018-11-08 16:46 [PATCH][AArch64] Fix issue with dst bias in memset Wilco Dijkstra
@ 2018-11-12 18:03 ` Richard Earnshaw (lists)
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw (lists) @ 2018-11-12 18:03 UTC (permalink / raw)
  To: Wilco Dijkstra, newlib; +Cc: nd

On 08/11/2018 15:50, Wilco Dijkstra wrote:
> This patch fixes an issue in the previous memset loop change. If the
> zva size is >= 256 and there are more than 64 bytes left, we could enter
> the loop and thus need to rebias dst by 32 as well.
> 
> Since no known CPUs use this size this can't be tested natively, so I've
> tested it on a simulator initialized with a large zva size.
> 
> --
> 
> diff --git a/newlib/libc/machine/aarch64/memset.S b/newlib/libc/machine/aarch64/memset.S
> index 7c8fe583bf88722d73b90ec470c72b509e5be137..103e3f8bb0f20a5d02578f2379620687eae10a52 100644
> --- a/newlib/libc/machine/aarch64/memset.S
> +++ b/newlib/libc/machine/aarch64/memset.S
> @@ -233,6 +233,7 @@ L(zva_other):
>  	subs	count, count, zva_len
>  	b.hs	3b
>  4:	add	count, count, zva_len
> +	sub	dst, dst, 32		/* Bias dst for tail loop.  */
>  	b	L(tail64)
>  
>  	.size	memset, . - memset
> 


Pushed

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-08 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 16:46 [PATCH][AArch64] Fix issue with dst bias in memset Wilco Dijkstra
2018-11-12 18:03 ` Richard Earnshaw (lists)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).