smartalign: use a "times" construct rather than %rep
authorH. Peter Anvin <hpa@zytor.com>
Sun, 19 Oct 2008 23:45:27 +0000 (16:45 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Sun, 19 Oct 2008 23:45:27 +0000 (16:45 -0700)
Use a "times" construct rather than "%rep" for higher performance.
No need to preprocess the same line over and over for no good reason.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
macros/smartalign.mac

index 4dc8fd5..48c07de 100644 (file)
@@ -186,9 +186,8 @@ USE: smartalign
       times (((%1) - (($-$$) % (%1))) % (%1)) nop
 %$end:
     %else
-      %rep %$pad / __ALIGN_%[__BITS__]BIT_GROUP__
-        db __ALIGN_%[__BITS__]BIT_%[__ALIGN_%[__BITS__]BIT_GROUP__]B__
-      %endrep
+      times (%$pad / __ALIGN_%[__BITS__]BIT_GROUP__) \
+       db __ALIGN_%[__BITS__]BIT_%[__ALIGN_%[__BITS__]BIT_GROUP__]B__
       %assign %$pad %$pad % __ALIGN_%[__BITS__]BIT_GROUP__
       %if %$pad > 0
         db __ALIGN_%[__BITS__]BIT_%[%$pad]B__