From 3553ce986f6721f8c6d446368cb6c6f55186713b Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 31 Dec 2024 02:55:22 -0800 Subject: [PATCH] shave some cycles off 16-bit squaring with shift instead of add also fix the comments about how many cycles shift takes --- mandel.s | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mandel.s b/mandel.s index 299db98..b0c2b42 100644 --- a/mandel.s +++ b/mandel.s @@ -348,7 +348,7 @@ viewport_oy: sub 4, dest, arg1, arg2 .endmacro -; 3 + 5 * bytes cycles +; 3 + 5 * (bytes - 1) cycles .macro shl bytes, arg asl arg ; 3 cyc .repeat bytes-1, i @@ -356,17 +356,17 @@ viewport_oy: .endrepeat .endmacro -; 13 cycles +; 8 cycles .macro shl16 arg shl 2, arg .endmacro -; 18 cycles +; 13 cycles .macro shl24 arg shl 3, arg .endmacro -; 23 cycles +; 18 cycles .macro shl32 arg shl 4, arg .endmacro @@ -787,7 +787,7 @@ arg2_pos: sqr8 result + 2, arg + 1 imul8 inter, arg + 1, arg, xe - add16 result + 1, result + 1, inter + shl16 inter add_carry result + 3 add16 result + 1, result + 1, inter add_carry result + 3