mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
rsx fp/vp analyzers: Fix strict type aliasing and improve codegen
This commit is contained in:
parent
ae1ff1e96d
commit
cb14805d78
4 changed files with 74 additions and 71 deletions
|
@ -223,6 +223,20 @@ union alignas(16) v128
|
|||
return ret;
|
||||
}
|
||||
|
||||
// Unaligned load with optional index offset
|
||||
static v128 loadu(const void* ptr, std::size_t index = 0)
|
||||
{
|
||||
v128 ret;
|
||||
std::memcpy(&ret, static_cast<const u8*>(ptr) + index * sizeof(v128), sizeof(v128));
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Unaligned store with optional index offset
|
||||
static void storeu(v128 value, void* ptr, std::size_t index = 0)
|
||||
{
|
||||
std::memcpy(static_cast<u8*>(ptr) + index * sizeof(v128), &value, sizeof(v128));
|
||||
}
|
||||
|
||||
static inline v128 add8(const v128& left, const v128& right)
|
||||
{
|
||||
return fromV(_mm_add_epi8(left.vi, right.vi));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue