mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-16 05:35:57 +08:00
Add a mechanism to recursively access to half-size packet types
This commit is contained in:
parent
8d2bb2c20d
commit
10aa14592a
@ -42,6 +42,8 @@ namespace internal {
|
|||||||
struct default_packet_traits
|
struct default_packet_traits
|
||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
|
HasHalfPacket = 0,
|
||||||
|
|
||||||
HasAdd = 1,
|
HasAdd = 1,
|
||||||
HasSub = 1,
|
HasSub = 1,
|
||||||
HasMul = 1,
|
HasMul = 1,
|
||||||
@ -71,10 +73,12 @@ struct default_packet_traits
|
|||||||
template<typename T> struct packet_traits : default_packet_traits
|
template<typename T> struct packet_traits : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef T type;
|
typedef T type;
|
||||||
|
typedef T half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 0,
|
Vectorizable = 0,
|
||||||
size = 1,
|
size = 1,
|
||||||
AlignedOnScalar = 0
|
AlignedOnScalar = 0,
|
||||||
|
HasHalfPacket = 0
|
||||||
};
|
};
|
||||||
enum {
|
enum {
|
||||||
HasAdd = 0,
|
HasAdd = 0,
|
||||||
|
@ -25,10 +25,12 @@ struct Packet4cf
|
|||||||
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4cf type;
|
typedef Packet4cf type;
|
||||||
|
typedef Packet2cf half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
size = 4,
|
size = 4,
|
||||||
|
HasHalfPacket = 1,
|
||||||
|
|
||||||
HasAdd = 1,
|
HasAdd = 1,
|
||||||
HasSub = 1,
|
HasSub = 1,
|
||||||
@ -257,10 +259,12 @@ struct Packet2cd
|
|||||||
template<> struct packet_traits<std::complex<double> > : default_packet_traits
|
template<> struct packet_traits<std::complex<double> > : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet2cd type;
|
typedef Packet2cd type;
|
||||||
|
typedef Packet1cd half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 0,
|
AlignedOnScalar = 0,
|
||||||
size = 2,
|
size = 2,
|
||||||
|
HasHalfPacket = 1,
|
||||||
|
|
||||||
HasAdd = 1,
|
HasAdd = 1,
|
||||||
HasSub = 1,
|
HasSub = 1,
|
||||||
|
@ -40,10 +40,12 @@ template<> struct is_arithmetic<__m256d> { enum { value = true }; };
|
|||||||
template<> struct packet_traits<float> : default_packet_traits
|
template<> struct packet_traits<float> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet8f type;
|
typedef Packet8f type;
|
||||||
|
typedef Packet4f half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
size=8,
|
size=8,
|
||||||
|
HasHalfPacket = 1,
|
||||||
|
|
||||||
HasDiv = 1,
|
HasDiv = 1,
|
||||||
HasSin = 0,
|
HasSin = 0,
|
||||||
@ -56,10 +58,12 @@ template<> struct packet_traits<float> : default_packet_traits
|
|||||||
template<> struct packet_traits<double> : default_packet_traits
|
template<> struct packet_traits<double> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4d type;
|
typedef Packet4d type;
|
||||||
|
typedef Packet2d half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
size=4,
|
size=4,
|
||||||
|
HasHalfPacket = 1,
|
||||||
|
|
||||||
HasDiv = 1,
|
HasDiv = 1,
|
||||||
HasExp = 0
|
HasExp = 0
|
||||||
|
@ -33,6 +33,7 @@ struct Packet2cf
|
|||||||
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet2cf type;
|
typedef Packet2cf type;
|
||||||
|
typedef Packet2cf half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
|
@ -73,6 +73,7 @@ static Packet4f p4f_ZERO_ = (Packet4f) vec_sl((Packet4ui)p4i_MINUS1, (Packet4ui)
|
|||||||
template<> struct packet_traits<float> : default_packet_traits
|
template<> struct packet_traits<float> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4f type;
|
typedef Packet4f type;
|
||||||
|
typedef Packet4f half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
@ -89,6 +90,7 @@ template<> struct packet_traits<float> : default_packet_traits
|
|||||||
template<> struct packet_traits<int> : default_packet_traits
|
template<> struct packet_traits<int> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4i type;
|
typedef Packet4i type;
|
||||||
|
typedef Packet4i half;
|
||||||
enum {
|
enum {
|
||||||
// FIXME check the Has*
|
// FIXME check the Has*
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
|
@ -28,6 +28,7 @@ struct Packet2cf
|
|||||||
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet2cf type;
|
typedef Packet2cf type;
|
||||||
|
typedef Packet2cf half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
|
@ -66,6 +66,7 @@ typedef uint32x4_t Packet4ui;
|
|||||||
template<> struct packet_traits<float> : default_packet_traits
|
template<> struct packet_traits<float> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4f type;
|
typedef Packet4f type;
|
||||||
|
typedef Packet4f half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
@ -83,6 +84,7 @@ template<> struct packet_traits<float> : default_packet_traits
|
|||||||
template<> struct packet_traits<int> : default_packet_traits
|
template<> struct packet_traits<int> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4i type;
|
typedef Packet4i type;
|
||||||
|
typedef Packet4i half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
|
@ -28,10 +28,12 @@ struct Packet2cf
|
|||||||
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
template<> struct packet_traits<std::complex<float> > : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet2cf type;
|
typedef Packet2cf type;
|
||||||
|
typedef Packet2cf half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
size = 2,
|
size = 2,
|
||||||
|
HasHalfPacket = 0,
|
||||||
|
|
||||||
HasAdd = 1,
|
HasAdd = 1,
|
||||||
HasSub = 1,
|
HasSub = 1,
|
||||||
@ -276,10 +278,12 @@ struct Packet1cd
|
|||||||
template<> struct packet_traits<std::complex<double> > : default_packet_traits
|
template<> struct packet_traits<std::complex<double> > : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet1cd type;
|
typedef Packet1cd type;
|
||||||
|
typedef Packet1cd half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 0,
|
AlignedOnScalar = 0,
|
||||||
size = 1,
|
size = 1,
|
||||||
|
HasHalfPacket = 0,
|
||||||
|
|
||||||
HasAdd = 1,
|
HasAdd = 1,
|
||||||
HasSub = 1,
|
HasSub = 1,
|
||||||
|
@ -64,10 +64,12 @@ template<> struct is_arithmetic<__m128d> { enum { value = true }; };
|
|||||||
template<> struct packet_traits<float> : default_packet_traits
|
template<> struct packet_traits<float> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4f type;
|
typedef Packet4f type;
|
||||||
|
typedef Packet4f half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
size=4,
|
size=4,
|
||||||
|
HasHalfPacket = 0,
|
||||||
|
|
||||||
HasDiv = 1,
|
HasDiv = 1,
|
||||||
HasSin = EIGEN_FAST_MATH,
|
HasSin = EIGEN_FAST_MATH,
|
||||||
@ -80,10 +82,12 @@ template<> struct packet_traits<float> : default_packet_traits
|
|||||||
template<> struct packet_traits<double> : default_packet_traits
|
template<> struct packet_traits<double> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet2d type;
|
typedef Packet2d type;
|
||||||
|
typedef Packet2d half;
|
||||||
enum {
|
enum {
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
AlignedOnScalar = 1,
|
AlignedOnScalar = 1,
|
||||||
size=2,
|
size=2,
|
||||||
|
HasHalfPacket = 0,
|
||||||
|
|
||||||
HasDiv = 1,
|
HasDiv = 1,
|
||||||
HasExp = 1,
|
HasExp = 1,
|
||||||
@ -94,6 +98,7 @@ template<> struct packet_traits<double> : default_packet_traits
|
|||||||
template<> struct packet_traits<int> : default_packet_traits
|
template<> struct packet_traits<int> : default_packet_traits
|
||||||
{
|
{
|
||||||
typedef Packet4i type;
|
typedef Packet4i type;
|
||||||
|
typedef Packet4i half;
|
||||||
enum {
|
enum {
|
||||||
// FIXME check the Has*
|
// FIXME check the Has*
|
||||||
Vectorizable = 1,
|
Vectorizable = 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user