Debian Codegraph @

rpython/translator/c/src/asm_gcc_x86.c

raw symbols SCIP
1 /* This optional file only works for GCC on an i386.
2 * It replaces some complex macros with native assembler instructions.
3 */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7
8
9 # ifdef PYPY_X86_CHECK_SSE2
10 void pypy_x86_check_sse2(void)
11 {
12 //Read the CPU features.
13 int features;
14 asm("movl $1, %%eax\n"
15 "pushl %%ebx\n"
16 "cpuid\n"
17 "popl %%ebx\n"
18 "movl %%edx, %0"
19 : "=g"(features) : : "eax", "edx", "ecx");
20
21 //Check bits 25 and 26, this indicates SSE2 support
22 if (((features & (1 << 25)) == 0) || ((features & (1 << 26)) == 0))
23 {
24 fprintf(stderr, "Old CPU with no SSE2 support, cannot continue.\n"
25 "You need to re-translate with "
26 "'--jit-backend=x86-without-sse2'\n");
27 abort();
28 }
29 }
30 # endif