Skip to content

Commit

Permalink
Cleanup leftover debug variable and add separate aligned (u)int24 IO …
Browse files Browse the repository at this point in the history
…types
  • Loading branch information
DeltaRazero committed Feb 16, 2024
1 parent 8b70d46 commit e3db2cf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 0 additions & 1 deletion include/numio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ namespace NumIO
// This means this number does not have an assumed leading one before the binary point.
int denormalized_adjust = (exponent != 0) & 1;

double test = static_cast<FLOAT_T>(fraction_numerator)/FRACTION_DENOMINATOR;

FLOAT_T result = (
std::pow(2.0, -EXPONENT_BIAS + exponent + 1 - denormalized_adjust) // or use math.exp2(x)
Expand Down
8 changes: 4 additions & 4 deletions include/numio/fp_extra.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef FP_EXTRA_H
#define FP_EXTRA_H
#ifndef NUMIO_FP_EXTRA_H
#define NUMIO_FP_EXTRA_H

// ****************************************************************************

#include "../numio.hpp"
#include <cstdint>
#include "../numio.hpp"

namespace NumIO
{
Expand All @@ -23,4 +23,4 @@ namespace NumIO

// ****************************************************************************

#endif /* FP_EXTRA_H */
#endif /* NUMIO_FP_EXTRA_H */
24 changes: 13 additions & 11 deletions include/numio/std.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@

// ****************************************************************************

#include "../numio.hpp"
#include <cstdint>
#include "../numio.hpp"

namespace NumIO
{
using i8_IO = IntIO<std:: int8_t>;
using i16_IO = IntIO<std::int16_t>;
using i24_IO = IntIO<std::int32_t, 24>;
using i32_IO = IntIO<std::int32_t>;
using i64_IO = IntIO<std::int64_t>;
using i8_IO = IntIO<std:: int8_t>;
using i16_IO = IntIO<std::int16_t>;
using i24_IO = IntIO<std::int32_t, 24, false>;
using i24a_IO = IntIO<std::int32_t, 24, true>;
using i32_IO = IntIO<std::int32_t>;
using i64_IO = IntIO<std::int64_t>;

using u8_IO = IntIO<std:: uint8_t>;
using u16_IO = IntIO<std::uint16_t>;
using u24_IO = IntIO<std::uint32_t, 24>;
using u32_IO = IntIO<std::uint32_t>;
using u64_IO = IntIO<std::uint64_t>;
using u8_IO = IntIO<std:: uint8_t>;
using u16_IO = IntIO<std::uint16_t>;
using u24_IO = IntIO<std::uint32_t, 24, false>;
using u24a_IO = IntIO<std::uint32_t, 24, true>;
using u32_IO = IntIO<std::uint32_t>;
using u64_IO = IntIO<std::uint64_t>;

using fp16_IO = FloatIO<float, std::uint16_t, 5, 10>;
using fp32_IO = FloatIO<float, std::uint32_t>;
Expand Down

0 comments on commit e3db2cf

Please sign in to comment.