From: phfr24 Date: Tue, 16 Dec 2025 00:37:33 +0000 (-0300) Subject: microoptimization for update_cell X-Git-Url: https://git.wirehaze.ovh/lifeboot.git/commitdiff_plain/d2d37470bcaa3af3a9e7bda266c6884b13e9afda microoptimization for update_cell --- diff --git a/lifeboot.asm b/lifeboot.asm index d4ba435..67e7ce9 100644 --- a/lifeboot.asm +++ b/lifeboot.asm @@ -291,11 +291,9 @@ mov dx, [es:si + bx] ; dl = cell current state cmp dl, ALIVE ; if (ALIVE) { jne .else -cmp ax, 2 ; if (n < 2) -jl .dead ; return DEAD - -cmp ax, 3 ; if (n > 3) -jg .dead ; return DEAD +shr ax, 1 +xor ax, 1 ; if (n != 2 || n != 3) +jnz .dead ; return DEAD (likely) jmp .alive ; return ALIVE