Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions absl/numeric/int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -1190,15 +1190,15 @@ constexpr int64_t BitCastToSigned(uint64_t v) {

} // namespace int128_internal

ABSL_NAMESPACE_END
} // namespace absl

#if defined(ABSL_HAVE_INTRINSIC_INT128)
#include "absl/numeric/int128_have_intrinsic.inc" // IWYU pragma: export
#else // ABSL_HAVE_INTRINSIC_INT128
#include "absl/numeric/int128_no_intrinsic.inc" // IWYU pragma: export
#endif // ABSL_HAVE_INTRINSIC_INT128

ABSL_NAMESPACE_END
} // namespace absl

#undef ABSL_INTERNAL_WCHAR_T

#endif // ABSL_NUMERIC_INT128_H_
6 changes: 6 additions & 0 deletions absl/numeric/int128_have_intrinsic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
// representation when ABSL_HAVE_INTRINSIC_INT128 is defined. This file is
// included by int128.h and relies on ABSL_INTERNAL_WCHAR_T being defined.

namespace absl {
ABSL_NAMESPACE_BEGIN

namespace int128_internal {

// Casts from unsigned to signed while preserving the underlying binary
Expand Down Expand Up @@ -307,3 +310,6 @@ constexpr int128 operator<<(int128 lhs, int amount) {
constexpr int128 operator>>(int128 lhs, int amount) {
return static_cast<__int128>(lhs) >> amount;
}

ABSL_NAMESPACE_END
} // namespace absl
6 changes: 6 additions & 0 deletions absl/numeric/int128_no_intrinsic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
// representation when ABSL_HAVE_INTRINSIC_INT128 is *not* defined. This file
// is included by int128.h and relies on ABSL_INTERNAL_WCHAR_T being defined.

namespace absl {
ABSL_NAMESPACE_BEGIN

constexpr uint64_t Int128Low64(int128 v) { return v.lo_; }

constexpr int64_t Int128High64(int128 v) { return v.hi_; }
Expand Down Expand Up @@ -347,3 +350,6 @@ constexpr int128 operator>>(int128 lhs, int amount) {
static_cast<uint64_t>(Int128High64(lhs) >> (amount - 64)));
}
}

ABSL_NAMESPACE_END
} // namespace absl