Skip to content

Commit

Permalink
Fix some issues related to arm64ec
Browse files Browse the repository at this point in the history
  • Loading branch information
trcrsired committed Nov 25, 2024
1 parent c93f644 commit 4e83fa4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 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)) && !defined(__arm64ec__)
#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

0 comments on commit 4e83fa4

Please sign in to comment.