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

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: rebase and move cmpxchg to builtins-sharedarraybuffer-gen.cc Created 3 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
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index ab994a32e49b3b4f342d8d40a197f662d44a856b..0da312c6bc641f8aab8f2979c5e3beea2a03c330 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2301,6 +2301,35 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ xchgl(i.InputRegister(0), i.MemoryOperand(1));
break;
}
+ case kAtomicCompareExchangeInt8: {
+ __ lock();
+ __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
+ __ movsxbl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeUint8: {
+ __ lock();
+ __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
+ __ movzxbl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeInt16: {
+ __ lock();
+ __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
+ __ movsxwl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeUint16: {
+ __ lock();
+ __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
+ __ movzxwl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeWord32: {
+ __ lock();
+ __ cmpxchgl(i.MemoryOperand(2), i.InputRegister(1));
+ break;
+ }
case kAtomicLoadInt8:
case kAtomicLoadUint8:
case kAtomicLoadInt16:

Powered by Google App Engine
This is Rietveld 408576698