From 04d2db5aa3b031178465ccd916784c5a498bf14e Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Mon, 13 Nov 2023 15:11:46 -0500
Subject: [PATCH] Tweak simd

---
 indra/llmath/llmatrix4a.h   | 11 ++++++-----
 indra/llrender/llrender.cpp |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/indra/llmath/llmatrix4a.h b/indra/llmath/llmatrix4a.h
index 75f0a534b68..81986ce5ecf 100644
--- a/indra/llmath/llmatrix4a.h
+++ b/indra/llmath/llmatrix4a.h
@@ -108,11 +108,12 @@ class alignas(16) LLMatrix4a
 
 	inline void setIdentity()
 	{
-		const __m128 ones = _mm_set_ps(1.f,0.f,0.f,1.f);
-		mMatrix[0] = _mm_movelh_ps(ones,_mm_setzero_ps());
-		mMatrix[1] = _mm_movehl_ps(_mm_setzero_ps(),ones);
-		mMatrix[2] = _mm_movelh_ps(_mm_setzero_ps(),ones);
-		mMatrix[3] = _mm_movehl_ps(ones,_mm_setzero_ps());
+		const LLQuad ones = _mm_set_ps(1.f,0.f,0.f,1.f);
+		const LLQuad zeroes = _mm_setzero_ps();
+		mMatrix[0] = _mm_movelh_ps(ones, zeroes);
+		mMatrix[1] = _mm_movehl_ps(zeroes,ones);
+		mMatrix[2] = _mm_movelh_ps(zeroes,ones);
+		mMatrix[3] = _mm_movehl_ps(ones, zeroes);
 	}
 
 	inline void load4a(const F32* src)
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 58272ec12e0..df7ac879f77 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -865,7 +865,7 @@ LLRender::LLRender()
 	mLightHash = 0;
 	
 	//Init base matrix for each mode
-	for(S32 i = 0; i < NUM_MATRIX_MODES; ++i)
+	for(U32 i = 0; i < NUM_MATRIX_MODES; ++i)
 	{
 		mMatrix[i][0].setIdentity();
 	}
-- 
GitLab