Intel was nice enough to make tzcnt equal to "rep bsf", which is backwards-compatible.
This means we don't actually have to add new functions to make it work.
.escape:
; Skip bytes that are known to be valid
and r4d, r3d
- bsf r3d, r4d
+ tzcnt r3d, r4d
add r1, r3
.escape_loop:
inc r1
%macro DECIMATE4x4 1
-;A LUT is faster than bsf on AMD processors.
+;A LUT is faster than bsf on older AMD processors.
;This is not true for score64.
cglobal decimate_score%1, 1,3
%ifdef PIC
add al, byte [mask_table + rdx]
%else
.loop:
- bsf ecx, edx
+ tzcnt ecx, edx
shr edx, cl
add al, byte [table + rcx]
shr edx, 1
add eax, r3d
jne .ret9
.loop:
- bsf rcx, r1
+ tzcnt rcx, r1
shr r1, cl
add al, byte [table + rcx]
shr r1, 1
add r0, r2
jne .ret9 ;r0 is zero at this point, so we don't need to zero it
.loop:
- bsf ecx, r3
+ tzcnt ecx, r3
test r3, r3
je .largerun
shrd r3, r4, cl
.largerun:
mov r3, r4
xor r4, r4
- bsf ecx, r3
+ tzcnt ecx, r3
shr r3, cl
shr r3, 1
jne .loop
FMA_INSTR pmacsdd, pmulld, paddd
FMA_INSTR pmacsww, pmullw, paddw
FMA_INSTR pmadcswd, pmaddwd, paddd
+
+; tzcnt is equivalent to "rep bsf" and is backwards-compatible with bsf.
+; This lets us use tzcnt without bumping the yasm version requirement yet.
+%define tzcnt rep bsf