Skip to content

Commit

Permalink
Zero ecx with a mov instruction
Browse files Browse the repository at this point in the history
PGI assembler does not like the initialization in the constraints.
  • Loading branch information
martin-frbg committed Jun 16, 2019
1 parent 6d3efb2 commit bbd4bb0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common_x86_64.h
Expand Up @@ -129,12 +129,13 @@ static __inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){
*ecx=cpuinfo[2];
*edx=cpuinfo[3];
#else
__asm__ __volatile__("cpuid"
__asm__ __volatile__("mov %%ecx, 0;"
"cpuid"
: "=a" (*eax),
"=b" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "0" (op), "c"(0));
: "0" (op));
#endif
}

Expand Down

0 comments on commit bbd4bb0

Please sign in to comment.