Skip to content

Commit

Permalink
Fix std::bit_cast misuse
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Mar 10, 2021
1 parent 03332c3 commit 4adf412
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpcs3/Emu/RSX/Common/program_state_cache2.hpp
Expand Up @@ -4,6 +4,7 @@

#include "emmintrin.h"
#include "immintrin.h"
#include "util/asm.hpp"

template <typename Traits>
void program_state_cache<Traits>::fill_fragment_constants_buffer(gsl::span<f32> dst_buffer, const RSXFragmentProgram &fragment_program, bool sanitize) const
Expand Down Expand Up @@ -52,11 +53,11 @@ void program_state_cache<Traits>::fill_fragment_constants_buffer(gsl::span<f32>
const auto masked = _mm_and_si128(shuffled_vector, _mm_set1_epi32(0x7fffffff));
const auto valid = _mm_cmplt_epi32(masked, _mm_set1_epi32(0x7f800000));
const auto result = _mm_and_si128(shuffled_vector, valid);
_mm_stream_si128(std::bit_cast<__m128i*>(dst), result);
_mm_stream_si128(utils::bless<__m128i>(dst), result);
}
else
{
_mm_stream_si128(std::bit_cast<__m128i*>(dst), shuffled_vector);
_mm_stream_si128(utils::bless<__m128i>(dst), shuffled_vector);
}

dst += 4;
Expand Down

0 comments on commit 4adf412

Please sign in to comment.