cellAdec implementation part 2: LPCM decoder#16381
Conversation
|
|
||
| constexpr v128(const v128&) noexcept = default; | ||
|
|
||
| constexpr v128(const normal_array_t<u8>& _u8) noexcept : _u8(_u8){} |
There was a problem hiding this comment.
You can use a template here, and do std::bit_cast<v128> for all masked_array_t
There was a problem hiding this comment.
Bit casting to union types isn't constexpr. But changing the existing constructor to this would work:
template <Vector128 T>
constexpr v128(const T& rhs) noexcept
: _u(std::bit_cast<u128>(rhs))
{
}However, it would technically be UB to access the vector through any member other than _u afterwards.
Or do you mean something different?
There was a problem hiding this comment.
I rather it not be constexpr than, for constexpr stuff you can do the trick with masked_array_t as you have done earlier.
| inline v128 gv_loadfs(const void* ptr) | ||
| { | ||
| #if defined(ARCH_X64) | ||
| return _mm_load_ps(static_cast<const f32*>(ptr)); |
There was a problem hiding this comment.
There is no significant performance difference between them in modern CPUs, hence why MSVC doed not emit it. Nor should we as the risks outweigh the advantage.
| return _mm_load_ps(static_cast<const f32*>(ptr)); | |
| return _mm_loadu_ps(static_cast<const f32*>(ptr)); |
| inline v128 gv_load(const void* ptr) | ||
| { | ||
| #if defined(ARCH_X64) | ||
| return _mm_load_si128(static_cast<const __m128i*>(ptr)); |
There was a problem hiding this comment.
| return _mm_load_si128(static_cast<const __m128i*>(ptr)); | |
| return _mm_loadu_si128(static_cast<const __m128i*>(ptr)); |
* cellAdec: savestate fixup * simd.hpp: add some intrinsics * cellAdec implementation part 2: LPCM decoder * cellAdec: set to HLE by default * cellAdec: review fixes --------- Co-authored-by: Elad <18193363+elad335@users.noreply.github.com>
sample_num % channel_num == 0,access_unit_size % sample_size == 0)