]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use mul and div instead of bitshifts to calculate srtt
authorOndřej Surý <ondrej@isc.org>
Thu, 12 Oct 2023 07:20:42 +0000 (09:20 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 12 Oct 2023 10:35:00 +0000 (12:35 +0200)
commit91f3b0edee9873b3f727bc9fc372a362b59480b1
tree35910f4eaef3bd71936ddd17f9cab5828005f94d
parent0635bd01cbf47cf05cfa7670fe0833077ccfe6fe
Use mul and div instead of bitshifts to calculate srtt

There was a microoptimization for smoothing srtt with bitshifts.  Revert
the code to use * 98 / 100, it doesn't really make that difference on
modern CPUs, for comparison here:

    muldiv:
    imul    eax, edi, 98
    imul    rax, rax, 1374389535
    shr     rax, 37
    ret
    shift:
    mov     eax, edi
    sal     eax, 9
    sub     eax, edi
    shr     eax, 9
    ret
lib/dns/adb.c