Add "cc" clobbers to inline asm that modifies flags.
As far as we know, the lack of "cc" in the clobbers hasn't caused problems yet, but it could. This change is to improve correctness, and is also almost certainly performance neutral. PiperOrigin-RevId: 487133620
This commit is contained in:
committed by
Victor Costan
parent
8881ba172a
commit
15e2a0e13d
@@ -246,7 +246,8 @@ static inline std::pair<size_t, bool> FindMatchLength(const char* s1,
|
||||
asm("testl %k2, %k2\n\t"
|
||||
"cmovzq %1, %0\n\t"
|
||||
: "+r"(a2)
|
||||
: "r"(a3), "r"(xorval));
|
||||
: "r"(a3), "r"(xorval)
|
||||
: "cc");
|
||||
#endif
|
||||
*data = a2 >> (shift & (3 * 8));
|
||||
return std::pair<size_t, bool>(matched_bytes, true);
|
||||
@@ -277,7 +278,8 @@ static inline std::pair<size_t, bool> FindMatchLength(const char* s1,
|
||||
asm("testl %k2, %k2\n\t"
|
||||
"cmovzq %1, %0\n\t"
|
||||
: "+r"(a2)
|
||||
: "r"(a3), "r"(xorval));
|
||||
: "r"(a3), "r"(xorval)
|
||||
: "cc");
|
||||
#endif
|
||||
*data = a2 >> (shift & (3 * 8));
|
||||
matched += matched_bytes;
|
||||
|
||||
Reference in New Issue
Block a user