[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    long long shift?
From:       Iain Hibbert <plunky () rya-online ! net>
Date:       2011-07-03 20:40:15
Message-ID: alpine.NEB.2.00.1107032127250.5896 () galant ! ukfsn ! org
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic