Discussion:
long long shift?
Iain Hibbert
2011-07-03 20:40:15 UTC
Permalink
Hi

while looking at that problem from Szabolcs Nagy, I noticed that the code
for some previous lines, such as

*(md++) = (unsigned char)(t>>40);

was emitted as

movb $40,%cl
movl %esi,%eax
movl %edi,%edx
shrdl %edx,%eax
shrl %cl,%edx
testb $32,%cl
je 1f
movl %edx,%eax
xorl %edx,%edx
1:
movl 8(%ebp),%edx
incl %edx
movl %edx,8(%ebp)
movb %al,-1(%edx)

but I'm wondering about the testb halfway down (ignoring the fact that we
are dealing with a const today), does it mean to sidestep the shifting
when cl == sizeof long? it seems to me that the shift is already done..
should the test not be done before the shrdl stuff?

regards,
iain

Loading...