Skip to content

Commit

Permalink
Update setup.py
Browse files Browse the repository at this point in the history
Fix enabling asm and enable bmi2 by default
  • Loading branch information
sergey-dryabzhinsky authored Jan 19, 2025
1 parent 8971ed2 commit b3ab358
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if SUP_THREADS:
ENABLE_THREADS=1

SUP_ASM_BMI2="ZSTD_ASM_BMI2" in os.environ
SUP_ASM_BMI2="ZSTD_ASM_BMI2" in os.environ or True
if "--libzstd-use-asm-bmi2" in sys.argv:
# Support assembler builtin optimization in lizstd for new AMD CPU
SUP_ASM_BMI2=False
Expand Down Expand Up @@ -96,10 +96,10 @@
#
COPT = {
'msvc': [ '/Ox', '/DVERSION=%s' % PKG_VERSION_STR, '/DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '/DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
'mingw32': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0', '-DZSTD_DISABLE_ASM=1' ],
'unix': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0', '-DZSTD_DISABLE_ASM=1' ],
'clang': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0', '-DZSTD_DISABLE_ASM=1' ],
'gcc': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=0', '-DZSTD_DISABLE_ASM=1' ]
'mingw32': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
'unix': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
'clang': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
'gcc': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ]
}

if not SUP_EXTERNAL:
Expand Down

0 comments on commit b3ab358

Please sign in to comment.