mirror of
https://github.com/yuzu-mirror/oaknut.git
synced 2026-03-03 00:43:50 +01:00
encode: Only check MovImm16 encode size in hiiiiiiiiiiiiiiii case
This commit is contained in:
parent
e1aa3456f6
commit
f9de15be61
|
|
@ -39,9 +39,11 @@ template<std::uint32_t splat>
|
|||
std::uint32_t encode(MovImm16 v)
|
||||
{
|
||||
static_assert(std::popcount(splat) == 17 || std::popcount(splat) == 18);
|
||||
constexpr std::uint32_t mask = (1 << std::popcount(splat)) - 1;
|
||||
if ((v.m_encoded & mask) != v.m_encoded)
|
||||
throw "invalid MovImm16";
|
||||
if constexpr (std::popcount(splat) == 17) {
|
||||
constexpr std::uint32_t mask = (1 << std::popcount(splat)) - 1;
|
||||
if ((v.m_encoded & mask) != v.m_encoded)
|
||||
throw "invalid MovImm16";
|
||||
}
|
||||
return detail::pdep(v.m_encoded, splat);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue