aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-12-18 14:46:52 -0800
committerChris Robinson <[email protected]>2022-12-18 14:46:52 -0800
commitb4e281e2fb1cc15205cb8df7dd5ab7b91030b8c5 (patch)
tree778d6ae5d565b9959b26f3a11725117a11f69096 /common
parent14d7809a89ea51ca663a7ebf09e7bc135b904d5d (diff)
Revert "Change the order of compiler checks in assume_aligned"
This reverts commit 14d7809a89ea51ca663a7ebf09e7bc135b904d5d.
Diffstat (limited to 'common')
-rw-r--r--common/opthelpers.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/common/opthelpers.h b/common/opthelpers.h
index 0f05dc3c..04c5f1d0 100644
--- a/common/opthelpers.h
+++ b/common/opthelpers.h
@@ -58,17 +58,15 @@ force_inline constexpr auto assume_aligned(T *ptr) noexcept
return std::assume_aligned<alignment,T>(ptr);
#elif HAS_BUILTIN(__builtin_assume_aligned)
return static_cast<T*>(__builtin_assume_aligned(ptr, alignment));
-#elif defined(_MSC_VER)
+#elif defined(__ICC)
+ __assume_aligned(ptr, alignment);
+ return ptr;
+#else
constexpr std::size_t alignment_mask{(1<<alignment) - 1};
if((reinterpret_cast<std::uintptr_t>(ptr)&alignment_mask) == 0)
return ptr;
unreachable();
-#elif defined(__ICC)
- __assume_aligned(ptr, alignment);
- return ptr;
- #else
- return ptr;
- #endif
+#endif
}
} // namespace al