[PATCH v2] memcpy: use bhs/bls instead of bge/blt [BZ #25620]

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri May 1 12:58:12 GMT 2020


Hi Florian,

>> -	blt	.Ltail63aligned
>> +	bls	.Ltail63aligned
>
> Is bls really the unsigned variant of blt?  Why not blo?

Well spotted! Indeed bls is incorrect here since the tail code cannot handle 64 bytes.

Note there are several uses of PL/MI that need to be changed too:

	subs	count, count, #64
	ldrmi	tmp2, [sp], #FRAME_SIZE
	bmi	.Ltail63unaligned

	subs	count, count, #64
	bpl	1b

Basically the initial test protects all the others, but when that one is changed to
unsigned, all the other signed checks fail, and we're basically left with the exact
same problem. Hence the need to change all signed condition codes and add
tests that catch all possible cases.

Note a very quick grep shows memcpy.S, armv7/multiarch/memcpy_impl.S,
memmove.S, strlen.S and armv6t2.memchr.S using signed conditions.

Cheers,
Wilco


More information about the Libc-alpha mailing list