aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmath')
-rw-r--r--linden/indra/llmath/llmath.vcproj12
-rw-r--r--linden/indra/llmath/llmath_vc8.vcproj16
-rw-r--r--linden/indra/llmath/llv4math.h121
-rw-r--r--linden/indra/llmath/llv4matrix3.h222
-rw-r--r--linden/indra/llmath/llv4matrix4.h251
-rw-r--r--linden/indra/llmath/llv4vector3.h82
6 files changed, 0 insertions, 704 deletions
diff --git a/linden/indra/llmath/llmath.vcproj b/linden/indra/llmath/llmath.vcproj
index bdc8ded..4876065 100644
--- a/linden/indra/llmath/llmath.vcproj
+++ b/linden/indra/llmath/llmath.vcproj
@@ -272,18 +272,6 @@
272 RelativePath=".\lluuid.h"> 272 RelativePath=".\lluuid.h">
273 </File> 273 </File>
274 <File 274 <File
275 RelativePath=".\llv4math.h">
276 </File>
277 <File
278 RelativePath=".\llv4matrix3.h">
279 </File>
280 <File
281 RelativePath=".\llv4matrix4.h">
282 </File>
283 <File
284 RelativePath=".\llv4vector3.h">
285 </File>
286 <File
287 RelativePath=".\llvolume.h"> 275 RelativePath=".\llvolume.h">
288 </File> 276 </File>
289 <File 277 <File
diff --git a/linden/indra/llmath/llmath_vc8.vcproj b/linden/indra/llmath/llmath_vc8.vcproj
index 03d75c3..ea23702 100644
--- a/linden/indra/llmath/llmath_vc8.vcproj
+++ b/linden/indra/llmath/llmath_vc8.vcproj
@@ -389,22 +389,6 @@
389 > 389 >
390 </File> 390 </File>
391 <File 391 <File
392 RelativePath=".\llv4math.h"
393 >
394 </File>
395 <File
396 RelativePath=".\llv4matrix3.h"
397 >
398 </File>
399 <File
400 RelativePath=".\llv4matrix4.h"
401 >
402 </File>
403 <File
404 RelativePath=".\llv4vector3.h"
405 >
406 </File>
407 <File
408 RelativePath=".\llvolume.h" 392 RelativePath=".\llvolume.h"
409 > 393 >
410 </File> 394 </File>
diff --git a/linden/indra/llmath/llv4math.h b/linden/indra/llmath/llv4math.h
deleted file mode 100644
index d0b956b..0000000
--- a/linden/indra/llmath/llv4math.h
+++ /dev/null
@@ -1,121 +0,0 @@
1/**
2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math
4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLV4MATH_H
30#define LL_LLV4MATH_H
31
32//-----------------------------------------------------------------------------
33//-----------------------------------------------------------------------------
34// LLV4MATH - GNUC
35//-----------------------------------------------------------------------------
36//-----------------------------------------------------------------------------
37
38#if LL_GNUC && __GNUC__ >= 4 && __SSE__
39
40#define LL_VECTORIZE 1
41
42#if LL_DARWIN
43
44#include <Accelerate/Accelerate.h>
45#include <xmmintrin.h>
46typedef vFloat V4F32;
47
48#else
49
50#include <xmmintrin.h>
51typedef float V4F32 __attribute__((vector_size(16)));
52
53#endif
54
55#endif
56#if LL_GNUC
57
58#define LL_LLV4MATH_ALIGN_PREFIX
59#define LL_LLV4MATH_ALIGN_POSTFIX __attribute__((aligned(16)))
60
61#endif
62
63//-----------------------------------------------------------------------------
64//-----------------------------------------------------------------------------
65// LLV4MATH - MSVC
66//-----------------------------------------------------------------------------
67//-----------------------------------------------------------------------------
68
69#if LL_MSVC && _M_IX86_FP
70
71#define LL_VECTORIZE 1
72
73#include <xmmintrin.h>
74
75typedef __m128 V4F32;
76
77#endif
78#if LL_MSVC
79
80#define LL_LLV4MATH_ALIGN_PREFIX __declspec(align(16))
81#define LL_LLV4MATH_ALIGN_POSTFIX
82
83#endif
84
85//-----------------------------------------------------------------------------
86//-----------------------------------------------------------------------------
87// LLV4MATH - default - no vectorization
88//-----------------------------------------------------------------------------
89//-----------------------------------------------------------------------------
90
91#if !LL_VECTORIZE
92
93#define LL_VECTORIZE 0
94
95struct V4F32 { F32 __pad__[4]; };
96
97inline F32 llv4lerp(F32 a, F32 b, F32 w) { return ( b - a ) * w + a; }
98
99#endif
100
101#ifndef LL_LLV4MATH_ALIGN_PREFIX
102# define LL_LLV4MATH_ALIGN_PREFIX
103#endif
104#ifndef LL_LLV4MATH_ALIGN_POSTFIX
105# define LL_LLV4MATH_ALIGN_POSTFIX
106#endif
107
108//-----------------------------------------------------------------------------
109//-----------------------------------------------------------------------------
110// LLV4MATH
111//-----------------------------------------------------------------------------
112//-----------------------------------------------------------------------------
113
114
115#define LLV4_NUM_AXIS 4
116
117class LLV4Vector3;
118class LLV4Matrix3;
119class LLV4Matrix4;
120
121#endif
diff --git a/linden/indra/llmath/llv4matrix3.h b/linden/indra/llmath/llv4matrix3.h
deleted file mode 100644
index 0811338..0000000
--- a/linden/indra/llmath/llv4matrix3.h
+++ /dev/null
@@ -1,222 +0,0 @@
1/**
2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math
4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLV4MATRIX3_H
30#define LL_LLV4MATRIX3_H
31
32#include "llv4math.h"
33#include "llv4vector3.h"
34#include "m3math.h" // for operator LLMatrix3()
35
36//-----------------------------------------------------------------------------
37//-----------------------------------------------------------------------------
38// LLV4Matrix3
39//-----------------------------------------------------------------------------
40//-----------------------------------------------------------------------------
41
42LL_LLV4MATH_ALIGN_PREFIX
43
44class LLV4Matrix3
45{
46public:
47 union {
48 F32 mMatrix[LLV4_NUM_AXIS][LLV4_NUM_AXIS];
49 V4F32 mV[LLV4_NUM_AXIS];
50 };
51
52 void lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w);
53 void multiply(const LLVector3 &a, LLVector3& out) const;
54 void multiply(const LLVector4 &a, LLV4Vector3& out) const;
55 void multiply(const LLVector3 &a, LLV4Vector3& out) const;
56
57 const LLV4Matrix3& transpose();
58 const LLV4Matrix3& operator=(const LLMatrix3& a);
59
60 operator LLMatrix3() const { return (reinterpret_cast<const LLMatrix4*>(const_cast<const F32*>(&mMatrix[0][0])))->getMat3(); }
61
62 friend LLVector3 operator*(const LLVector3& a, const LLV4Matrix3& b);
63}
64
65LL_LLV4MATH_ALIGN_POSTFIX;
66
67
68
69//-----------------------------------------------------------------------------
70//-----------------------------------------------------------------------------
71// LLV4Matrix3 - SSE
72//-----------------------------------------------------------------------------
73//-----------------------------------------------------------------------------
74
75#if LL_VECTORIZE
76
77inline void LLV4Matrix3::lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w)
78{
79 __m128 vw = _mm_set1_ps(w);
80 mV[VX] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VX], a.mV[VX]), vw), a.mV[VX]); // ( b - a ) * w + a
81 mV[VY] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VY], a.mV[VY]), vw), a.mV[VY]);
82 mV[VZ] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VZ], a.mV[VZ]), vw), a.mV[VZ]);
83}
84
85inline void LLV4Matrix3::multiply(const LLVector3 &a, LLVector3& o) const
86{
87 LLV4Vector3 j;
88 j.v = _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
89 j.v = _mm_add_ps(j.v , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
90 j.v = _mm_add_ps(j.v , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
91 o.setVec(j.mV);
92}
93
94inline void LLV4Matrix3::multiply(const LLVector4 &a, LLV4Vector3& o) const
95{
96 o.v = _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
97 o.v = _mm_add_ps(o.v , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
98 o.v = _mm_add_ps(o.v , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
99}
100
101inline void LLV4Matrix3::multiply(const LLVector3 &a, LLV4Vector3& o) const
102{
103 o.v = _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX]); // ( ax * vx ) + ...
104 o.v = _mm_add_ps(o.v , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
105 o.v = _mm_add_ps(o.v , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
106}
107
108//-----------------------------------------------------------------------------
109//-----------------------------------------------------------------------------
110// LLV4Matrix3
111//-----------------------------------------------------------------------------
112//-----------------------------------------------------------------------------
113
114#else
115
116inline void LLV4Matrix3::lerp(const LLV4Matrix3 &a, const LLV4Matrix3 &b, const F32 &w)
117{
118 mMatrix[VX][VX] = llv4lerp(a.mMatrix[VX][VX], b.mMatrix[VX][VX], w);
119 mMatrix[VX][VY] = llv4lerp(a.mMatrix[VX][VY], b.mMatrix[VX][VY], w);
120 mMatrix[VX][VZ] = llv4lerp(a.mMatrix[VX][VZ], b.mMatrix[VX][VZ], w);
121
122 mMatrix[VY][VX] = llv4lerp(a.mMatrix[VY][VX], b.mMatrix[VY][VX], w);
123 mMatrix[VY][VY] = llv4lerp(a.mMatrix[VY][VY], b.mMatrix[VY][VY], w);
124 mMatrix[VY][VZ] = llv4lerp(a.mMatrix[VY][VZ], b.mMatrix[VY][VZ], w);
125
126 mMatrix[VZ][VX] = llv4lerp(a.mMatrix[VZ][VX], b.mMatrix[VZ][VX], w);
127 mMatrix[VZ][VY] = llv4lerp(a.mMatrix[VZ][VY], b.mMatrix[VZ][VY], w);
128 mMatrix[VZ][VZ] = llv4lerp(a.mMatrix[VZ][VZ], b.mMatrix[VZ][VZ], w);
129}
130
131inline void LLV4Matrix3::multiply(const LLVector3 &a, LLVector3& o) const
132{
133 o.setVec( a.mV[VX] * mMatrix[VX][VX] +
134 a.mV[VY] * mMatrix[VY][VX] +
135 a.mV[VZ] * mMatrix[VZ][VX],
136
137 a.mV[VX] * mMatrix[VX][VY] +
138 a.mV[VY] * mMatrix[VY][VY] +
139 a.mV[VZ] * mMatrix[VZ][VY],
140
141 a.mV[VX] * mMatrix[VX][VZ] +
142 a.mV[VY] * mMatrix[VY][VZ] +
143 a.mV[VZ] * mMatrix[VZ][VZ]);
144}
145
146inline void LLV4Matrix3::multiply(const LLVector4 &a, LLV4Vector3& o) const
147{
148 o.setVec( a.mV[VX] * mMatrix[VX][VX] +
149 a.mV[VY] * mMatrix[VY][VX] +
150 a.mV[VZ] * mMatrix[VZ][VX],
151
152 a.mV[VX] * mMatrix[VX][VY] +
153 a.mV[VY] * mMatrix[VY][VY] +
154 a.mV[VZ] * mMatrix[VZ][VY],
155
156 a.mV[VX] * mMatrix[VX][VZ] +
157 a.mV[VY] * mMatrix[VY][VZ] +
158 a.mV[VZ] * mMatrix[VZ][VZ]);
159}
160
161inline void LLV4Matrix3::multiply(const LLVector3 &a, LLV4Vector3& o) const
162{
163 o.setVec( a.mV[VX] * mMatrix[VX][VX] +
164 a.mV[VY] * mMatrix[VY][VX] +
165 a.mV[VZ] * mMatrix[VZ][VX],
166
167 a.mV[VX] * mMatrix[VX][VY] +
168 a.mV[VY] * mMatrix[VY][VY] +
169 a.mV[VZ] * mMatrix[VZ][VY],
170
171 a.mV[VX] * mMatrix[VX][VZ] +
172 a.mV[VY] * mMatrix[VY][VZ] +
173 a.mV[VZ] * mMatrix[VZ][VZ]);
174}
175
176//-----------------------------------------------------------------------------
177//-----------------------------------------------------------------------------
178// LLV4Matrix3
179//-----------------------------------------------------------------------------
180//-----------------------------------------------------------------------------
181
182#endif
183
184inline const LLV4Matrix3& LLV4Matrix3::transpose()
185{
186#if LL_VECTORIZE && defined(_MM_TRANSPOSE4_PS)
187 _MM_TRANSPOSE4_PS(mV[VX], mV[VY], mV[VZ], mV[VW]);
188 return *this;
189#else
190 F32 temp;
191 temp = mMatrix[VX][VY]; mMatrix[VX][VY] = mMatrix[VY][VX]; mMatrix[VY][VX] = temp;
192 temp = mMatrix[VX][VZ]; mMatrix[VX][VZ] = mMatrix[VZ][VX]; mMatrix[VZ][VX] = temp;
193 temp = mMatrix[VY][VZ]; mMatrix[VY][VZ] = mMatrix[VZ][VY]; mMatrix[VZ][VY] = temp;
194#endif
195 return *this;
196}
197
198inline const LLV4Matrix3& LLV4Matrix3::operator=(const LLMatrix3& a)
199{
200 memcpy(mMatrix[VX], a.mMatrix[VX], sizeof(F32) * 3 );
201 memcpy(mMatrix[VY], a.mMatrix[VY], sizeof(F32) * 3 );
202 memcpy(mMatrix[VZ], a.mMatrix[VZ], sizeof(F32) * 3 );
203 return *this;
204}
205
206inline LLVector3 operator*(const LLVector3& a, const LLV4Matrix3& b)
207{
208 return LLVector3(
209 a.mV[VX] * b.mMatrix[VX][VX] +
210 a.mV[VY] * b.mMatrix[VY][VX] +
211 a.mV[VZ] * b.mMatrix[VZ][VX],
212
213 a.mV[VX] * b.mMatrix[VX][VY] +
214 a.mV[VY] * b.mMatrix[VY][VY] +
215 a.mV[VZ] * b.mMatrix[VZ][VY],
216
217 a.mV[VX] * b.mMatrix[VX][VZ] +
218 a.mV[VY] * b.mMatrix[VY][VZ] +
219 a.mV[VZ] * b.mMatrix[VZ][VZ] );
220}
221
222#endif
diff --git a/linden/indra/llmath/llv4matrix4.h b/linden/indra/llmath/llv4matrix4.h
deleted file mode 100644
index 38280a2..0000000
--- a/linden/indra/llmath/llv4matrix4.h
+++ /dev/null
@@ -1,251 +0,0 @@
1/**
2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math
4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLV4MATRIX4_H
30#define LL_LLV4MATRIX4_H
31
32#include "llv4math.h"
33#include "llv4matrix3.h" // just for operator LLV4Matrix3()
34#include "llv4vector3.h"
35
36//-----------------------------------------------------------------------------
37//-----------------------------------------------------------------------------
38// LLV4Matrix4
39//-----------------------------------------------------------------------------
40//-----------------------------------------------------------------------------
41
42LL_LLV4MATH_ALIGN_PREFIX
43
44class LLV4Matrix4
45{
46public:
47 union {
48 F32 mMatrix[LLV4_NUM_AXIS][LLV4_NUM_AXIS];
49 V4F32 mV[LLV4_NUM_AXIS];
50 };
51
52 void lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w);
53 void multiply(const LLVector3 &a, LLVector3& o) const;
54 void multiply(const LLVector3 &a, LLV4Vector3& o) const;
55
56 const LLV4Matrix4& transpose();
57 const LLV4Matrix4& translate(const LLVector3 &vec);
58 const LLV4Matrix4& translate(const LLV4Vector3 &vec);
59 const LLV4Matrix4& operator=(const LLMatrix4& a);
60
61 operator LLMatrix4() const { return *(reinterpret_cast<const LLMatrix4*>(const_cast<const F32*>(&mMatrix[0][0]))); }
62 operator LLV4Matrix3() const { return *(reinterpret_cast<const LLV4Matrix3*>(const_cast<const F32*>(&mMatrix[0][0]))); }
63
64 friend LLVector3 operator*(const LLVector3 &a, const LLV4Matrix4 &b);
65}
66
67LL_LLV4MATH_ALIGN_POSTFIX;
68
69//-----------------------------------------------------------------------------
70//-----------------------------------------------------------------------------
71// LLV4Matrix4 - SSE
72//-----------------------------------------------------------------------------
73//-----------------------------------------------------------------------------
74
75#if LL_VECTORIZE
76
77inline void LLV4Matrix4::lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w)
78{
79 __m128 vw = _mm_set1_ps(w);
80 mV[VX] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VX], a.mV[VX]), vw), a.mV[VX]); // ( b - a ) * w + a
81 mV[VY] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VY], a.mV[VY]), vw), a.mV[VY]);
82 mV[VZ] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VZ], a.mV[VZ]), vw), a.mV[VZ]);
83 mV[VW] = _mm_add_ps(_mm_mul_ps(_mm_sub_ps(b.mV[VW], a.mV[VW]), vw), a.mV[VW]);
84}
85
86inline void LLV4Matrix4::multiply(const LLVector3 &a, LLVector3& o) const
87{
88 LLV4Vector3 j;
89 j.v = _mm_add_ps(mV[VW], _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX])); // ( ax * vx ) + vw
90 j.v = _mm_add_ps(j.v , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
91 j.v = _mm_add_ps(j.v , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
92 o.setVec(j.mV);
93}
94
95inline void LLV4Matrix4::multiply(const LLVector3 &a, LLV4Vector3& o) const
96{
97 o.v = _mm_add_ps(mV[VW], _mm_mul_ps(_mm_set1_ps(a.mV[VX]), mV[VX])); // ( ax * vx ) + vw
98 o.v = _mm_add_ps(o.v , _mm_mul_ps(_mm_set1_ps(a.mV[VY]), mV[VY]));
99 o.v = _mm_add_ps(o.v , _mm_mul_ps(_mm_set1_ps(a.mV[VZ]), mV[VZ]));
100}
101
102inline const LLV4Matrix4& LLV4Matrix4::translate(const LLV4Vector3 &vec)
103{
104 mV[VW] = _mm_add_ps(mV[VW], vec.v);
105 return (*this);
106}
107
108//-----------------------------------------------------------------------------
109//-----------------------------------------------------------------------------
110// LLV4Matrix4
111//-----------------------------------------------------------------------------
112//-----------------------------------------------------------------------------
113
114#else
115
116inline void LLV4Matrix4::lerp(const LLV4Matrix4 &a, const LLV4Matrix4 &b, const F32 &w)
117{
118 mMatrix[VX][VX] = llv4lerp(a.mMatrix[VX][VX], b.mMatrix[VX][VX], w);
119 mMatrix[VX][VY] = llv4lerp(a.mMatrix[VX][VY], b.mMatrix[VX][VY], w);
120 mMatrix[VX][VZ] = llv4lerp(a.mMatrix[VX][VZ], b.mMatrix[VX][VZ], w);
121
122 mMatrix[VY][VX] = llv4lerp(a.mMatrix[VY][VX], b.mMatrix[VY][VX], w);
123 mMatrix[VY][VY] = llv4lerp(a.mMatrix[VY][VY], b.mMatrix[VY][VY], w);
124 mMatrix[VY][VZ] = llv4lerp(a.mMatrix[VY][VZ], b.mMatrix[VY][VZ], w);
125
126 mMatrix[VZ][VX] = llv4lerp(a.mMatrix[VZ][VX], b.mMatrix[VZ][VX], w);
127 mMatrix[VZ][VY] = llv4lerp(a.mMatrix[VZ][VY], b.mMatrix[VZ][VY], w);
128 mMatrix[VZ][VZ] = llv4lerp(a.mMatrix[VZ][VZ], b.mMatrix[VZ][VZ], w);
129
130 mMatrix[VW][VX] = llv4lerp(a.mMatrix[VW][VX], b.mMatrix[VW][VX], w);
131 mMatrix[VW][VY] = llv4lerp(a.mMatrix[VW][VY], b.mMatrix[VW][VY], w);
132 mMatrix[VW][VZ] = llv4lerp(a.mMatrix[VW][VZ], b.mMatrix[VW][VZ], w);
133}
134
135inline void LLV4Matrix4::multiply(const LLVector3 &a, LLVector3& o) const
136{
137 o.setVec( a.mV[VX] * mMatrix[VX][VX] +
138 a.mV[VY] * mMatrix[VY][VX] +
139 a.mV[VZ] * mMatrix[VZ][VX] +
140 mMatrix[VW][VX],
141
142 a.mV[VX] * mMatrix[VX][VY] +
143 a.mV[VY] * mMatrix[VY][VY] +
144 a.mV[VZ] * mMatrix[VZ][VY] +
145 mMatrix[VW][VY],
146
147 a.mV[VX] * mMatrix[VX][VZ] +
148 a.mV[VY] * mMatrix[VY][VZ] +
149 a.mV[VZ] * mMatrix[VZ][VZ] +
150 mMatrix[VW][VZ]);
151}
152
153inline void LLV4Matrix4::multiply(const LLVector3 &a, LLV4Vector3& o) const
154{
155 o.setVec( a.mV[VX] * mMatrix[VX][VX] +
156 a.mV[VY] * mMatrix[VY][VX] +
157 a.mV[VZ] * mMatrix[VZ][VX] +
158 mMatrix[VW][VX],
159
160 a.mV[VX] * mMatrix[VX][VY] +
161 a.mV[VY] * mMatrix[VY][VY] +
162 a.mV[VZ] * mMatrix[VZ][VY] +
163 mMatrix[VW][VY],
164
165 a.mV[VX] * mMatrix[VX][VZ] +
166 a.mV[VY] * mMatrix[VY][VZ] +
167 a.mV[VZ] * mMatrix[VZ][VZ] +
168 mMatrix[VW][VZ]);
169}
170
171inline const LLV4Matrix4& LLV4Matrix4::translate(const LLV4Vector3 &vec)
172{
173 mMatrix[3][0] += vec.mV[0];
174 mMatrix[3][1] += vec.mV[1];
175 mMatrix[3][2] += vec.mV[2];
176 return (*this);
177}
178
179//-----------------------------------------------------------------------------
180//-----------------------------------------------------------------------------
181// LLV4Matrix4
182//-----------------------------------------------------------------------------
183//-----------------------------------------------------------------------------
184
185#endif
186
187inline const LLV4Matrix4& LLV4Matrix4::operator=(const LLMatrix4& a)
188{
189 memcpy(mMatrix, a.mMatrix, sizeof(F32) * 16 );
190 return *this;
191}
192
193inline const LLV4Matrix4& LLV4Matrix4::transpose()
194{
195#if LL_VECTORIZE && defined(_MM_TRANSPOSE4_PS)
196 _MM_TRANSPOSE4_PS(mV[VX], mV[VY], mV[VZ], mV[VW]);
197#else
198 LLV4Matrix4 mat;
199 mat.mMatrix[0][0] = mMatrix[0][0];
200 mat.mMatrix[1][0] = mMatrix[0][1];
201 mat.mMatrix[2][0] = mMatrix[0][2];
202 mat.mMatrix[3][0] = mMatrix[0][3];
203
204 mat.mMatrix[0][1] = mMatrix[1][0];
205 mat.mMatrix[1][1] = mMatrix[1][1];
206 mat.mMatrix[2][1] = mMatrix[1][2];
207 mat.mMatrix[3][1] = mMatrix[1][3];
208
209 mat.mMatrix[0][2] = mMatrix[2][0];
210 mat.mMatrix[1][2] = mMatrix[2][1];
211 mat.mMatrix[2][2] = mMatrix[2][2];
212 mat.mMatrix[3][2] = mMatrix[2][3];
213
214 mat.mMatrix[0][3] = mMatrix[3][0];
215 mat.mMatrix[1][3] = mMatrix[3][1];
216 mat.mMatrix[2][3] = mMatrix[3][2];
217 mat.mMatrix[3][3] = mMatrix[3][3];
218
219 *this = mat;
220#endif
221 return *this;
222}
223
224inline const LLV4Matrix4& LLV4Matrix4::translate(const LLVector3 &vec)
225{
226 mMatrix[3][0] += vec.mV[0];
227 mMatrix[3][1] += vec.mV[1];
228 mMatrix[3][2] += vec.mV[2];
229 return (*this);
230}
231
232inline LLVector3 operator*(const LLVector3 &a, const LLV4Matrix4 &b)
233{
234 return LLVector3(a.mV[VX] * b.mMatrix[VX][VX] +
235 a.mV[VY] * b.mMatrix[VY][VX] +
236 a.mV[VZ] * b.mMatrix[VZ][VX] +
237 b.mMatrix[VW][VX],
238
239 a.mV[VX] * b.mMatrix[VX][VY] +
240 a.mV[VY] * b.mMatrix[VY][VY] +
241 a.mV[VZ] * b.mMatrix[VZ][VY] +
242 b.mMatrix[VW][VY],
243
244 a.mV[VX] * b.mMatrix[VX][VZ] +
245 a.mV[VY] * b.mMatrix[VY][VZ] +
246 a.mV[VZ] * b.mMatrix[VZ][VZ] +
247 b.mMatrix[VW][VZ]);
248}
249
250
251#endif
diff --git a/linden/indra/llmath/llv4vector3.h b/linden/indra/llmath/llv4vector3.h
deleted file mode 100644
index 994e7f5..0000000
--- a/linden/indra/llmath/llv4vector3.h
+++ /dev/null
@@ -1,82 +0,0 @@
1/**
2 * @file llviewerjointmesh.cpp
3 * @brief LLV4* class header file - vector processor enabled math
4 *
5 * Copyright (c) 2007-2007, Linden Research, Inc.
6 *
7 * Second Life Viewer Source Code
8 * The source code in this file ("Source Code") is provided by Linden Lab
9 * to you under the terms of the GNU General Public License, version 2.0
10 * ("GPL"), unless you have obtained a separate licensing agreement
11 * ("Other License"), formally executed by you and Linden Lab. Terms of
12 * the GPL can be found in doc/GPL-license.txt in this distribution, or
13 * online at http://secondlife.com/developers/opensource/gplv2
14 *
15 * There are special exceptions to the terms and conditions of the GPL as
16 * it is applied to this Source Code. View the full text of the exception
17 * in the file doc/FLOSS-exception.txt in this software distribution, or
18 * online at http://secondlife.com/developers/opensource/flossexception
19 *
20 * By copying, modifying or distributing this software, you acknowledge
21 * that you have read and understood your obligations described above,
22 * and agree to abide by those obligations.
23 *
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE.
27 */
28
29#ifndef LL_LLV4VECTOR3_H
30#define LL_LLV4VECTOR3_H
31
32#include "llv4math.h"
33
34//-----------------------------------------------------------------------------
35//-----------------------------------------------------------------------------
36// LLV4Vector3
37//-----------------------------------------------------------------------------
38//-----------------------------------------------------------------------------
39
40LL_LLV4MATH_ALIGN_PREFIX
41
42class LLV4Vector3
43{
44public:
45 union {
46 F32 mV[LLV4_NUM_AXIS];
47 V4F32 v;
48 };
49
50 enum {
51 ALIGNMENT = 16
52 };
53
54 void setVec(F32 x, F32 y, F32 z);
55 void setVec(F32 a);
56}
57
58LL_LLV4MATH_ALIGN_POSTFIX;
59
60//-----------------------------------------------------------------------------
61//-----------------------------------------------------------------------------
62// LLV4Vector3
63//-----------------------------------------------------------------------------
64//-----------------------------------------------------------------------------
65
66inline void LLV4Vector3::setVec(F32 x, F32 y, F32 z)
67{
68 mV[VX] = x;
69 mV[VY] = y;
70 mV[VZ] = z;
71}
72
73inline void LLV4Vector3::setVec(F32 a)
74{
75#if LL_VECTORIZE
76 v = _mm_set1_ps(a);
77#else
78 setVec(a, a, a);
79#endif
80}
81
82#endif