Skip to content

Commit 2dc381f

Browse files
authored
Merge pull request #65 from escherba/aes_
support AES
2 parents cc858f8 + c49019e commit 2dc381f

7 files changed

Lines changed: 37 additions & 30 deletions

File tree

setup.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def get_system_bits():
4343
SYSTEM = os.name
4444
BITS = get_system_bits()
4545
HAVE_SSE42 = "sse4_2" in CPU_FLAGS
46+
HAVE_AES = "aes" in CPU_FLAGS
4647

4748
CXXFLAGS = []
4849

@@ -66,15 +67,21 @@ def get_system_bits():
6667
TARGET_ARCH = os.environ.get("AUDITWHEEL_ARCH")
6768

6869
if HAVE_SSE42 and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
69-
# Note: Only -msse4.2 has significant effect on performance;
70-
# so not using other flags such as -maes and -mavx
7170
print("enabling SSE4.2 on compile")
7271
if SYSTEM == "nt":
7372
CXXFLAGS.append("/D__SSE4_2__")
7473
else:
7574
CXXFLAGS.append("-msse4.2")
7675

7776

77+
if HAVE_AES and (TARGET_ARCH in [None, "x86_64"]) and (BITS == 64):
78+
print("enabling AES on compile")
79+
if SYSTEM == "nt":
80+
CXXFLAGS.append("/D__AES__")
81+
else:
82+
CXXFLAGS.append("-maes")
83+
84+
7885
if USE_CYTHON:
7986
print("building extension using Cython")
8087
CMDCLASS = {"build_ext": build_ext}
@@ -120,7 +127,7 @@ def get_system_bits():
120127
)
121128

122129

123-
VERSION = "0.3.6"
130+
VERSION = "0.3.7"
124131
URL = "https://github.com/escherba/python-cityhash"
125132

126133

src/cityhash.cpp

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cityhash.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Python wrapper for CityHash
1010

1111
__author__ = "Eugene Scherba"
1212
__email__ = "escherba+cityhash@gmail.com"
13-
__version__ = '0.3.6'
13+
__version__ = '0.3.7'
1414
__all__ = [
1515
"CityHash32",
1616
"CityHash64",

src/cityhashcrc.cpp

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cityhashcrc.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Python wrapper for CityHash-CRC
1010

1111
__author__ = "Eugene Scherba"
1212
__email__ = "escherba+cityhash@gmail.com"
13-
__version__ = '0.3.6'
13+
__version__ = '0.3.7'
1414
__all__ = [
1515
"CityHashCrc128",
1616
"CityHashCrc128WithSeed",

src/farmhash.cpp

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/farmhash.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Python wrapper for FarmHash
1010

1111
__author__ = "Eugene Scherba"
1212
__email__ = "escherba+farmhash@gmail.com"
13-
__version__ = '0.3.6'
13+
__version__ = '0.3.7'
1414
__all__ = [
1515
"FarmHash32",
1616
"FarmHash32WithSeed",

0 commit comments

Comments
 (0)