Tidy endianness support (se_t) implementation

Move se_t and se_storage to util/endian.hpp
Use single template instead of two specializations.
Add minor optimization for MSVC.
Remove v128 dependency.
Try to enable intrinsics for unaligned data.
Fix minor bug in u16/u32/u64 specializations.
This commit is contained in:
Nekotekina 2019-09-26 21:57:03 +03:00
parent c7c12941bc
commit bd1a24b894
8 changed files with 308 additions and 344 deletions

View file

@ -65,9 +65,7 @@ namespace rsx
rsx->sync_point_request = true;
const u32 addr = get_address(method_registers.semaphore_offset_406e(), method_registers.semaphore_context_dma_406e());
// Get raw BE value
arg = be_t<u32>{arg}.raw();
const auto& sema = vm::_ref<atomic_t<nse_t<u32>>>(addr);
const auto& sema = vm::_ref<atomic_t<be_t<u32>>>(addr);
// TODO: Remove vblank semaphore hack
if (sema.load() == arg || addr == rsx->ctxt_addr + 0x30) return;
@ -247,7 +245,7 @@ namespace rsx
case rsx::vertex_base_type::ub:
case rsx::vertex_base_type::ub256:
// Get BE data
arg = be_t<u32>{arg}.raw();
arg = std::bit_cast<u32, be_t<u32>>(arg);
break;
default:
break;
@ -1301,7 +1299,7 @@ namespace rsx
else
{
std::vector<u8> temp(line_length * line_count);
u8* buf = temp.data();
u8* buf = temp.data();
for (u32 y = 0; y < line_count; ++y)
{
@ -1310,7 +1308,7 @@ namespace rsx
src += in_pitch;
}
buf = temp.data();
buf = temp.data();
for (u32 y = 0; y < line_count; ++y)
{