summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2007-07-02 23:52:40 +0000
committerJames Cook <james@lindenlab.com>2007-07-02 23:52:40 +0000
commit1a33bc19b4ce94ab210749911dff14409b4454dd (patch)
treeb674d97d37240a29c0a6671adfe950a506ef0ea4 /indra/llcommon
parente5124431b54d4342d4677371fccca5bc7250c079 (diff)
svn merge -r 62595:62596 and 62598:63308 sse-skinning-3 for faster software avatar rendering. Visual Studio 2005 project file fixed pending.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llpreprocessor.h22
-rw-r--r--indra/llcommon/llprocessor.cpp8
-rw-r--r--indra/llcommon/llprocessor.h1
-rw-r--r--indra/llcommon/llskiplist.h12
-rw-r--r--indra/llcommon/llsys.cpp25
-rw-r--r--indra/llcommon/llsys.h12
6 files changed, 57 insertions, 23 deletions
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 0882472242..4389fd3e30 100644
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -51,12 +51,22 @@
#define MOZILLA_INTERNAL_API 1
#endif
-// Deal with minor differences on Unixy OSes.
-#if LL_DARWIN || LL_LINUX
+// Figure out differences between compilers
+#if defined(__GNUC__)
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
+ #ifndef LL_GNUC
+ #define LL_GNUC 1
+ #endif
+#elif defined(__MSVC_VER__) || defined(_MSC_VER)
+ #ifndef LL_MSVC
+ #define LL_MSVC 1
+ #endif
+#endif
+// Deal with minor differences on Unixy OSes.
+#if LL_DARWIN || LL_LINUX
// Different name, same functionality.
#define stricmp strcasecmp
#define strnicmp strncasecmp
@@ -69,9 +79,9 @@
#endif
// Deal with the differeneces on Windows
-#if LL_WINDOWS
+#if LL_MSVC
#define snprintf safe_snprintf /* Flawfinder: ignore */
-#endif // LL_WINDOWS
+#endif // LL_MSVC
// Static linking with apr on windows needs to be declared.
#ifdef LL_WINDOWS
@@ -90,7 +100,7 @@
// Deal with VC6 problems
-#if defined(LL_WINDOWS)
+#if LL_MSVC
#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
@@ -101,6 +111,6 @@
#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
#pragma warning( disable : 4996 ) // warning: deprecated
-#endif // LL_WINDOWS
+#endif // LL_MSVC
#endif // not LL_LINDEN_PREPROCESSOR_H
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 00f4a13c39..bcabb47a66 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -1518,6 +1518,7 @@ void CProcessor::GetStandardProcessorExtensions()
CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = CheckBit(edxreg, 24);
CPUInfo._Ext.SSE_StreamingSIMD_Extensions = CheckBit(edxreg, 25);
CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = CheckBit(edxreg, 26);
+ CPUInfo._Ext.Altivec_Extensions = false;
CPUInfo._Ext.SS_SelfSnoop = CheckBit(edxreg, 27);
CPUInfo._Ext.HT_HyperThreading = CheckBit(edxreg, 28);
CPUInfo._Ext.HT_HyterThreadingSiblings = (ebxreg >> 16) & 0xFF;
@@ -1871,11 +1872,12 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
break;
}
- // It's kinda like MMX or SSE...
CPUInfo._Ext.EMMX_MultimediaExtensions =
CPUInfo._Ext.MMX_MultimediaExtensions =
CPUInfo._Ext.SSE_StreamingSIMD_Extensions =
- CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.altivec");
+ CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = false;
+
+ CPUInfo._Ext.Altivec_Extensions = hasFeature("hw.optional.altivec");
#endif
@@ -1892,6 +1894,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
CPUInfo._Ext.MMX_MultimediaExtensions = hasFeature("hw.optional.mmx");
CPUInfo._Ext.SSE_StreamingSIMD_Extensions = hasFeature("hw.optional.sse");
CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.sse2");
+ CPUInfo._Ext.Altivec_Extensions = false;
CPUInfo._Ext.AA64_AMD64BitArchitecture = hasFeature("hw.optional.x86_64");
#endif
@@ -2045,6 +2048,7 @@ bool CProcessor::CPUInfoToText(char *strBuffer, unsigned int uiMaxLen)
BOOLADD("SS Self Snoop: ", CPUInfo._Ext.SS_SelfSnoop);
BOOLADD("SSE Streaming SIMD Extensions: ", CPUInfo._Ext.SSE_StreamingSIMD_Extensions);
BOOLADD("SSE2 Streaming SIMD 2 Extensions: ", CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions);
+ BOOLADD("ALTVEC Altivec Extensions: ", CPUInfo._Ext.Altivec_Extensions);
BOOLADD("TM Thermal Monitor: ", CPUInfo._Ext.TM_ThermalMonitor);
BOOLADD("TSC Time Stamp Counter: ", CPUInfo._Ext.TSC_TimeStampCounter);
BOOLADD("VME Virtual 8086 Mode Enhancements: ", CPUInfo._Ext.VME_Virtual8086ModeEnhancements);
diff --git a/indra/llcommon/llprocessor.h b/indra/llcommon/llprocessor.h
index 8453263f9d..9060e8aa95 100644
--- a/indra/llcommon/llprocessor.h
+++ b/indra/llcommon/llprocessor.h
@@ -51,6 +51,7 @@ typedef struct ProcessorExtensions
bool FXSR_FastStreamingSIMD_ExtensionsSaveRestore;
bool SSE_StreamingSIMD_Extensions;
bool SSE2_StreamingSIMD2_Extensions;
+ bool Altivec_Extensions;
bool SS_SelfSnoop;
bool HT_HyperThreading;
unsigned int HT_HyterThreadingSiblings;
diff --git a/indra/llcommon/llskiplist.h b/indra/llcommon/llskiplist.h
index ed1aa1f0aa..4676fb8f18 100644
--- a/indra/llcommon/llskiplist.h
+++ b/indra/llcommon/llskiplist.h
@@ -8,11 +8,10 @@
#ifndef LL_LLSKIPLIST_H
#define LL_LLSKIPLIST_H
-#include "llerror.h"
-//#include "vmath.h"
+#include "llrand.h"
// NOTA BENE: Insert first needs to be < NOT <=
-
+// Binary depth must be >= 2
template <class DATA_TYPE, S32 BINARY_DEPTH = 10>
class LLSkipList
{
@@ -124,14 +123,11 @@ private:
// Implementation
//
+
+// Binary depth must be >= 2
template <class DATA_TYPE, S32 BINARY_DEPTH>
inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init()
{
- if (BINARY_DEPTH < 2)
- {
- llerrs << "Trying to create skip list with too little depth, "
- "must be 2 or greater" << llendl;
- }
S32 i;
for (i = 0; i < BINARY_DEPTH; i++)
{
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 6f0bda4b71..90cc374ade 100644
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -284,12 +284,33 @@ LLCPUInfo::LLCPUInfo()
{
CProcessor proc;
const ProcessorInfo* info = proc.GetCPUInfo();
- mHasSSE = (info->_Ext.SSE_StreamingSIMD_Extensions != 0);
- mHasSSE2 = (info->_Ext.SSE2_StreamingSIMD2_Extensions != 0);
+ // proc.WriteInfoTextFile("procInfo.txt");
+ mHasSSE = info->_Ext.SSE_StreamingSIMD_Extensions;
+ mHasSSE2 = info->_Ext.SSE2_StreamingSIMD2_Extensions;
+ mHasAltivec = info->_Ext.Altivec_Extensions;
mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0);
mFamily.assign( info->strFamily );
}
+bool LLCPUInfo::hasAltivec() const
+{
+ return mHasAltivec;
+}
+
+bool LLCPUInfo::hasSSE() const
+{
+ return mHasSSE;
+}
+
+bool LLCPUInfo::hasSSE2() const
+{
+ return mHasSSE2;
+}
+
+S32 LLCPUInfo::getMhz() const
+{
+ return mCPUMhz;
+}
std::string LLCPUInfo::getCPUString() const
{
diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h
index 7808a97b80..4b6fbe149b 100644
--- a/indra/llcommon/llsys.h
+++ b/indra/llcommon/llsys.h
@@ -52,16 +52,18 @@ public:
std::string getCPUString() const;
- BOOL hasSSE() const { return mHasSSE; }
- BOOL hasSSE2() const { return mHasSSE2; }
- S32 getMhz() const { return mCPUMhz; }
+ bool hasAltivec() const;
+ bool hasSSE() const;
+ bool hasSSE2() const;
+ S32 getMhz() const;
// Family is "AMD Duron" or "Intel Pentium Pro"
const std::string& getFamily() const { return mFamily; }
private:
- BOOL mHasSSE;
- BOOL mHasSSE2;
+ bool mHasSSE;
+ bool mHasSSE2;
+ bool mHasAltivec;
S32 mCPUMhz;
std::string mFamily;
};