about summary refs log tree commit diff
path: root/absl/copts/copts.py
diff options
context:
space:
mode:
Diffstat (limited to 'absl/copts/copts.py')
-rw-r--r--absl/copts/copts.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/absl/copts/copts.py b/absl/copts/copts.py
index 5bede34cb8e7..d850bb4f0553 100644
--- a/absl/copts/copts.py
+++ b/absl/copts/copts.py
@@ -199,4 +199,18 @@ COPT_VARS = {
         # Object file doesn't export any previously undefined symbols
         "-ignore:4221",
     ],
+    # "HWAES" is an abbreviation for "hardware AES" (AES - Advanced Encryption
+    # Standard). These flags are used for detecting whether or not the target
+    # architecture has hardware support for AES instructions which can be used
+    # to improve performance of some random bit generators.
+    "ABSL_RANDOM_HWAES_ARM64_FLAGS": ["-march=armv8-a+crypto"],
+    "ABSL_RANDOM_HWAES_ARM32_FLAGS": ["-mfpu=neon"],
+    "ABSL_RANDOM_HWAES_X64_FLAGS": [
+        "-maes",
+        "-msse4.1",
+    ],
+    "ABSL_RANDOM_HWAES_MSVC_X64_FLAGS": [
+        "/O2",  # Maximize speed
+        "/Ob2",  # Aggressive inlining
+    ],
 }