Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.4.0
 
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
13namespace Eigen {
14namespace internal {
15
16template <>
17struct type_casting_traits<float, numext::int32_t> {
18 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
19};
20
21template <>
22struct type_casting_traits<numext::int32_t, float> {
23 enum { VectorizedCast = 1, SrcCoeffRatio = 1, TgtCoeffRatio = 1 };
24};
25
26template <>
27EIGEN_STRONG_INLINE PacketXf pcast<PacketXi, PacketXf>(const PacketXi& a) {
28 return svcvt_f32_s32_z(svptrue_b32(), a);
29}
30
31template <>
32EIGEN_STRONG_INLINE PacketXi pcast<PacketXf, PacketXi>(const PacketXf& a) {
33 return svcvt_s32_f32_z(svptrue_b32(), a);
34}
35
36template <>
37EIGEN_STRONG_INLINE PacketXf preinterpret<PacketXf, PacketXi>(const PacketXi& a) {
38 return svreinterpret_f32_s32(a);
39}
40
41template <>
42EIGEN_STRONG_INLINE PacketXi preinterpret<PacketXi, PacketXf>(const PacketXf& a) {
43 return svreinterpret_s32_f32(a);
44}
45
46} // namespace internal
47} // namespace Eigen
48
49#endif // EIGEN_TYPE_CASTING_SVE_H
Namespace containing all symbols from the Eigen library.
Definition: Core:141