Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: src/utils.h

Issue 1359002: Proper constraints for inline implementation in assembly. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils.h
diff --git a/src/utils.h b/src/utils.h
index 89cc5ef4a5587e6bece7093a2734379e4714fea5..8ff1f9b1c826d2e47c2978c9811257c8ec481f35 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -581,11 +581,12 @@ static inline void MemsetPointer(T** dest, T* value, int counter) {
#endif
#if defined(__GNUC__) && defined(STOS)
- asm("cld;"
+ asm volatile(
+ "cld;"
"rep ; " STOS
- : /* no output */
- : "c" (counter), "a" (value), "D" (dest)
- : /* no clobbered list as all inputs are considered clobbered */);
+ : "+&c" (counter), "+&D" (dest)
+ : "a" (value)
+ : "memory", "cc");
#else
for (int i = 0; i < counter; i++) {
dest[i] = value;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698