diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-16 09:01:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-16 09:01:36 +0100 |
commit | 30d4c8e5c26aa89a64998ef1da350d4d80359237 (patch) | |
tree | e19c909675d703dc9837202ee8ca2ced1d98a20c /serialize/packbits-write.cpp | |
parent | 07716595e0c26ba6d19ee6c498280508ca5aa6c2 (diff) |
cw
Diffstat (limited to 'serialize/packbits-write.cpp')
-rw-r--r-- | serialize/packbits-write.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/serialize/packbits-write.cpp b/serialize/packbits-write.cpp index 045d6283..5db0fa1b 100644 --- a/serialize/packbits-write.cpp +++ b/serialize/packbits-write.cpp @@ -1,6 +1,10 @@ #include "packbits-write.hpp" -namespace floormat::detail_Pack_output { +namespace floormat { + +namespace { + +using namespace floormat::Pack; using u32 = uint32_t; using u16 = uint16_t; @@ -22,18 +26,21 @@ static_assert(write_( output<u32, 32, 32>{0}, make_reverse_index_sequence<3>{}) == 0b000101110); -static_assert(write(std::tuple{f32<2>{0b10}, f32<3>{0b011}, f32<3>{0b01}}) == 0b00101110); -//static_assert(write(std::tuple{f32<2>{0b10}, f32<3>{0b1011}, f32<3>{0b001}}) == 0b000101110); -static_assert(write(std::tuple{f8<2>{0b10}, f8<3>{0b011}, f8<3>{0b01}}) == 0b00101110); -//static_assert(write(std::tuple{f8<2>{0b10}, f8<3>{0b011}, f8<4>{0b01}}) == 0b00101110); -//static_assert(write(std::tuple{}) == 0); +static_assert(pack_write(std::tuple{f32<2>{0b10}, f32<3>{0b011}, f32<3>{0b01}}) == 0b00101110); +//static_assert(pack_write(std::tuple{f32<2>{0b10}, f32<3>{0b1011}, f32<3>{0b001}}) == 0b000101110); +static_assert(pack_write(std::tuple{f8<2>{0b10}, f8<3>{0b011}, f8<3>{0b01}}) == 0b00101110); +//static_assert(pack_write(std::tuple{f8<2>{0b10}, f8<3>{0b011}, f8<4>{0b01}}) == 0b00101110); +//static_assert(pack_write(std::tuple{}) == 0); +static_assert(pack_write(std::tuple{f8<1>{0b1}, f8<3>{0b101}, f8<2>{0b10}}) == 0b101011); #if 0 // check disasembly u32 foo1(u32 a, u32 b, u32 c); u32 foo1(u32 a, u32 b, u32 c) { - return write(std::tuple{f32<2>{a}, f32<3>{b}, f32<3>{c}}); + return pack_write(std::tuple{f32<2>{a}, f32<3>{b}, f32<3>{c}}); } #endif -} // namespace floormat::detail_Pack_output +} // namespace + +} // namespace floormat |