commit b5669a52be177df8849c31a4534668c4e6e30eea parent 20d6ab3cb43aeb3f745e0870ed03e603c1189a4a Author: Andrew Alderwick <andrew@alderwick.co.uk> Date: Tue, 8 Feb 2022 01:32:41 +0000 Saturate multiplication in mandelbrot. Diffstat:
M | projects/examples/demos/mandelbrot.tal | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/projects/examples/demos/mandelbrot.tal b/projects/examples/demos/mandelbrot.tal @@ -101,7 +101,9 @@ JMP2r ADD2 ( asign ahi-bhi* r21"* ) ( The result we want is bits 27-12 due to the fixed point representation we use. ) #04 SFT2 SWP2 #40 SFT2 ADD2 - STHr #01 EQU JMP JMP2r - DUP2k EOR2 SWP2 SUB2 - + ( saturate to +/-7.fff ) + #7fff GTH2k JMP SWP2 NIP2 + STHr #01 NEQ ,&result-positive JCN + DUP2k EOR2 SWP2 SUB2 + &result-positive JMP2r