summaryrefslogtreecommitdiff
path: root/cpu_features.h
diff options
context:
space:
mode:
authorAdenilson Cavalcanti <adenilson.cavalcanti@arm.com>2020-01-08 22:12:31 +0000
committerCommit Bot <commit-bot@chromium.org>2020-01-08 22:12:31 +0000
commit5de00af04ef8222610d27a2b09a598fafd402213 (patch)
tree0357f9d343d9ed7f0152a2061d3e2e2f721e9cab /cpu_features.h
parent814da1f383b625955149c3845db62af3f29a4ffe (diff)
downloadzlib-5de00af04ef8222610d27a2b09a598fafd402213.tar.gz
Unify CPU features detection code
This will allow to remove some duplicated code (i.e. thread synchronization) while at same time removing unnecessary use of inline ASM for Intel features detection. A few other advantages: - remove some extra logic (e.g. no need to test the platform to include the correct CPU detection header). - simplifies the buildsystem (i.e. we always include cpu_features.c) - get rid of the simd_stub file. Bug: 1032721 Change-Id: I9427b34ec09dddc41925844a6ec4e6aa4d8f3207 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1987190 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org> Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#729515} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: d989ac2c596e88e7581eb93d053945a43c611124
Diffstat (limited to 'cpu_features.h')
-rw-r--r--cpu_features.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/cpu_features.h b/cpu_features.h
new file mode 100644
index 0000000..2a4a797
--- /dev/null
+++ b/cpu_features.h
@@ -0,0 +1,17 @@
+/* cpu_features.h -- Processor features detection.
+ *
+ * Copyright 2018 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the Chromium source repository LICENSE file.
+ */
+
+#include "zlib.h"
+
+/* TODO(cavalcantii): remove checks for x86_flags on deflate.
+ */
+extern int arm_cpu_enable_crc32;
+extern int arm_cpu_enable_pmull;
+extern int x86_cpu_enable_ssse3;
+extern int x86_cpu_enable_simd;
+
+void cpu_check_features(void);