From 5edca82eb3ddfdae66e0d84cfab0d322045aa3bb Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 1 Nov 2008 11:34:13 +0000 Subject: [PATCH] Nasty hack: Fix cpu detection on 32 bit Linux, by tricking the optimizer into thinking it needs the values of reg[2] & [3]; which, in fact, it does. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@265 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/x86/ix86/ix86_cpudetect.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pcsx2/x86/ix86/ix86_cpudetect.c b/pcsx2/x86/ix86/ix86_cpudetect.c index df6e1d5833..32910987aa 100644 --- a/pcsx2/x86/ix86/ix86_cpudetect.c +++ b/pcsx2/x86/ix86/ix86_cpudetect.c @@ -211,6 +211,9 @@ void cpudetectInit( void ) //AMD 64 STUFF u32 x86_64_8BITBRANDID; u32 x86_64_12BITBRANDID; + int num; + char str[50]; + memset( cpuinfo.x86ID, 0, sizeof( cpuinfo.x86ID ) ); cpuinfo.x86Family = 0; cpuinfo.x86Model = 0; @@ -225,6 +228,10 @@ void cpudetectInit( void ) ((u32*)cpuinfo.x86ID)[ 0 ] = regs[ 1 ]; ((u32*)cpuinfo.x86ID)[ 1 ] = regs[ 3 ]; ((u32*)cpuinfo.x86ID)[ 2 ] = regs[ 2 ]; + + // Hack - prevents reg[2] & reg[3] from being optimized out of existance! + num = sprintf(str, "\tx86Flags = %8.8x %8.8x\n", regs[3], regs[2]); + if ( cmds >= 0x00000001 ) { if ( iCpuId( 0x00000001, regs ) != -1 )