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

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

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: dmb Created 3 years, 10 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 1a96a3a4c7950bdc9abbace94c806af4e1fdd954..7ecf442fc612a517498a1250ddfffc623b04eb28 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -2243,6 +2243,30 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ xchgl(i.InputRegister(0), i.MemoryOperand(1));
break;
}
+ case kAtomicCompareExchangeInt8: {
+ __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
+ __ movsxbl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeUint8: {
+ __ cmpxchgb(i.MemoryOperand(2), i.InputRegister(1));
+ __ movzxbl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeInt16: {
+ __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
+ __ movsxwl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeUint16: {
+ __ cmpxchgw(i.MemoryOperand(2), i.InputRegister(1));
+ __ movzxwl(rax, rax);
+ break;
+ }
+ case kAtomicCompareExchangeWord32: {
+ __ cmpxchgl(i.MemoryOperand(2), i.InputRegister(1));
+ break;
+ }
case kAtomicLoadInt8:
case kAtomicLoadUint8:
case kAtomicLoadInt16:

Powered by Google App Engine
This is Rietveld 408576698