Skip to content

Commit

Permalink
Correct SSE instruction SHUFPS
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Nov 19, 2024
1 parent be88cbc commit 98f374e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/cpu/core_normal/support.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,14 @@ static INLINE void SSE_PEXTRW(uint32_t &d,const MMX_reg &s,const uint8_t i) {
////

static INLINE void SSE_SHUFPS(XMM_Reg &d,const XMM_Reg &s,const uint8_t i) {
d.u32[0] = s.u32[(i>>0u)&3u];
d.u32[1] = s.u32[(i>>2u)&3u];
d.u32[2] = s.u32[(i>>4u)&3u];
d.u32[3] = s.u32[(i>>6u)&3u];
/* d is reg, s is rm */
XMM_Reg tmp;

tmp.u32[0] = d.u32[(i>>0u)&3u];
tmp.u32[1] = d.u32[(i>>2u)&3u];
tmp.u32[2] = s.u32[(i>>4u)&3u];
tmp.u32[3] = s.u32[(i>>6u)&3u];
d = tmp;
}

////
Expand Down

0 comments on commit 98f374e

Please sign in to comment.