SVE/TypeCasting.h
Go to the documentation of this file.
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 
16 namespace Eigen {
17 namespace internal {
18 
19 template <>
20 struct type_casting_traits<float, numext::int32_t> {
21  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
22 };
23 
24 template <>
25 struct type_casting_traits<numext::int32_t, float> {
26  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
27 };
28 
29 template <>
30 EIGEN_STRONG_INLINE PacketXf pcast<PacketXi, PacketXf>(const PacketXi& a) {
31  return svcvt_f32_s32_x(svptrue_b32(), a);
32 }
33 
34 template <>
35 EIGEN_STRONG_INLINE PacketXi pcast<PacketXf, PacketXi>(const PacketXf& a) {
36  return svcvt_s32_f32_x(svptrue_b32(), a);
37 }
38 
39 template <>
41  return svreinterpret_f32_s32(a);
42 }
43 
44 template <>
46  return svreinterpret_s32_f32(a);
47 }
48 
49 } // namespace internal
50 } // namespace Eigen
51 
52 #endif // EIGEN_TYPE_CASTING_SVE_H
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
const Scalar * a
Definition: level2_cplx_impl.h:32
EIGEN_STRONG_INLINE PacketXf preinterpret< PacketXf, PacketXi >(const PacketXi &a)
Definition: SVE/TypeCasting.h:40
EIGEN_STRONG_INLINE PacketXf pcast< PacketXi, PacketXf >(const PacketXi &a)
Definition: SVE/TypeCasting.h:30
EIGEN_STRONG_INLINE PacketXi preinterpret< PacketXi, PacketXf >(const PacketXf &a)
Definition: SVE/TypeCasting.h:45
EIGEN_STRONG_INLINE PacketXi pcast< PacketXf, PacketXi >(const PacketXf &a)
Definition: SVE/TypeCasting.h:35
std::int32_t int32_t
Definition: Meta.h:41
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
Definition: Eigen_Colamd.h:49
@ TgtCoeffRatio
Definition: GenericPacketMath.h:206
@ VectorizedCast
Definition: GenericPacketMath.h:203
@ SrcCoeffRatio
Definition: GenericPacketMath.h:205