View Single Post
Old 2009-03-19, 03:35   #6
__HRB__
 
__HRB__'s Avatar
 
Dec 2008
Boycotting the Soapbox

24×32×5 Posts
Default 10-20 cycles - all incl. 1st bugfixes

[
Quote:
Originally Posted by __HRB__ View Post
1. PCMPEQB 0x00, PCMPEQD 0x00 + loop while MOVMSKPS!=0
This would have to be:
1. PCMPEQB 0x00, PCMPEQD 0x00 + loop while MOVMSKPS==0x0f
otherwise this won't work. What was I thinking?

Quote:
Originally Posted by __HRB__ View Post
2. PCMPEQB 0x0a, PCMPEQD 0x00 + loop while MOVMSKPS!=0
This is going to fail if there are any 0x0a after the terminating 0x00...

But of course I've overlooked the obvious solution:

Since the algorithm requires computing the index to the start of the next integer anyway, it'd be really stupid not to loop while "first byte!=0x00". If the stream isn't 0x00 terminated, we'll do a cmp with a pointer to end of file.

Quote:
Originally Posted by __HRB__ View Post
8. Add 'Z' to pointer...done. Next value please!
I mean 'Z'+1, ('Z' >> 3)+1 or whatever...

Last fiddled with by __HRB__ on 2009-03-19 at 03:51 Reason: what does scanf do?
__HRB__ is offline   Reply With Quote