0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::simd: Add lane number constant tables.

This commit is contained in:
Jason Volk 2020-06-24 15:16:47 -07:00
parent 3490eb89e8
commit 001bd12287
2 changed files with 80 additions and 0 deletions

View file

@ -171,3 +171,18 @@ namespace ircd::simd
template<class V>
string_view print_mem(const mutable_buffer &buf, const V &) noexcept;
}
// Lane number convenience constants
namespace ircd::simd
{
extern const u8x32 u8x32_lane_id;
extern const u16x16 u16x16_lane_id;
extern const u8x16 u8x16_lane_id;
extern const u32x8 u32x8_lane_id;
extern const u16x8 u16x8_lane_id;
extern const u64x4 u64x4_lane_id;
extern const u32x4 u32x4_lane_id;
extern const u64x2 u64x2_lane_id;
extern const u256x1 u256x1_lane_id;
extern const u128x1 u128x1_lane_id;
}

View file

@ -10,6 +10,71 @@
#include <ircd/simd.h>
decltype(ircd::simd::u8x32_lane_id)
ircd::simd::u8x32_lane_id
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
};
decltype(ircd::simd::u16x16_lane_id)
ircd::simd::u16x16_lane_id
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
};
decltype(ircd::simd::u8x16_lane_id)
ircd::simd::u8x16_lane_id
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
};
decltype(ircd::simd::u32x8_lane_id)
ircd::simd::u32x8_lane_id
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
};
decltype(ircd::simd::u16x8_lane_id)
ircd::simd::u16x8_lane_id
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
};
decltype(ircd::simd::u64x4_lane_id)
ircd::simd::u64x4_lane_id
{
0x00, 0x01, 0x02, 0x03,
};
decltype(ircd::simd::u32x4_lane_id)
ircd::simd::u32x4_lane_id
{
0x00, 0x01, 0x02, 0x03,
};
decltype(ircd::simd::u64x2_lane_id)
ircd::simd::u64x2_lane_id
{
0x00, 0x01,
};
decltype(ircd::simd::u256x1_lane_id)
ircd::simd::u256x1_lane_id
{
0x00,
};
decltype(ircd::simd::u128x1_lane_id)
ircd::simd::u128x1_lane_id
{
0x00,
};
template<>
ircd::string_view
ircd::simd::print_lane(const mutable_buffer &buf,