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 #include "../../InternalHeaderCheck.h"
14 
15 namespace Eigen {
16 namespace internal {
17 
18 template <>
19 struct type_casting_traits<float, numext::int32_t> {
20  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
21 };
22 
23 template <>
24 struct type_casting_traits<numext::int32_t, float> {
25  enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
26 };
27 
28 template <>
29 EIGEN_STRONG_INLINE PacketXf pcast<PacketXi, PacketXf>(const PacketXi& a) {
30  return svcvt_f32_s32_z(svptrue_b32(), a);
31 }
32 
33 template <>
34 EIGEN_STRONG_INLINE PacketXi pcast<PacketXf, PacketXi>(const PacketXf& a) {
35  return svcvt_s32_f32_z(svptrue_b32(), a);
36 }
37 
38 template <>
39 EIGEN_STRONG_INLINE PacketXf preinterpret<PacketXf, PacketXi>(const PacketXi& a) {
40  return svreinterpret_f32_s32(a);
41 }
42 
43 template <>
44 EIGEN_STRONG_INLINE PacketXi preinterpret<PacketXi, PacketXf>(const PacketXf& a) {
45  return svreinterpret_s32_f32(a);
46 }
47 
48 } // namespace internal
49 } // namespace Eigen
50 
51 #endif // EIGEN_TYPE_CASTING_SVE_H
PacketXi preinterpret< PacketXi, PacketXf >(const PacketXf &a)
PacketXi pcast< PacketXf, PacketXi >(const PacketXf &a)
PacketXf pcast< PacketXi, PacketXf >(const PacketXi &a)
PacketXf preinterpret< PacketXf, PacketXi >(const PacketXi &a)
std::int32_t int32_t
Definition: Meta.h:40
: InteropHeaders
Definition: Core:139