Skip to content

Commit

Permalink
Merge branch 'trcrsired:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroModel authored Nov 25, 2024
2 parents 5ea877e + 4e83fa4 commit b1101cb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions include/fast_io_core_impl/intrinsics/carry.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inline constexpr T addc(T a, T b, bool carryin, bool &carryout) noexcept
if (!__builtin_is_constant_evaluated())
#endif
{
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_IX86) || defined(_M_AMD64))
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_IX86) || defined(_M_AMD64)) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
#if !__has_cpp_attribute(assume)
__assume(carryin == 0 || carryin == 1);
#endif
Expand Down Expand Up @@ -104,7 +104,7 @@ inline constexpr T subc(T a, T b, bool carryin, bool &carryout) noexcept
if (!__builtin_is_constant_evaluated())
#endif
{
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_IX86) || defined(_M_AMD64))
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_IX86) || defined(_M_AMD64)) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
#if !__has_cpp_attribute(assume)
__assume(carryin == 0 || carryin == 1);
#endif
Expand Down
2 changes: 2 additions & 0 deletions include/fast_io_core_impl/intrinsics/msvc/impl.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#pragma once

#if defined(_MSC_VER) && !defined(__clang__)
#if !defined(_M_ARM64EC)
#include "x86.h"
#endif
#include "arm.h"
#include "common.h"
#endif
6 changes: 3 additions & 3 deletions include/fast_io_core_impl/intrinsics/udivmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Referenced from
template <typename T>
inline constexpr tuint<T> udivbigbysmalltosmalldefault(T u1, T u0, T v) noexcept
{
#if defined(__x86_64__) || defined(_M_AMD64)
#if (defined(__x86_64__) || defined(_M_AMD64)) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
if constexpr (sizeof(T) == sizeof(::std::uint_least64_t))
{
#if defined(__cpp_if_consteval)
Expand Down Expand Up @@ -112,7 +112,7 @@ inline constexpr tuint<T> udivbigbysmalltosmalldefault(T u1, T u0, T v) noexcept
template <typename T>
inline constexpr T shiftleft(T low, T high, unsigned shift) noexcept
{
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_AMD64)
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_AMD64) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
if constexpr (sizeof(T) == sizeof(long long unsigned))
{
#if defined(__cpp_if_consteval)
Expand All @@ -137,7 +137,7 @@ inline constexpr T shiftleft(T low, T high, unsigned shift) noexcept
template <typename T>
inline constexpr T shiftright(T low, T high, unsigned shift) noexcept
{
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_AMD64)
#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_AMD64) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
if constexpr (sizeof(T) == sizeof(long long unsigned))
{
#if defined(__cpp_if_consteval)
Expand Down
4 changes: 2 additions & 2 deletions include/fast_io_core_impl/intrinsics/umul.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ inline constexpr T umul(U a, T b, U &high) noexcept
return static_cast<T>(res);
}
}
#elif defined(_MSC_VER) && defined(_M_X64)
#elif defined(_MSC_VER) && defined(_M_X64) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
#if defined(__cpp_lib_is_constant_evaluated) || defined(__cpp_if_consteval)
#if defined(__cpp_if_consteval)
if consteval
Expand Down Expand Up @@ -526,7 +526,7 @@ inline constexpr U umulh(U a, T b) noexcept
return static_cast<U>(res >> 64u);
}
}
#elif defined(_MSC_VER) && defined(_M_X64)
#elif defined(_MSC_VER) && defined(_M_X64) && !defined(__arm64ec__) && !defined(_M_ARM64EC)
#if defined(__cpp_lib_is_constant_evaluated) || defined(__cpp_if_consteval)
#if defined(__cpp_if_consteval)
if consteval
Expand Down
8 changes: 4 additions & 4 deletions include/fast_io_dsal/impl/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -1468,21 +1468,21 @@ class
};

template <::std::integral chtype, typename allocator1, typename U>
inline constexpr void erase(::fast_io::containers::basic_string<chtype, allocator1> const &c, U const &value)
inline constexpr ::fast_io::containers::basic_string<chtype, allocator1>::size_type erase(::fast_io::containers::basic_string<chtype, allocator1> &c, U const &value)
{
auto it = ::std::remove(c.begin(), c.end(), value);
auto r = c.end() - it;
c.erase(it, c.end());
return r;
return static_cast<::fast_io::containers::basic_string<chtype, allocator1>::size_type>(r);
}

template <::std::integral chtype, typename allocator1, typename Pred>
inline constexpr void erase_if(::fast_io::containers::basic_string<chtype, allocator1> const &c, Pred pred)
inline constexpr ::fast_io::containers::basic_string<chtype, allocator1>::size_type erase_if(::fast_io::containers::basic_string<chtype, allocator1> &c, Pred pred)
{
auto it = ::std::remove_if(c.begin(), c.end(), pred);
auto r = c.end() - it;
c.erase(it, c.end());
return r;
return static_cast<::fast_io::containers::basic_string<chtype, allocator1>::size_type>(r);
}

template <::std::integral chtype, typename allocator1, typename allocator2>
Expand Down

0 comments on commit b1101cb

Please sign in to comment.