rsx fp/vp analyzers: Fix strict type aliasing and improve codegen

This commit is contained in:
Eladash 2020-04-10 10:05:23 +03:00 committed by kd-11
parent ae1ff1e96d
commit cb14805d78
4 changed files with 74 additions and 71 deletions

View file

@ -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));