mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 10:48:36 +12:00
Restore experimental optimized operators &= |= ^= for se_t
They were removed approximately 3 years ago due to their rarity.
This commit is contained in:
parent
7aed9c3f13
commit
0f567abdd8
1 changed files with 18 additions and 0 deletions
|
@ -252,6 +252,12 @@ namespace stx
|
|||
template <typename T1>
|
||||
se_t& operator&=(const T1& rhs)
|
||||
{
|
||||
if constexpr (std::is_integral_v<T>)
|
||||
{
|
||||
m_data = std::bit_cast<stype, T>(static_cast<T>(std::bit_cast<T>(m_data) & std::bit_cast<T>(static_cast<se_t>(rhs))));
|
||||
return *this;
|
||||
}
|
||||
|
||||
*this = value() & rhs;
|
||||
return *this;
|
||||
}
|
||||
|
@ -259,6 +265,12 @@ namespace stx
|
|||
template <typename T1>
|
||||
se_t& operator|=(const T1& rhs)
|
||||
{
|
||||
if constexpr (std::is_integral_v<T>)
|
||||
{
|
||||
m_data = std::bit_cast<stype, T>(static_cast<T>(std::bit_cast<T>(m_data) | std::bit_cast<T>(static_cast<se_t>(rhs))));
|
||||
return *this;
|
||||
}
|
||||
|
||||
*this = value() | rhs;
|
||||
return *this;
|
||||
}
|
||||
|
@ -266,6 +278,12 @@ namespace stx
|
|||
template <typename T1>
|
||||
se_t& operator^=(const T1& rhs)
|
||||
{
|
||||
if constexpr (std::is_integral_v<T>)
|
||||
{
|
||||
m_data = std::bit_cast<stype, T>(static_cast<T>(std::bit_cast<T>(m_data) ^ std::bit_cast<T>(static_cast<se_t>(rhs))));
|
||||
return *this;
|
||||
}
|
||||
|
||||
*this = value() ^ rhs;
|
||||
return *this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue