Merge "Merge release-4-5-patches into release-4-6" into release-4-6
[gromacs.git] / cmake / TestInlineASM_gcc_x86.c
blob152cddfafd63ca46fde188ab9c92ae356b715313
1 int
2 main()
4 unsigned int _eax,_ebx,_ecx,_edx;
5 unsigned int level = 0;
7 /* Test gcc inline asm for x86 */
8 #if defined (__x86_64__) || defined (_M_X64)
9 __asm__("push %%rbx \n\t"
10 "cpuid \n\t"
11 "movl %%ebx, %1 \n\t"
12 "pop %%rbx \n\t"
13 : "=a"(_eax), "=r"(_ebx), "=c"(_ecx), "=d"(_edx) : "0"(level));
14 #else
15 __asm__("push %%ebx \n\t"
16 "cpuid \n\t"
17 "movl %%ebx, %1 \n\t"
18 "pop %%ebx \n\t"
19 : "=a"(_eax), "=r"(_ebx), "=c"(_ecx), "=d"(_edx) : "0"(level));
20 #endif
22 return 0;