SSE/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) 2015 Benoit Steiner <benoit.steiner.goog@gmail.com>
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_SSE_H
11 #define EIGEN_TYPE_CASTING_SSE_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16 
17 template <>
18 struct type_casting_traits<float, int> {
19  enum {
20  VectorizedCast = 1,
21  SrcCoeffRatio = 1,
22  TgtCoeffRatio = 1
23  };
24 };
25 
27  return _mm_cvttps_epi32(a);
28 }
29 
30 
31 template <>
32 struct type_casting_traits<int, float> {
33  enum {
34  VectorizedCast = 1,
35  SrcCoeffRatio = 1,
36  TgtCoeffRatio = 1
37  };
38 };
39 
41  return _mm_cvtepi32_ps(a);
42 }
43 
44 
45 template <>
46 struct type_casting_traits<double, float> {
47  enum {
51  };
52 };
53 
55  return _mm_shuffle_ps(_mm_cvtpd_ps(a), _mm_cvtpd_ps(b), (1 << 2) | (1 << 6));
56 }
57 
58 template <>
59 struct type_casting_traits<float, double> {
60  enum {
64  };
65 };
66 
68  // Simply discard the second half of the input
69  return _mm_cvtps_pd(a);
70 }
71 
72 
73 } // end namespace internal
74 
75 } // end namespace Eigen
76 
77 #endif // EIGEN_TYPE_CASTING_SSE_H
#define EIGEN_STRONG_INLINE
Definition: Macros.h:493
Definition: LDLT.h:16
__vector int Packet4i
EIGEN_STRONG_INLINE Packet4i pcast< Packet4f, Packet4i >(const Packet4f &a)
EIGEN_STRONG_INLINE Packet4f pcast< Packet4i, Packet4f >(const Packet4i &a)
EIGEN_STRONG_INLINE Packet4f pcast< Packet2d, Packet4f >(const Packet2d &a, const Packet2d &b)
EIGEN_DEVICE_FUNC const Scalar & b
EIGEN_STRONG_INLINE Packet2d pcast< Packet4f, Packet2d >(const Packet4f &a)


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:09:45