- "pushl %%ebx \n\t" /* ebx gets clobbered by CPUID instruction */
- "pushl %%ecx \n\t" /* so does ecx... */
- "pushl %%edx \n\t" /* ...and edx (but ecx & edx safe on Linux) */
-/* ".byte 0x66 \n\t" // convert 16-bit pushf to 32-bit pushfd */
-/* "pushf \n\t" // 16-bit pushf */
- "pushfl \n\t" /* save Eflag to stack */
- "popl %%eax \n\t" /* get Eflag from stack into eax */
- "movl %%eax, %%ecx \n\t" /* make another copy of Eflag in ecx */
- "xorl $0x200000, %%eax \n\t" /* toggle ID bit in Eflag (i.e., bit 21) */
- "pushl %%eax \n\t" /* save modified Eflag back to stack */
-/* ".byte 0x66 \n\t" // convert 16-bit popf to 32-bit popfd */
-/* "popf \n\t" // 16-bit popf */
- "popfl \n\t" /* restore modified value to Eflag reg */
- "pushfl \n\t" /* save Eflag to stack */
- "popl %%eax \n\t" /* get Eflag from stack */
- "pushl %%ecx \n\t" /* save original Eflag to stack */
- "popfl \n\t" /* restore original Eflag */
- "xorl %%ecx, %%eax \n\t" /* compare new Eflag with original Eflag */
- "jz 0f \n\t" /* if same, CPUID instr. is not supported */
-
- "xorl %%eax, %%eax \n\t" /* set eax to zero */
-/* ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode) */
- "cpuid \n\t" /* get the CPU identification info */
- "cmpl $1, %%eax \n\t" /* make sure eax return non-zero value */
- "jl 0f \n\t" /* if eax is zero, MMX is not supported */
-
- "xorl %%eax, %%eax \n\t" /* set eax to zero and... */
- "incl %%eax \n\t" /* ...increment eax to 1. This pair is */
- /* faster than the instruction "mov eax, 1" */
- "cpuid \n\t" /* get the CPU identification info again */
- "andl $0x800000, %%edx \n\t" /* mask out all bits but MMX bit (23) */
- "cmpl $0, %%edx \n\t" /* 0 = MMX not supported */
- "jz 0f \n\t" /* non-zero = yes, MMX IS supported */
-
- "movl $1, %%eax \n\t" /* set return value to 1 */
- "jmp 1f \n\t" /* DONE: have MMX support */
-
- "0: \n\t" /* .NOT_SUPPORTED: target label for jump instructions */
- "movl $0, %%eax \n\t" /* set return value to 0 */
- "1: \n\t" /* .RETURN: target label for jump instructions */
- "movl %%eax, _mmx_supported \n\t" /* save in global static variable, too */
- "popl %%edx \n\t" /* restore edx */
- "popl %%ecx \n\t" /* restore ecx */
- "popl %%ebx \n\t" /* restore ebx */
-
-/* "ret \n\t" // DONE: no MMX support */
- /* (fall through to standard C "ret") */
-
- : /* output list (none) */
-
- : /* any variables used on input (none) */
-
- : "%eax" /* clobber list */
-/* , "%ebx", "%ecx", "%edx" // GRR: we handle these manually */
-/* , "memory" // if write to a variable gcc thought was in a reg */
-/* , "cc" // "condition codes" (flag bits) */
+ "pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction
+ "pushl %%ecx \n\t" // so does ecx...
+ "pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux)
+// ".byte 0x66 \n\t" // convert 16-bit pushf to 32-bit pushfd
+// "pushf \n\t" // 16-bit pushf
+ "pushfl \n\t" // save Eflag to stack
+ "popl %%eax \n\t" // get Eflag from stack into eax
+ "movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx
+ "xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
+ "pushl %%eax \n\t" // save modified Eflag back to stack
+// ".byte 0x66 \n\t" // convert 16-bit popf to 32-bit popfd
+// "popf \n\t" // 16-bit popf
+ "popfl \n\t" // restore modified value to Eflag reg
+ "pushfl \n\t" // save Eflag to stack
+ "popl %%eax \n\t" // get Eflag from stack
+ "pushl %%ecx \n\t" // save original Eflag to stack
+ "popfl \n\t" // restore original Eflag
+ "xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag
+ "jz 0f \n\t" // if same, CPUID instr. is not supported
+
+ "xorl %%eax, %%eax \n\t" // set eax to zero
+// ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode)
+ "cpuid \n\t" // get the CPU identification info
+ "cmpl $1, %%eax \n\t" // make sure eax return non-zero value
+ "jl 0f \n\t" // if eax is zero, MMX is not supported
+
+ "xorl %%eax, %%eax \n\t" // set eax to zero and...
+ "incl %%eax \n\t" // ...increment eax to 1. This pair is
+ // faster than the instruction "mov eax, 1"
+ "cpuid \n\t" // get the CPU identification info again
+ "andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23)
+ "cmpl $0, %%edx \n\t" // 0 = MMX not supported
+ "jz 0f \n\t" // non-zero = yes, MMX IS supported
+
+ "movl $1, %%eax \n\t" // set return value to 1
+ "jmp 1f \n\t" // DONE: have MMX support
+
+ "0: \n\t" // .NOT_SUPPORTED: target label for jump instructions
+ "movl $0, %%eax \n\t" // set return value to 0
+ "1: \n\t" // .RETURN: target label for jump instructions
+ "movl %%eax, _mmx_supported \n\t" // save in global static variable, too
+ "popl %%edx \n\t" // restore edx
+ "popl %%ecx \n\t" // restore ecx
+ "popl %%ebx \n\t" // restore ebx
+
+// "ret \n\t" // DONE: no MMX support
+ // (fall through to standard C "ret")
+
+ : // output list (none)
+
+ : // any variables used on input (none)
+
+ : "%eax" // clobber list
+// , "%ebx", "%ecx", "%edx" // GRR: we handle these manually
+// , "memory" // if write to a variable gcc thought was in a reg
+// , "cc" // "condition codes" (flag bits)