Skip to content

Commit 6473b33

Browse files
authored
Merge pull request #329 from cppalliance/develop
Merge to master for v1.6.1
2 parents 9bf92ac + 04782d2 commit 6473b33

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

include/boost/int128/detail/int128_imp.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ namespace boost {
2424
namespace int128 {
2525

2626
struct
27-
#if defined(BOOST_INT128_HAS_INT128) || defined(BOOST_INT128_HAS_MSVC_INT128)
27+
#if (defined(BOOST_INT128_HAS_INT128) || defined(BOOST_INT128_HAS_MSVC_INT128)) && !defined(_M_IX86)
2828
alignas(alignof(detail::builtin_i128))
29-
#else
30-
alignas(16)
3129
#endif
3230
int128_t
3331
{

include/boost/int128/detail/uint128_imp.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ namespace boost {
2525
namespace int128 {
2626

2727
BOOST_INT128_EXPORT struct
28-
#if defined(BOOST_INT128_HAS_INT128) || defined(BOOST_INT128_HAS_MSVC_INT128)
28+
#if (defined(BOOST_INT128_HAS_INT128) || defined(BOOST_INT128_HAS_MSVC_INT128)) && !defined(_M_IX86)
2929
alignas(alignof(detail::builtin_u128))
30-
#else
31-
alignas(16)
3230
#endif
3331
uint128_t
3432
{
@@ -401,8 +399,8 @@ BOOST_INT128_EXPORT constexpr bool operator==(const uint128_t lhs, const uint128
401399
}
402400
else
403401
{
404-
__m128i a = _mm_load_si128(reinterpret_cast<const __m128i*>(&lhs));
405-
__m128i b = _mm_load_si128(reinterpret_cast<const __m128i*>(&rhs));
402+
__m128i a = _mm_loadu_si128(reinterpret_cast<const __m128i*>(&lhs));
403+
__m128i b = _mm_loadu_si128(reinterpret_cast<const __m128i*>(&rhs));
406404
__m128i cmp = _mm_cmpeq_epi32(a, b);
407405

408406
return _mm_movemask_ps(_mm_castsi128_ps(cmp)) == 0xF;
@@ -537,8 +535,8 @@ BOOST_INT128_EXPORT constexpr bool operator!=(const uint128_t lhs, const uint128
537535
}
538536
else
539537
{
540-
__m128i a = _mm_load_si128(reinterpret_cast<const __m128i*>(&lhs));
541-
__m128i b = _mm_load_si128(reinterpret_cast<const __m128i*>(&rhs));
538+
__m128i a = _mm_loadu_si128(reinterpret_cast<const __m128i*>(&lhs));
539+
__m128i b = _mm_loadu_si128(reinterpret_cast<const __m128i*>(&rhs));
542540
__m128i cmp = _mm_cmpeq_epi32(a, b);
543541

544542
return _mm_movemask_ps(_mm_castsi128_ps(cmp)) != 0xF;

include/boost/int128/string.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ namespace int128 {
2020
template <typename T>
2121
auto to_string(const T& value) -> std::enable_if_t<(std::is_same<T, int128_t>::value || std::is_same<T, uint128_t>::value), std::string>
2222
{
23-
char buffer[64U] {};
23+
char buffer[64];
2424
const auto last {detail::mini_to_chars(buffer, value, 10, false)};
25-
return std::string{last};
25+
return std::string{last, buffer + sizeof(buffer)};
2626
}
2727

2828
} // namespace int128

0 commit comments

Comments
 (0)