aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r--linden/indra/llcommon/llenum.h2
-rw-r--r--linden/indra/llcommon/llpreprocessor.h22
-rw-r--r--linden/indra/llcommon/llprocessor.cpp8
-rw-r--r--linden/indra/llcommon/llprocessor.h1
-rw-r--r--linden/indra/llcommon/llskiplist.h12
-rw-r--r--linden/indra/llcommon/llsys.cpp25
-rw-r--r--linden/indra/llcommon/llsys.h12
-rw-r--r--linden/indra/llcommon/llversion.h2
-rw-r--r--linden/indra/llcommon/metaclass.cpp3
-rw-r--r--linden/indra/llcommon/metaproperty.cpp3
-rw-r--r--linden/indra/llcommon/reflective.cpp2
11 files changed, 67 insertions, 25 deletions
diff --git a/linden/indra/llcommon/llenum.h b/linden/indra/llcommon/llenum.h
index 310ccd2..3e75a22 100644
--- a/linden/indra/llcommon/llenum.h
+++ b/linden/indra/llcommon/llenum.h
@@ -52,7 +52,7 @@ public:
52 } 52 }
53 } 53 }
54 54
55 const U32 operator[](std::string str) 55 U32 operator[](std::string str)
56 { 56 {
57 std::map<const std::string, const U32>::iterator itor; 57 std::map<const std::string, const U32>::iterator itor;
58 itor = mEnumMap.find(str); 58 itor = mEnumMap.find(str);
diff --git a/linden/indra/llcommon/llpreprocessor.h b/linden/indra/llcommon/llpreprocessor.h
index 495b9e8..76145c5 100644
--- a/linden/indra/llcommon/llpreprocessor.h
+++ b/linden/indra/llcommon/llpreprocessor.h
@@ -71,12 +71,22 @@
71 #define MOZILLA_INTERNAL_API 1 71 #define MOZILLA_INTERNAL_API 1
72#endif 72#endif
73 73
74// Deal with minor differences on Unixy OSes. 74// Figure out differences between compilers
75#if LL_DARWIN || LL_LINUX 75#if defined(__GNUC__)
76 #define GCC_VERSION (__GNUC__ * 10000 \ 76 #define GCC_VERSION (__GNUC__ * 10000 \
77 + __GNUC_MINOR__ * 100 \ 77 + __GNUC_MINOR__ * 100 \
78 + __GNUC_PATCHLEVEL__) 78 + __GNUC_PATCHLEVEL__)
79 #ifndef LL_GNUC
80 #define LL_GNUC 1
81 #endif
82#elif defined(__MSVC_VER__) || defined(_MSC_VER)
83 #ifndef LL_MSVC
84 #define LL_MSVC 1
85 #endif
86#endif
79 87
88// Deal with minor differences on Unixy OSes.
89#if LL_DARWIN || LL_LINUX
80 // Different name, same functionality. 90 // Different name, same functionality.
81 #define stricmp strcasecmp 91 #define stricmp strcasecmp
82 #define strnicmp strncasecmp 92 #define strnicmp strncasecmp
@@ -89,9 +99,9 @@
89#endif 99#endif
90 100
91// Deal with the differeneces on Windows 101// Deal with the differeneces on Windows
92#if LL_WINDOWS 102#if LL_MSVC
93#define snprintf safe_snprintf /* Flawfinder: ignore */ 103#define snprintf safe_snprintf /* Flawfinder: ignore */
94#endif // LL_WINDOWS 104#endif // LL_MSVC
95 105
96// Static linking with apr on windows needs to be declared. 106// Static linking with apr on windows needs to be declared.
97#ifdef LL_WINDOWS 107#ifdef LL_WINDOWS
@@ -110,7 +120,7 @@
110 120
111 121
112// Deal with VC6 problems 122// Deal with VC6 problems
113#if defined(LL_WINDOWS) 123#if LL_MSVC
114#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4. 124#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
115#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4. 125#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
116#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4. 126#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
@@ -121,6 +131,6 @@
121#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation. 131#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
122#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) 132#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
123#pragma warning( disable : 4996 ) // warning: deprecated 133#pragma warning( disable : 4996 ) // warning: deprecated
124#endif // LL_WINDOWS 134#endif // LL_MSVC
125 135
126#endif // not LL_LINDEN_PREPROCESSOR_H 136#endif // not LL_LINDEN_PREPROCESSOR_H
diff --git a/linden/indra/llcommon/llprocessor.cpp b/linden/indra/llcommon/llprocessor.cpp
index bd21351..e76294d 100644
--- a/linden/indra/llcommon/llprocessor.cpp
+++ b/linden/indra/llcommon/llprocessor.cpp
@@ -1538,6 +1538,7 @@ void CProcessor::GetStandardProcessorExtensions()
1538 CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = CheckBit(edxreg, 24); 1538 CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = CheckBit(edxreg, 24);
1539 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = CheckBit(edxreg, 25); 1539 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = CheckBit(edxreg, 25);
1540 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = CheckBit(edxreg, 26); 1540 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = CheckBit(edxreg, 26);
1541 CPUInfo._Ext.Altivec_Extensions = false;
1541 CPUInfo._Ext.SS_SelfSnoop = CheckBit(edxreg, 27); 1542 CPUInfo._Ext.SS_SelfSnoop = CheckBit(edxreg, 27);
1542 CPUInfo._Ext.HT_HyperThreading = CheckBit(edxreg, 28); 1543 CPUInfo._Ext.HT_HyperThreading = CheckBit(edxreg, 28);
1543 CPUInfo._Ext.HT_HyterThreadingSiblings = (ebxreg >> 16) & 0xFF; 1544 CPUInfo._Ext.HT_HyterThreadingSiblings = (ebxreg >> 16) & 0xFF;
@@ -1891,11 +1892,12 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
1891 break; 1892 break;
1892 } 1893 }
1893 1894
1894 // It's kinda like MMX or SSE...
1895 CPUInfo._Ext.EMMX_MultimediaExtensions = 1895 CPUInfo._Ext.EMMX_MultimediaExtensions =
1896 CPUInfo._Ext.MMX_MultimediaExtensions = 1896 CPUInfo._Ext.MMX_MultimediaExtensions =
1897 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = 1897 CPUInfo._Ext.SSE_StreamingSIMD_Extensions =
1898 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.altivec"); 1898 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = false;
1899
1900 CPUInfo._Ext.Altivec_Extensions = hasFeature("hw.optional.altivec");
1899 1901
1900#endif 1902#endif
1901 1903
@@ -1912,6 +1914,7 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
1912 CPUInfo._Ext.MMX_MultimediaExtensions = hasFeature("hw.optional.mmx"); 1914 CPUInfo._Ext.MMX_MultimediaExtensions = hasFeature("hw.optional.mmx");
1913 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = hasFeature("hw.optional.sse"); 1915 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = hasFeature("hw.optional.sse");
1914 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.sse2"); 1916 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.sse2");
1917 CPUInfo._Ext.Altivec_Extensions = false;
1915 CPUInfo._Ext.AA64_AMD64BitArchitecture = hasFeature("hw.optional.x86_64"); 1918 CPUInfo._Ext.AA64_AMD64BitArchitecture = hasFeature("hw.optional.x86_64");
1916 1919
1917#endif 1920#endif
@@ -2065,6 +2068,7 @@ bool CProcessor::CPUInfoToText(char *strBuffer, unsigned int uiMaxLen)
2065 BOOLADD("SS Self Snoop: ", CPUInfo._Ext.SS_SelfSnoop); 2068 BOOLADD("SS Self Snoop: ", CPUInfo._Ext.SS_SelfSnoop);
2066 BOOLADD("SSE Streaming SIMD Extensions: ", CPUInfo._Ext.SSE_StreamingSIMD_Extensions); 2069 BOOLADD("SSE Streaming SIMD Extensions: ", CPUInfo._Ext.SSE_StreamingSIMD_Extensions);
2067 BOOLADD("SSE2 Streaming SIMD 2 Extensions: ", CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions); 2070 BOOLADD("SSE2 Streaming SIMD 2 Extensions: ", CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions);
2071 BOOLADD("ALTVEC Altivec Extensions: ", CPUInfo._Ext.Altivec_Extensions);
2068 BOOLADD("TM Thermal Monitor: ", CPUInfo._Ext.TM_ThermalMonitor); 2072 BOOLADD("TM Thermal Monitor: ", CPUInfo._Ext.TM_ThermalMonitor);
2069 BOOLADD("TSC Time Stamp Counter: ", CPUInfo._Ext.TSC_TimeStampCounter); 2073 BOOLADD("TSC Time Stamp Counter: ", CPUInfo._Ext.TSC_TimeStampCounter);
2070 BOOLADD("VME Virtual 8086 Mode Enhancements: ", CPUInfo._Ext.VME_Virtual8086ModeEnhancements); 2074 BOOLADD("VME Virtual 8086 Mode Enhancements: ", CPUInfo._Ext.VME_Virtual8086ModeEnhancements);
diff --git a/linden/indra/llcommon/llprocessor.h b/linden/indra/llcommon/llprocessor.h
index fd9a5da..6db9328 100644
--- a/linden/indra/llcommon/llprocessor.h
+++ b/linden/indra/llcommon/llprocessor.h
@@ -71,6 +71,7 @@ typedef struct ProcessorExtensions
71 bool FXSR_FastStreamingSIMD_ExtensionsSaveRestore; 71 bool FXSR_FastStreamingSIMD_ExtensionsSaveRestore;
72 bool SSE_StreamingSIMD_Extensions; 72 bool SSE_StreamingSIMD_Extensions;
73 bool SSE2_StreamingSIMD2_Extensions; 73 bool SSE2_StreamingSIMD2_Extensions;
74 bool Altivec_Extensions;
74 bool SS_SelfSnoop; 75 bool SS_SelfSnoop;
75 bool HT_HyperThreading; 76 bool HT_HyperThreading;
76 unsigned int HT_HyterThreadingSiblings; 77 unsigned int HT_HyterThreadingSiblings;
diff --git a/linden/indra/llcommon/llskiplist.h b/linden/indra/llcommon/llskiplist.h
index be3385d..40d0c8a 100644
--- a/linden/indra/llcommon/llskiplist.h
+++ b/linden/indra/llcommon/llskiplist.h
@@ -28,11 +28,10 @@
28#ifndef LL_LLSKIPLIST_H 28#ifndef LL_LLSKIPLIST_H
29#define LL_LLSKIPLIST_H 29#define LL_LLSKIPLIST_H
30 30
31#include "llerror.h" 31#include "llrand.h"
32//#include "vmath.h"
33 32
34// NOTA BENE: Insert first needs to be < NOT <= 33// NOTA BENE: Insert first needs to be < NOT <=
35 34// Binary depth must be >= 2
36template <class DATA_TYPE, S32 BINARY_DEPTH = 10> 35template <class DATA_TYPE, S32 BINARY_DEPTH = 10>
37class LLSkipList 36class LLSkipList
38{ 37{
@@ -144,14 +143,11 @@ private:
144// Implementation 143// Implementation
145// 144//
146 145
146
147// Binary depth must be >= 2
147template <class DATA_TYPE, S32 BINARY_DEPTH> 148template <class DATA_TYPE, S32 BINARY_DEPTH>
148inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init() 149inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init()
149{ 150{
150 if (BINARY_DEPTH < 2)
151 {
152 llerrs << "Trying to create skip list with too little depth, "
153 "must be 2 or greater" << llendl;
154 }
155 S32 i; 151 S32 i;
156 for (i = 0; i < BINARY_DEPTH; i++) 152 for (i = 0; i < BINARY_DEPTH; i++)
157 { 153 {
diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp
index 48f2474..33e5cda 100644
--- a/linden/indra/llcommon/llsys.cpp
+++ b/linden/indra/llcommon/llsys.cpp
@@ -304,12 +304,33 @@ LLCPUInfo::LLCPUInfo()
304{ 304{
305 CProcessor proc; 305 CProcessor proc;
306 const ProcessorInfo* info = proc.GetCPUInfo(); 306 const ProcessorInfo* info = proc.GetCPUInfo();
307 mHasSSE = (info->_Ext.SSE_StreamingSIMD_Extensions != 0); 307 // proc.WriteInfoTextFile("procInfo.txt");
308 mHasSSE2 = (info->_Ext.SSE2_StreamingSIMD2_Extensions != 0); 308 mHasSSE = info->_Ext.SSE_StreamingSIMD_Extensions;
309 mHasSSE2 = info->_Ext.SSE2_StreamingSIMD2_Extensions;
310 mHasAltivec = info->_Ext.Altivec_Extensions;
309 mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0); 311 mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0);
310 mFamily.assign( info->strFamily ); 312 mFamily.assign( info->strFamily );
311} 313}
312 314
315bool LLCPUInfo::hasAltivec() const
316{
317 return mHasAltivec;
318}
319
320bool LLCPUInfo::hasSSE() const
321{
322 return mHasSSE;
323}
324
325bool LLCPUInfo::hasSSE2() const
326{
327 return mHasSSE2;
328}
329
330S32 LLCPUInfo::getMhz() const
331{
332 return mCPUMhz;
333}
313 334
314std::string LLCPUInfo::getCPUString() const 335std::string LLCPUInfo::getCPUString() const
315{ 336{
diff --git a/linden/indra/llcommon/llsys.h b/linden/indra/llcommon/llsys.h
index 2047d9a..83ea081 100644
--- a/linden/indra/llcommon/llsys.h
+++ b/linden/indra/llcommon/llsys.h
@@ -72,16 +72,18 @@ public:
72 72
73 std::string getCPUString() const; 73 std::string getCPUString() const;
74 74
75 BOOL hasSSE() const { return mHasSSE; } 75 bool hasAltivec() const;
76 BOOL hasSSE2() const { return mHasSSE2; } 76 bool hasSSE() const;
77 S32 getMhz() const { return mCPUMhz; } 77 bool hasSSE2() const;
78 S32 getMhz() const;
78 79
79 // Family is "AMD Duron" or "Intel Pentium Pro" 80 // Family is "AMD Duron" or "Intel Pentium Pro"
80 const std::string& getFamily() const { return mFamily; } 81 const std::string& getFamily() const { return mFamily; }
81 82
82private: 83private:
83 BOOL mHasSSE; 84 bool mHasSSE;
84 BOOL mHasSSE2; 85 bool mHasSSE2;
86 bool mHasAltivec;
85 S32 mCPUMhz; 87 S32 mCPUMhz;
86 std::string mFamily; 88 std::string mFamily;
87}; 89};
diff --git a/linden/indra/llcommon/llversion.h b/linden/indra/llcommon/llversion.h
index 096cf2e..eb8310e 100644
--- a/linden/indra/llcommon/llversion.h
+++ b/linden/indra/llcommon/llversion.h
@@ -31,7 +31,7 @@
31 31
32const S32 LL_VERSION_MAJOR = 1; 32const S32 LL_VERSION_MAJOR = 1;
33const S32 LL_VERSION_MINOR = 17; 33const S32 LL_VERSION_MINOR = 17;
34const S32 LL_VERSION_PATCH = 2; 34const S32 LL_VERSION_PATCH = 3;
35const S32 LL_VERSION_BUILD = 0; 35const S32 LL_VERSION_BUILD = 0;
36 36
37#endif 37#endif
diff --git a/linden/indra/llcommon/metaclass.cpp b/linden/indra/llcommon/metaclass.cpp
index 251795e..e545411 100644
--- a/linden/indra/llcommon/metaclass.cpp
+++ b/linden/indra/llcommon/metaclass.cpp
@@ -28,7 +28,10 @@
28 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 */ 29 */
30 30
31#include "linden_common.h"
32
31#include "metaclass.h" 33#include "metaclass.h"
34
32#include "metaproperty.h" 35#include "metaproperty.h"
33#include "reflective.h" 36#include "reflective.h"
34 37
diff --git a/linden/indra/llcommon/metaproperty.cpp b/linden/indra/llcommon/metaproperty.cpp
index 23ed7d9..221f7a7 100644
--- a/linden/indra/llcommon/metaproperty.cpp
+++ b/linden/indra/llcommon/metaproperty.cpp
@@ -28,7 +28,10 @@
28 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 */ 29 */
30 30
31#include "linden_common.h"
32
31#include "metaproperty.h" 33#include "metaproperty.h"
34
32#include "metaclass.h" 35#include "metaclass.h"
33 36
34LLMetaProperty::LLMetaProperty(const std::string& name, const LLMetaClass& object_class) : 37LLMetaProperty::LLMetaProperty(const std::string& name, const LLMetaClass& object_class) :
diff --git a/linden/indra/llcommon/reflective.cpp b/linden/indra/llcommon/reflective.cpp
index 7c07d88..c8050e0 100644
--- a/linden/indra/llcommon/reflective.cpp
+++ b/linden/indra/llcommon/reflective.cpp
@@ -27,6 +27,8 @@
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 */ 29 */
30
31#include "linden_common.h"
30 32
31#include "reflective.h" 33#include "reflective.h"
32 34