[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

3DNow! and MMX



Hi,

hi attached a litte code. The Windows version works fine. But not the
Linux version. Linux do a SIGSEGV.. any idea?

The routine I attached ia a simple for getting the CPUID.

bye

Felix Kollmann, DG5PT

Future Interactive 

email: fkollmann@gmx.net
http://www.futureint.com

----
Don't fear the future, because fear is the path to the dark side.
Fear is to angry. Angry is to hate and hate is to suffering.
-- Yoda
void def_system::CPUDETECTING()
{
FUNC ("void def_system::CPUDETECTING()")

  unsigned long id;

#ifdef Linux

  asm (
  "mov %%eax, 80000001                                  \n"
  "CPUID                                                \n"
  "mov %0, %%edx					\n"
  :"=g" (id)
  :
  );

#else ifdef Windows

  __asm {
  mov eax, 80000001h
  CPUID
  mov id, edx
  };
  
#endif

// checking for technologies

#define CPUID_esd       33554432        // 2^25 (bit 25)
#define CPUID_mmx       8388608         // 2^23 (bit 23)
#define CPUID_3dnow	2147483648      // 2^31 (bit 31)
#define CPUID_3dnow_p   1073741824      // 2^30 (bit 30)

  IFMBIT (id, CPUID_esd)
    hasESD= true;

  IFMBIT (id, CPUID_mmx)
    hasMMX= true;

  IFMBIT (id, CPUID_3dnow)
    has3DNow= true;

  IFMBIT (id, CPUID_3dnow_p)
    has3DNow_plus= true;
  
END ("Felix Kollmann");
}