From 4c04f7a38ca92f62577f85616f2562726b2635e4 Mon Sep 17 00:00:00 2001 From: vsariola <5684185+vsariola@users.noreply.github.com> Date: Sat, 27 Mar 2021 16:03:47 +0200 Subject: [PATCH] optimize(templates): use test ah or test al instead of test {{.AX}} in op_send --- templates/amd64-386/sinks.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/amd64-386/sinks.asm b/templates/amd64-386/sinks.asm index c57f5d4..ef0ff79 100644 --- a/templates/amd64-386/sinks.asm +++ b/templates/amd64-386/sinks.asm @@ -91,7 +91,7 @@ su_op_aux_mono: mov {{.CX}}, [{{.Stack "Voice"}}] ; load pointer to voice {{- if .SupportsGlobalSend}} pushf ; uh ugly: we save the flags just for the stereo carry bit. Doing the .CX loading later crashed the synth for stereo sends as loading the synth address from stack was f'd up by the "call su_op_send_mono" - test {{.AX}}, 0x8000 + test ah, 0x80 jz su_op_send_skipglobal mov {{.CX}}, [{{.Stack "Synth"}} + {{.PTRSIZE}}] su_op_send_skipglobal: @@ -106,12 +106,12 @@ su_op_send_skipglobal: fxch ; r l call su_op_send_mono ; (r) l mov {{.AX}}, {{.DI}} ; move back to original address - test {{.AX}}, 0x8 ; if r was not popped and is still in the stack + test al, 0x8 ; if r was not popped and is still in the stack jnz su_op_send_mono fxch ; swap them back: l r su_op_send_mono: {{- end}} - test {{.AX}}, 0x8 ; if the SEND_POP bit is not set + test al, 0x8 ; if the SEND_POP bit is not set jnz su_op_send_skippush fld st0 ; duplicate the signal on stack: s s su_op_send_skippush: ; there is signal s, but maybe also another: s (s)