Add CC clobber to cpuid call

This should not be needed, but it does not hurt. According to Ian Lance Taylor (http://gcc.gnu.org/ml/gcc-help/2014-02/msg00023.html), the CC clobber causes GCC to forget its internal representation of flag state. It should not be needed for cpuid. However, Clang has some odd behave in a couple of versions of its compiler when using cpuid. Both JW and UB experienced it on separate occassions.
pull/339/head
Jeffrey Walton 2016-11-13 11:14:03 -05:00
parent 61aa62bd8f
commit 5be05bce07
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 1 additions and 0 deletions

View File

@ -113,6 +113,7 @@ bool CpuId(word32 input, word32 output[4])
# endif
: "=a" (output[0]), "=D" (output[1]), "=c" (output[2]), "=d" (output[3])
: "a" (input), "c" (0)
: "cc"
);
}