diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-18 18:58:23 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-18 18:58:27 +0200 |
commit | 541e9624eb69bb79f9d2f50c98a05445c54a220c (patch) | |
tree | 19b730079e658c712ed6e6257dd2fc7dbc044955 | |
parent | common: Move Is4KBAligned() to alignment.h (diff) | |
download | yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.tar yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.tar.gz yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.tar.bz2 yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.tar.lz yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.tar.xz yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.tar.zst yuzu-541e9624eb69bb79f9d2f50c98a05445c54a220c.zip |
-rw-r--r-- | src/common/alignment.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h index b3f103c07..d94a2291f 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h @@ -25,4 +25,10 @@ constexpr bool Is4KBAligned(T value) { return (value & 0xFFF) == 0; } +template <typename T> +constexpr bool IsWordAligned(T value) { + static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); + return (value & 0b11) == 0; +} + } // namespace Common |