aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Constants.h
diff options
context:
space:
mode:
authorGravatar David Tellenbach <david.tellenbach@me.com>2021-01-21 21:11:57 +0000
committerGravatar David Tellenbach <david.tellenbach@me.com>2021-01-21 21:11:57 +0000
commit65e2169c4521660d30f4d90df61da5f3dd9f45bd (patch)
treedcea1ca38e2a77b630dd7159dace922f9169c40d /Eigen/src/Core/util/Constants.h
parentb2126fd6b5e232d072ceadb1abb6695ae3352e2e (diff)
Add support for Arm SVE
This patch adds support for Arm's new vector extension SVE (Scalable Vector Extension). In contrast to other vector extensions that are supported by Eigen, SVE types are inherently *sizeless*. For the use in Eigen we fix their size at compile-time (note that this is not necessary in general, SVE is *length agnostic*). During compilation the flag `-msve-vector-bits=N` has to be set where `N` is a power of two in the range of `128`to `2048`, indicating the length of an SVE vector. Since SVE is rather young, we decided to disable it by default even if it would be available. A user has to enable it explicitly by defining `EIGEN_ARM64_USE_SVE`. This patch introduces the packet types `PacketXf` and `PacketXi` for packets of `float` and `int32_t` respectively. The size of these packets depends on the SVE vector length. E.g. if `-msve-vector-bits=512` is set, `PacketXf` will contain `512/32 = 16` elements. This MR is joint work with Miguel Tairum <miguel.tairum@arm.com>.
Diffstat (limited to 'Eigen/src/Core/util/Constants.h')
-rw-r--r--Eigen/src/Core/util/Constants.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h
index ad9af5727..f7f907ab7 100644
--- a/Eigen/src/Core/util/Constants.h
+++ b/Eigen/src/Core/util/Constants.h
@@ -3,6 +3,7 @@
//
// Copyright (C) 2008-2015 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2007-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
+// Copyright (C) 2020, Arm Limited and Contributors
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
@@ -474,6 +475,7 @@ namespace Architecture
VSX = 0x3,
NEON = 0x4,
MSA = 0x5,
+ SVE = 0x6,
#if defined EIGEN_VECTORIZE_SSE
Target = SSE
#elif defined EIGEN_VECTORIZE_ALTIVEC
@@ -482,6 +484,8 @@ namespace Architecture
Target = VSX
#elif defined EIGEN_VECTORIZE_NEON
Target = NEON
+#elif defined EIGEN_VECTORIZE_SVE
+ Target = SVE
#elif defined EIGEN_VECTORIZE_MSA
Target = MSA
#else