bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ffs*, integer_length*: Optimized for MSVC


From: Bruno Haible
Subject: ffs*, integer_length*: Optimized for MSVC
Date: Tue, 04 Aug 2020 01:21:22 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

In new code, I'm making intensive use of the functions ffs and ffsll, for
searching in a bitset. So, these functions should better be well optimized,
even for MSVC.

And while at it, also the integer_length* functions.


2020-08-03  Bruno Haible  <bruno@clisp.org>

        integer_length_ll: Optimize for MSVC in 64-bit mode.
        * lib/integer_length_l.c (MSVC_BUILTIN): Define for MSVC in 64-bit mode.
        (FUNC): On MSVC, use MSVC_BUILTIN if defined.

2020-08-03  Bruno Haible  <bruno@clisp.org>

        integer_length_ll: Optimize for MSVC in 32-bit mode.
        * lib/integer_length_l.c: Include <intrin.h>.
        (integer_length): Define as inline function, like in
        lib/integer_length.c.

2020-08-03  Bruno Haible  <bruno@clisp.org>

        integer_length: Optimize for MSVC.
        * lib/integer_length.c: Include <intrin.h>.
        (integer_length): With MSVC, use the _BitScanReverse built-in.

2020-08-03  Bruno Haible  <bruno@clisp.org>

        ffsll: Optimize for MSVC in 64-bit mode.
        * lib/ffsl.h (FUNC): On MSVC, use MSVC_BUILTIN if defined.
        * lib/ffsll.c (MSVC_BUILTIN): Define for MSVC in 64-bit mode.
        * lib/ffsl.c (MSVC_BUILTIN): Define for MSVC.

2020-08-03  Bruno Haible  <bruno@clisp.org>

        ffsll: Optimize for MSVC in 32-bit mode.
        * lib/ffsl.h: Include <intrin.h>.
        (ffs): Define as inline function, like in lib/ffs.c.

2020-08-03  Bruno Haible  <bruno@clisp.org>

        ffs: Optimize for MSVC.
        * lib/ffs.c: Include <intrin.h>.
        (ffs): With MSVC, use the _BitScanForward built-in.

Attachment: 0001-ffs-Optimize-for-MSVC.patch
Description: Text Data

Attachment: 0002-ffsll-Optimize-for-MSVC-in-32-bit-mode.patch
Description: Text Data

Attachment: 0003-ffsll-Optimize-for-MSVC-in-64-bit-mode.patch
Description: Text Data

Attachment: 0004-integer_length-Optimize-for-MSVC.patch
Description: Text Data

Attachment: 0005-integer_length_ll-Optimize-for-MSVC-in-32-bit-mode.patch
Description: Text Data

Attachment: 0006-integer_length_ll-Optimize-for-MSVC-in-64-bit-mode.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]