summaryrefslogtreecommitdiff
path: root/indra/llcommon/llprocessor.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-02-03 17:56:26 +0000
committerAdam Moss <moss@lindenlab.com>2009-02-03 17:56:26 +0000
commite188badaf29a1a02307f93864eed6737096bd9a1 (patch)
tree767259ad3385fd9ede9722e04752bea008469f8c /indra/llcommon/llprocessor.cpp
parent4ad54702fce32905402cb6055c085ac14de188a2 (diff)
QAR-1177 maint-viewer-12 + uploadfees-viewer combo mergeme
svn merge -r108355:109316 svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/maint-viewer-12-uploadfees-qa108314 Whew.
Diffstat (limited to 'indra/llcommon/llprocessor.cpp')
-rw-r--r--indra/llcommon/llprocessor.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index c6f9d3c758..469e544b16 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -279,7 +279,7 @@ bool CProcessor::AnalyzeIntelProcessor()
// Only override the brand if we have it in the lookup table. We should
// already have a string here from GetCPUInfo(). JC
- if (CPUInfo.uiBrandID < (sizeof(INTEL_BRAND)/sizeof(INTEL_BRAND[0])))
+ if ( CPUInfo.uiBrandID < LL_ARRAY_SIZE(INTEL_BRAND) )
{
strcpy(CPUInfo.strBrandID, INTEL_BRAND[CPUInfo.uiBrandID]);
@@ -1665,6 +1665,10 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
#elif LL_SOLARIS
#include <kstat.h>
+#if defined(__i386)
+#include <sys/auxv.h>
+#endif
+
// ======================
// Class constructor:
/////////////////////////
@@ -1778,6 +1782,37 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
// DEBUG llinfo << "The system has " << ncpus << " CPUs with a clock rate of " << uqwFrequency << "MHz." << llendl;
+#if defined (__i386) // we really don't care about the CPU extensions on SPARC but on x86...
+
+ // Now get cpu extensions
+
+ uint_t ui;
+
+ (void) getisax(&ui, 1);
+
+ if(ui & AV_386_FPU)
+ CPUInfo._Ext.FPU_FloatingPointUnit = true;
+ if(ui & AV_386_CX8)
+ CPUInfo._Ext.CX8_COMPXCHG8B_Instruction = true;
+ if(ui & AV_386_MMX)
+ CPUInfo._Ext.MMX_MultimediaExtensions = true;
+ if(ui & AV_386_AMD_MMX)
+ CPUInfo._Ext.MMX_MultimediaExtensions = true;
+ if(ui & AV_386_FXSR)
+ CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = true;
+ if(ui & AV_386_SSE)
+ CPUInfo._Ext.SSE_StreamingSIMD_Extensions = true;
+ if(ui & AV_386_SSE2)
+ CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = true;
+/* Left these here since they may get used later
+ if(ui & AV_386_SSE3)
+ CPUInfo._Ext.... = true;
+ if(ui & AV_386_AMD_3DNow)
+ CPUInfo._Ext.... = true;
+ if(ui & AV_386_AMD_3DNowx)
+ CPUInfo._Ext.... = true;
+*/
+#endif
return (&CPUInfo);
}