mirror of
https://git.tukaani.org/xz.git
synced 2025-12-25 06:48:43 +00:00
A CLMUL-only build will have the crcxx_clmul() inlined into
lzma_crcxx(). Previously a jump to the extern lzma_crcxx_clmul()
was needed. Notes about shared liblzma on ELF platforms:
- On platforms that support ifunc and -fvisibility=hidden, this
was silly because CLMUL-only build would have that single extra
jump instruction of extra overhead.
- On platforms that support neither -fvisibility=hidden nor linker
version script (liblzma*.map), jumping to lzma_crcxx_clmul()
would go via PLT so a few more instructions of overhead (still
not a big issue but silly nevertheless).
There was a downside with static liblzma too: if an application only
needs lzma_crc64(), static linking would make the linker include the
CLMUL code for both CRC32 and CRC64 from crc_x86_clmul.o even though
the CRC32 code wouldn't be needed, thus increasing code size of the
executable (assuming that -ffunction-sections isn't used).
Also, now compilers are likely to inline crc_simd_body()
even if they don't support the always_inline attribute
(or MSVC's __forceinline). Quite possibly all compilers
that build the code do support such an attribute. But now
it likely isn't a problem even if the attribute wasn't supported.
Now all x86-specific stuff is in crc_x86_clmul.h. If other archs
The other archs can then have their own headers with their own
is_clmul_supported() and crcxx_clmul().
Another bonus is that the build system doesn't need to care if
crc_clmul.c is needed.
is_clmul_supported() stays as inline function as it's not needed
when doing a CLMUL-only build (avoids a warning about unused function).
55 lines
1.0 KiB
Makefile
55 lines
1.0 KiB
Makefile
##
|
|
## Author: Lasse Collin
|
|
##
|
|
## This file has been put into the public domain.
|
|
## You can do whatever you want with this file.
|
|
##
|
|
## Note: There is no check for COND_CHECK_CRC32 because
|
|
## currently crc32 is always enabled.
|
|
|
|
EXTRA_DIST += \
|
|
check/crc32_tablegen.c \
|
|
check/crc64_tablegen.c
|
|
|
|
liblzma_la_SOURCES += \
|
|
check/check.c \
|
|
check/check.h \
|
|
check/crc_common.h \
|
|
check/crc_x86_clmul.h
|
|
|
|
if COND_SMALL
|
|
liblzma_la_SOURCES += check/crc32_small.c
|
|
else
|
|
liblzma_la_SOURCES += \
|
|
check/crc32_table.c \
|
|
check/crc32_table_le.h \
|
|
check/crc32_table_be.h
|
|
if COND_ASM_X86
|
|
liblzma_la_SOURCES += check/crc32_x86.S
|
|
else
|
|
liblzma_la_SOURCES += check/crc32_fast.c
|
|
endif
|
|
endif
|
|
|
|
if COND_CHECK_CRC64
|
|
if COND_SMALL
|
|
liblzma_la_SOURCES += check/crc64_small.c
|
|
else
|
|
liblzma_la_SOURCES += \
|
|
check/crc64_table.c \
|
|
check/crc64_table_le.h \
|
|
check/crc64_table_be.h
|
|
if COND_ASM_X86
|
|
liblzma_la_SOURCES += check/crc64_x86.S
|
|
else
|
|
liblzma_la_SOURCES += check/crc64_fast.c
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
if COND_CHECK_SHA256
|
|
if COND_INTERNAL_SHA256
|
|
liblzma_la_SOURCES += check/sha256.c
|
|
endif
|
|
endif
|