Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HUD-Software committed Jun 19, 2024
1 parent 4e524d9 commit ec093a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions interface/core/i128.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ namespace hud
class u128;

class alignas(16) i128
: protected details::i128::i128_impl
: public details::i128::i128_impl
{

private:
friend u128;
using super = details::i128::i128_impl;

public:
Expand Down Expand Up @@ -165,10 +164,9 @@ namespace hud
}

class alignas(16) u128
: protected details::i128::u128_impl
: public details::i128::u128_impl
{
private:
friend i128;
using super = details::i128::u128_impl;

public:
Expand Down
8 changes: 4 additions & 4 deletions interface/core/i128/i128_intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ namespace hud
/** Retrieves the low part of the u64. */
[[nodiscard]] constexpr u64 low() const noexcept
{
return bit_cast_to_signed_i64(static_cast<u64>(static_cast<unsigned __int128>(value_) >> 64));
return static_cast<u64>(value_ & ~u64 {0});
}

/** Retrieves the high part of the i64. */
[[nodiscard]] constexpr i64 high() const noexcept
{
return static_cast<u64>(value_ & ~u64 {0});
return bit_cast_to_signed_i64(static_cast<u64>(static_cast<unsigned __int128>(value_) >> 64));
}

/** Cast to bool. */
Expand Down Expand Up @@ -293,13 +293,13 @@ namespace hud
/** Retrieves the low part of the u64. */
[[nodiscard]] constexpr u64 low() const noexcept
{
return static_cast<u64>(value_ >> 64);
return static_cast<u64>(value_ & ~u64 {0});
}

/** Retrieves the high part of the i64. */
[[nodiscard]] constexpr u64 high() const noexcept
{
return static_cast<u64>(value_ & ~u64 {0});
return static_cast<u64>(value_ >> 64);
}

/** Cast to bool. */
Expand Down

0 comments on commit ec093a4

Please sign in to comment.