Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Graham Cole
08/19/05 08:54
Read: 946 times

#99703 - A worthy winner
Responding to: Maarten Brock's previous message
Jan Waclawek's solution is a worthy winner with some very good ideas. Several entrants picked up on the idea of using the MUL instruction to do multiple shifts in one go. Jan's solution minimised the processing required by noting that large shifts that can be handled with byte manipulation make it unnecessary to process all the remaining bits. Nice.

My own solution has been on the web for some time, it was just a variant of a solution I worked on for rolling a 32-bit number. The whole set can be found here:

Maybe one day I'll get round to incorporating some of Jan's ideas for the shift functions.

Efficient rolls and shifts are potentially commercially important. They crop up when bits need to be manipulated to access fields within a word and in algorithms such as MD5 (this being the problem that stimulated my interest). 24-bit shifts occur when doing floating point arithmetic. I have sometimes taken an interest in what compiler library code actually does and all the shifting and rolling I have seen uses the prosaic iterative method. Compiler writers please take note.

I can see why some entrants gave more than one solution, but this is apt to cause confusion in what is, after all, a competition. It was not really a problem this time round, but could be in the future. Should the rules specify that only one solution should be offered?

List of 19 messages in thread
First challenge done, new challenge up      Craig Steiner      08/13/05 20:05      
   Seems about right to me...      Graham Cole      08/15/05 03:33      
      2 weeks?        Jan Waclawek      08/15/05 03:39      
   re:challenge      Jacob Boyce      08/15/05 09:30      
      "move the data intelligently"      Dan Henry      08/15/05 10:51      
         re:      Jacob Boyce      08/15/05 11:19      
            Overlapping data is part of the challeng      Dan Henry      08/15/05 12:15      
               Yep!      Craig Steiner      08/15/05 12:19      
            Should work      Craig Steiner      08/15/05 12:17      
   And the Winner is...      Maarten Brock      08/19/05 02:11      
      A worthy winner      Graham Cole      08/19/05 08:54      
         Yes      Craig Steiner      08/19/05 11:23      
            one + one      Jan Waclawek      08/20/05 06:27      
         Note taken      Maarten Brock      08/20/05 08:19      
            tradeoff      Jan Waclawek      08/20/05 08:54      
      exec time and size      Jan Waclawek      08/19/05 11:06      
         exec time and size II        Jan Waclawek      08/20/05 09:01      
   Public domain....      Graham Cole      08/24/05 05:14      
      Open source?      José Félix Díaz Ivorra      08/24/05 08:24      

Back to Subject List