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,507 of 4,675   
   Terje Mathisen to Bernhard Schornak   
   Re: Fast Fizz Buzz program   
   23 Jul 18 11:56:57   
   
   From: terje.mathisen@nospicedham.tmsw.no   
      
   "The proof of the pudding is in the eating"   
      
   I'm willing to bet that your routine is significantly slower than mine   
   (maybe by an order of magnitude?).   
      
   I.e. please time (with RDTSC) a run from 1 to 1E6. Your target should be   
   to beat or match my current 8M clock cycles. :-)   
      
   Terje   
      
   Bernhard Schornak wrote:   
   > Bernhard Schornak wrote:   
   >   
   >   
   >> write_routine:   
   >>   
   >> [align to next multiple of 32]   
   >>   
   >> movq   %xmm3, 0x00(%r15)   
   >> movb   %bpl,  0x08(%r15)   
   >> movb   %sil,  0x09(%r15)   
   >> movb   %dil,  0x0A(%r15)   
   >> movb   %dl,   0x0B(%r15)   
   >> movb   %cl,   0x0C(%r15)   
   >> movb   %bl,   0x0D(%r15)   
   >> movb   %al,   0x0E(%r15)   
   >> movb   $0x0A, 0x0F(%r15)   
   >> addq   $0x10, %r15   
   >> incb   %al                  # RAX = 1st digit   
   >> decq   %r13   
   >> jne    RET   
   >> incb   %bl   
   >> movq   $0x09, %r13          # R13 = digit counter   
   >> cmpb   $0x20, %bl           # RBX = 2nd digit   
   >   
   > This should be "cmpb $0x21, %bl", of course...   
   >   
   >> cmove  %r11b, %bl   
   >> je     RET   
   >> cmpb   $0x09, %bl   
   >> cmova  %r12b, %bl   
   >> jne    RET   
   >> .   
   >> .                          # repeat for the remaining digits   
   >> .   
   >>   
   >>   
   >> [align to next multiple of 32]   
   >>   
   >> RET:  nop   
   >>        ret   
   >   
   >   
   > Greetings from Augsburg   
   >   
   > Bernhard Schornak   
      
      
   --   
   -    
   "almost all programming can be viewed as an exercise in caching"   
      
   --- 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