|
|
我有三?????,?三?????如何解?Q呢?
我?些code是??quot;3D engine programming"的第4章,??险f要?sp4,VC++6.0才可以跑,可是我?了sp6?是有???
(1)?楹?NOSSE2是不合法的Label?
\chap_04\zfx3d\zfxcpu.cpp(75) : error C2705: '_NOSSE2' : illegal jump into __try scope
\chap_04\zfx3d\zfxcpu.cpp(79) : error C2705: '_NOSSE' : illegal jump into __try scope
\chap_04\zfx3d\zfxcpu.cpp(82) : error C2705: '_EXIT1' : illegal jump into __try scope
CPUINFO GetCPUInfo() {
CPUINFO info;
char *pStr = info.vendor;
int n=1;
int *pn = &n;
// set all values to 0 (false)
memset(&info, 0, sizeof(CPUINFO));
// 1: See if we can get CPUID and vendor 's name then
// check for SSE and MMX Support (vendor independant)
__try {
_asm {
mov eax, 0 // eax=0 => CPUID returns vendor name
CPUID // perform CPUID function
mov esi, pStr
mov [esi], ebx // first 4 chars
mov [esi+4], edx // next for chars
mov [esi+8], ecx // last 4 chars
mov eax, 1 // EAX=1 => CPUID returns feature bits
CPUID // perform CPUID (puts feature info to EDX)
test edx, 04000000h // test bit 26 for SSE2
jz _NOSSE2 // if test failed jump
mov [info.bSSE2], 1 // set to true
_NOSSE2: test edx, 02000000h // test bit 25 for SSE
jz _NOSSE // if test failed jump
mov [info.bSSE], 1 // set to true
_NOSSE: test edx, 00800000h // test bit 23 for MMX
jz _EXIT1 // if test failed jump
mov [info.bMMX], 1 // set to true
_EXIT1: // nothing to do anymore
}
}
(2)
extern bool g_bSSE;
chap_04\zfx3d\zfxmatrix.cpp(16) : fatal error C1083: Cannot open compiler intermediate file: 'C:\DOCUME~1\user\LOCALS~1\Temp\a02444ex': Permission denied
(3)
__asm {
mov esi, this ; vector u
movups xmm0, [esi] ; first vector in xmm0
chap_04\zfx3d\zfxvector.cpp(38) : fatal error C1601: unsupported inline assembly opcode
PS:我的CPU是Intel(R) Pentim(R) 4 CPU 2.40GHz |
|