public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sparc: Fix broken memset for sparc32 [BZ #31068]
@ 2023-11-15 12:29 Ludwig Rydberg
  2023-11-15 13:26 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 2+ messages in thread
From: Ludwig Rydberg @ 2023-11-15 12:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: adhemerval.zanella, software, Andreas Larsson, Ludwig Rydberg

From: Andreas Larsson <andreas@gaisler.com>

Fixes commit a61933fe27df ("sparc: Remove bzero optimization") that
after moving code jumped to the wrong label 4.

Verfied by successfully running string/test-memset on sparc32.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Ludwig Rydberg <ludwig.rydberg@gaisler.com>
---
 sysdeps/sparc/sparc32/memset.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/sparc/sparc32/memset.S b/sysdeps/sparc/sparc32/memset.S
index ca29ff568501..1dc3a640e874 100644
--- a/sysdeps/sparc/sparc32/memset.S
+++ b/sysdeps/sparc/sparc32/memset.S
@@ -55,7 +55,7 @@ ENTRY(memset)
 
 	andcc		%o0, 3, %o2
 	bne		3f
-4:	 andcc		%o0, 4, %g0
+5:	 andcc		%o0, 4, %g0
 
 	be		2f
 	 mov		%g3, %g2
@@ -139,7 +139,7 @@ ENTRY(memset)
 	stb		%g3, [%o0 + 0x02]
 2:	sub		%o2, 4, %o2
 	add		%o1, %o2, %o1
-	b		4b
+	b		5b
 	 sub		%o0, %o2, %o0
 END(memset)
 libc_hidden_builtin_def (memset)

base-commit: 8f22e36238c94e2a89da624e03c224895f9dd691
-- 
2.35.3


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

* Re: [PATCH] sparc: Fix broken memset for sparc32 [BZ #31068]
  2023-11-15 12:29 [PATCH] sparc: Fix broken memset for sparc32 [BZ #31068] Ludwig Rydberg
@ 2023-11-15 13:26 ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella Netto @ 2023-11-15 13:26 UTC (permalink / raw)
  To: Ludwig Rydberg, libc-alpha; +Cc: software, Andreas Larsson



On 15/11/23 09:29, Ludwig Rydberg wrote:
> From: Andreas Larsson <andreas@gaisler.com>
> 
> Fixes commit a61933fe27df ("sparc: Remove bzero optimization") that
> after moving code jumped to the wrong label 4.
> 
> Verfied by successfully running string/test-memset on sparc32.
> 
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>
> Signed-off-by: Ludwig Rydberg <ludwig.rydberg@gaisler.com>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/sparc/sparc32/memset.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/sparc/sparc32/memset.S b/sysdeps/sparc/sparc32/memset.S
> index ca29ff568501..1dc3a640e874 100644
> --- a/sysdeps/sparc/sparc32/memset.S
> +++ b/sysdeps/sparc/sparc32/memset.S
> @@ -55,7 +55,7 @@ ENTRY(memset)
>  
>  	andcc		%o0, 3, %o2
>  	bne		3f
> -4:	 andcc		%o0, 4, %g0
> +5:	 andcc		%o0, 4, %g0
>  
>  	be		2f
>  	 mov		%g3, %g2
> @@ -139,7 +139,7 @@ ENTRY(memset)
>  	stb		%g3, [%o0 + 0x02]
>  2:	sub		%o2, 4, %o2
>  	add		%o1, %o2, %o1
> -	b		4b
> +	b		5b
>  	 sub		%o0, %o2, %o0
>  END(memset)
>  libc_hidden_builtin_def (memset)
> 
> base-commit: 8f22e36238c94e2a89da624e03c224895f9dd691

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

end of thread, other threads:[~2023-11-15 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 12:29 [PATCH] sparc: Fix broken memset for sparc32 [BZ #31068] Ludwig Rydberg
2023-11-15 13:26 ` Adhemerval Zanella Netto

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).