V2 [PATCH] x86-64: Avoid rep movsb with short distance [BZ #27130]
Florian Weimer
fweimer@redhat.com
Mon Jan 4 15:22:46 GMT 2021
* H. J. Lu via Libc-alpha:
> 1:
> +# if AVOID_SHORT_DISTANCE_REP_MOVSB
> + movq %rsi, %rcx
> + subq %rdi, %rcx
> +2:
> +/* Avoid "rep movsb" if RCX, the distance between source and destination,
> + is N*4GB + [1..63] with N >= 0. */
> + cmpl $63, %ecx
> + jbe L(more_2x_vec) /* Avoid "rep movsb" if ECX <= 63. */
> +# endif
> mov %RDX_LP, %RCX_LP
> rep movsb
> L(nop):
Why not use _LP names here? I think the %ecx comparison at least can
give false results on x86-64 (64-bit).
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Libc-alpha
mailing list