home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,494 of 4,675   
   James Van Buskirk to All   
   Re: Fast Fizz Buzz program   
   21 Jul 18 16:45:20   
   
   From: not_valid@nospicedham.comcast.net   
      
   wrote in message   
   news:02ad19d1-2b51-4c2d-b5b1-b1a739812592@googlegroups.com...   
      
   > On Friday, July 20, 2018 at 12:42:01 PM UTC-5, Terje Mathisen wrote:   
      
   > > James Van Buskirk wrote:   
      
   > > > But shouldn't the task be converting a stream of random inputs   
   > > > into Fizz Buzz rather that a trivial arithmetic progression?  Sounds   
   > > > like more opportunity for fun assembly programming to me.   
      
   > > That's actually an interesting challenge!   
      
   > > Write the fastest possible function to print fixx/buzz/number given a   
   > > random 32 (or 64?) bit input.   
      
   > > I.e. this requires calculating %3 & %5 as fast as possible, while at the   
   > > same time doing bin to ascii conversion.   
      
   > Sounds interesting. How program will receive random input? What's the   
   > range and how many numbers input will contain? And how far can we   
   > stretch original rules? :-)   
      
   Maybe some sort of linear congruential RNG with options to make it   
   more hateful if any test programs start correctly predicting some   
   branches.  Maybe any unsigned 32-bit integer as input.  If data were   
   to be precomputed so as not to mask conversion time by RNG time,   
   it would have to fit in some low level of cache, perhaps 1 MB or   
   262144 inputs.   
      
   I'm not sure just now whether the conversion would use mask   
   and multiply or PSHUFB and PSADBW to determine congruence   
   class mod 15.  If one were to get really carried away distributing   
   tasks among the cores would be a nice addition to the problem.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca