Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 53487 Details for
Bug 85220
games-emulation/openmsx-0.5.0 x86 fails to build (non pic aware cpuid asm/c++ code)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
src/HostCPU.cc
HostCPU.cc (text/plain), 1.57 KB, created by
Jukka Lehtomäki
on 2005-03-14 19:28:21 UTC
(
hide
)
Description:
src/HostCPU.cc
Filename:
MIME Type:
Creator:
Jukka Lehtomäki
Created:
2005-03-14 19:28:21 UTC
Size:
1.57 KB
patch
obsolete
>// $Id: HostCPU.cc,v 1.5 2004/09/27 10:35:53 m9710797 Exp $ > >#include "HostCPU.hh" >#include "openmsx.hh" >#include <cassert> >#include <cstdio> >#include <iostream> >#include <iomanip> > >namespace openmsx { > >HostCPU::HostCPU() >{ > PRT_DEBUG("probing host CPU..."); > > mmxFlag = false; > mmxExtFlag = false; > #ifdef ASM_X86 > // Is CPUID instruction supported? > unsigned hasCPUID; > asm ( > // Load EFLAGS into EAX. > "pushfl;" > "popl %%eax;" > // Save current value. > "movl %%eax,%%ebx;" > // Toggle bit 21. > "xorl $0x200000, %%eax;" > // Load EAX into EFLAGS. > "pushl %%eax;" > "popfl;" > // Load EFLAGS into EAX. > "pushfl;" > "popl %%eax;" > // Did bit 21 change? > "xor %%ebx, %%eax;" > "andl $0x200000, %%eax;" > : "=a" (hasCPUID) // 0 > : // no input > : "ebx" > ); > if (hasCPUID) { > // Which CPUID calls are supported? > unsigned highest; > asm ( > "cpuid;" > : "=a" (highest) // 0 > : "0" (0) // 1: function > : "ebx", "ecx", "edx" > ); > if (highest >= 1) { > // Get features flags. > unsigned features; > asm ( > "cpuid;" > : "=d" (features) // 0 > : "a" (1) // 1: function > : "ebx", "ecx" > ); > PRT_DEBUG("CPU flags: " << hex << std::setw(8) << std::setfill('0') << std::uppercase << features); > mmxFlag = features & 0x800000; > bool sseFlag = features & 0x2000000; > mmxExtFlag = mmxFlag && sseFlag; > } > } > #endif > > PRT_DEBUG("MMX: " << mmxFlag); > PRT_DEBUG("MMX extensions: " << mmxExtFlag); >} > >} // namespace openmsx > >/* >int main(char** argv, int argc) { > openmsx::HostCPU::getInstance(); > return 0; >} >*/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 85220
: 53487 |
64200
|
64201