diff mbox series

[v1] x86/string: Use `movsl` instead of `movsd` [BZ #32344]

Message ID 20241108191817.282412-1-goldstein.w.n@gmail.com
State New
Headers show
Series [v1] x86/string: Use `movsl` instead of `movsd` [BZ #32344] | expand

Commit Message

Noah Goldstein Nov. 8, 2024, 7:18 p.m. UTC
`ld`, starting at 2.40, emits a warning when using `movsd`. There is
no change to the actual code produced.
---
 sysdeps/x86_64/multiarch/strcpy-evex.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

H.J. Lu Nov. 8, 2024, 10:15 p.m. UTC | #1
On Sat, Nov 9, 2024 at 3:18 AM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
>
> `ld`, starting at 2.40, emits a warning when using `movsd`. There is
> no change to the actual code produced.
> ---
>  sysdeps/x86_64/multiarch/strcpy-evex.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/x86_64/multiarch/strcpy-evex.S b/sysdeps/x86_64/multiarch/strcpy-evex.S
> index 4f5bd3ba55..be1d65453c 100644
> --- a/sysdeps/x86_64/multiarch/strcpy-evex.S
> +++ b/sysdeps/x86_64/multiarch/strcpy-evex.S
> @@ -45,7 +45,7 @@
>  #  define VPCMPEQ      vpcmpeqd
>  #  define CHAR_SIZE    4
>
> -#  define REP_MOVS     rep movsd
> +#  define REP_MOVS     rep movsl
>
>  #  define USE_WIDE_CHAR
>  # else
> --
> 2.34.1
>

LGTM.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

Thanks.
Siddhesh Poyarekar Nov. 12, 2024, 3:23 p.m. UTC | #2
On 2024-11-08 14:18, Noah Goldstein wrote:
> `ld`, starting at 2.40, emits a warning when using `movsd`. There is
> no change to the actual code produced.
> ---
>   sysdeps/x86_64/multiarch/strcpy-evex.S | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sysdeps/x86_64/multiarch/strcpy-evex.S b/sysdeps/x86_64/multiarch/strcpy-evex.S
> index 4f5bd3ba55..be1d65453c 100644
> --- a/sysdeps/x86_64/multiarch/strcpy-evex.S
> +++ b/sysdeps/x86_64/multiarch/strcpy-evex.S
> @@ -45,7 +45,7 @@
>   #  define VPCMPEQ	vpcmpeqd
>   #  define CHAR_SIZE	4
>   
> -#  define REP_MOVS	rep movsd
> +#  define REP_MOVS	rep movsl
>   
>   #  define USE_WIDE_CHAR
>   # else

strncpy and strncat need this too:

../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncat-evex.S: Assembler messages:
../sysdeps/x86_64/multiarch/strncat-evex.S:507: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncat-evex.S:517: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncat-evex.S: Assembler messages:
../sysdeps/x86_64/multiarch/strncat-evex.S:507: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncat-evex.S:517: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd'; 
assuming `movsl' was meant
../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd'; 
assuming `movsl' was meant
Noah Goldstein Nov. 12, 2024, 11:04 p.m. UTC | #3
On Tue, Nov 12, 2024 at 9:25 AM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>
> On 2024-11-08 14:18, Noah Goldstein wrote:
> > `ld`, starting at 2.40, emits a warning when using `movsd`. There is
> > no change to the actual code produced.
> > ---
> >   sysdeps/x86_64/multiarch/strcpy-evex.S | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sysdeps/x86_64/multiarch/strcpy-evex.S b/sysdeps/x86_64/multiarch/strcpy-evex.S
> > index 4f5bd3ba55..be1d65453c 100644
> > --- a/sysdeps/x86_64/multiarch/strcpy-evex.S
> > +++ b/sysdeps/x86_64/multiarch/strcpy-evex.S
> > @@ -45,7 +45,7 @@
> >   #  define VPCMPEQ   vpcmpeqd
> >   #  define CHAR_SIZE 4
> >
> > -#  define REP_MOVS   rep movsd
> > +#  define REP_MOVS   rep movsl
> >
> >   #  define USE_WIDE_CHAR
> >   # else
>
> strncpy and strncat need this too:
>
> ../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncat-evex.S: Assembler messages:
> ../sysdeps/x86_64/multiarch/strncat-evex.S:507: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncat-evex.S:517: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncat-evex.S: Assembler messages:
> ../sysdeps/x86_64/multiarch/strncat-evex.S:507: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncat-evex.S:517: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S: Assembler messages:
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:941: Warning: found `movsd';
> assuming `movsl' was meant
> ../sysdeps/x86_64/multiarch/strncpy-evex.S:979: Warning: found `movsd';
> assuming `movsl' was meant

Bah, sorry, patch posted.
diff mbox series

Patch

diff --git a/sysdeps/x86_64/multiarch/strcpy-evex.S b/sysdeps/x86_64/multiarch/strcpy-evex.S
index 4f5bd3ba55..be1d65453c 100644
--- a/sysdeps/x86_64/multiarch/strcpy-evex.S
+++ b/sysdeps/x86_64/multiarch/strcpy-evex.S
@@ -45,7 +45,7 @@ 
 #  define VPCMPEQ	vpcmpeqd
 #  define CHAR_SIZE	4
 
-#  define REP_MOVS	rep movsd
+#  define REP_MOVS	rep movsl
 
 #  define USE_WIDE_CHAR
 # else