Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
SVE/TypeCasting.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2020, Arm Limited and Contributors
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#ifndef EIGEN_TYPE_CASTING_SVE_H
11#define EIGEN_TYPE_CASTING_SVE_H
12
13// IWYU pragma: private
14#include "../../InternalHeaderCheck.h"
15
16namespace Eigen {
17namespace internal {
18
19template <>
20struct type_casting_traits<float, numext::int32_t> {
21 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
22};
23
24template <>
25struct type_casting_traits<numext::int32_t, float> {
26 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
27};
28
29template <>
30EIGEN_STRONG_INLINE PacketXf pcast<PacketXi, PacketXf>(const PacketXi& a) {
31 return svcvt_f32_s32_z(svptrue_b32(), a);
32}
33
34template <>
35EIGEN_STRONG_INLINE PacketXi pcast<PacketXf, PacketXi>(const PacketXf& a) {
36 return svcvt_s32_f32_z(svptrue_b32(), a);
37}
38
39template <>
40EIGEN_STRONG_INLINE PacketXf preinterpret<PacketXf, PacketXi>(const PacketXi& a) {
41 return svreinterpret_f32_s32(a);
42}
43
44template <>
45EIGEN_STRONG_INLINE PacketXi preinterpret<PacketXi, PacketXf>(const PacketXf& a) {
46 return svreinterpret_s32_f32(a);
47}
48
49} // namespace internal
50} // namespace Eigen
51
52#endif // EIGEN_TYPE_CASTING_SVE_H
Namespace containing all symbols from the Eigen library.
Definition Core:137