Skip to content

Commit

Permalink
Prefer shuffle to broadcastss_ps on non-Intel processors
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Mar 6, 2020
1 parent 7faf4c0 commit 4d6117c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Inc/DirectXMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ namespace DirectX
template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<1, 1, 3, 3>(FXMVECTOR V) noexcept { return _mm_movehdup_ps(V); }
#endif

#if defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_)
#if defined(_XM_AVX2_INTRINSICS_) && !defined(_XM_NO_INTRINSICS_) && defined(_XM_FAVOR_INTEL_)
template<> inline XMVECTOR XM_CALLCONV XMVectorSwizzle<0, 0, 0, 0>(FXMVECTOR V) noexcept { return _mm_broadcastss_ps(V); }
#endif

Expand Down
2 changes: 1 addition & 1 deletion Inc/DirectXMathVector.inl
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ inline XMVECTOR XM_CALLCONV XMVectorSplatX(FXMVECTOR V) noexcept
return vResult.v;
#elif defined(_XM_ARM_NEON_INTRINSICS_)
return vdupq_lane_f32(vget_low_f32(V), 0);
#elif defined(_XM_AVX2_INTRINSICS_)
#elif defined(_XM_AVX2_INTRINSICS_) && defined(_XM_FAVOR_INTEL_)
return _mm_broadcastss_ps(V);
#elif defined(_XM_SSE_INTRINSICS_)
return XM_PERMUTE_PS(V, _MM_SHUFFLE(0, 0, 0, 0));
Expand Down

0 comments on commit 4d6117c

Please sign in to comment.