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

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

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: fix win 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/ia32/code-generator-ia32.cc
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc
index 1a7bed140788d164911bd8a9fc22134bef1a1af4..f144ccf5334acbc5969d48ccabf715ee636ca613 100644
--- a/src/compiler/ia32/code-generator-ia32.cc
+++ b/src/compiler/ia32/code-generator-ia32.cc
@@ -1888,24 +1888,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
break;
}
- case kIA32Xchgb: {
- size_t index = 0;
- Operand operand = i.MemoryOperand(&index);
- __ xchg_b(i.InputRegister(index), operand);
- break;
- }
- case kIA32Xchgw: {
- size_t index = 0;
- Operand operand = i.MemoryOperand(&index);
- __ xchg_w(i.InputRegister(index), operand);
- break;
- }
- case kIA32Xchgl: {
- size_t index = 0;
- Operand operand = i.MemoryOperand(&index);
- __ xchg(i.InputRegister(index), operand);
- break;
- }
case kCheckedLoadInt8:
ASSEMBLE_CHECKED_LOAD_INTEGER(movsx_b);
break;
@@ -1952,6 +1934,40 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kCheckedStoreWord64:
UNREACHABLE(); // currently unsupported checked int64 load/store.
break;
+#define EXCHANGE_OPERANDS \
+ size_t index = 0; \
+ Register r = i.InputRegister(index++); \
+ Operand operand = i.MemoryOperand(&index);
binji 2017/02/22 02:08:38 looks like if index is not used afterward it is si
aseemgarg 2017/02/22 03:29:02 Done.
+ case kAtomicExchangeInt8: {
+ EXCHANGE_OPERANDS
+ __ xchg_b(r, operand);
+ __ movsx_b(r, r);
+ break;
+ }
+ case kAtomicExchangeUint8: {
+ EXCHANGE_OPERANDS
+ __ xchg_b(r, operand);
+ __ movzx_b(r, r);
+ break;
+ }
+ case kAtomicExchangeInt16: {
+ EXCHANGE_OPERANDS
+ __ xchg_w(r, operand);
+ __ movsx_w(r, r);
+ break;
+ }
+ case kAtomicExchangeUint16: {
+ EXCHANGE_OPERANDS
+ __ xchg_w(r, operand);
+ __ movzx_w(r, r);
+ break;
+ }
+ case kAtomicExchangeWord32: {
+ EXCHANGE_OPERANDS
+ __ xchg(r, operand);
+ break;
+ }
+#undef EXCHANGE_OPERANDS
case kAtomicLoadInt8:
case kAtomicLoadUint8:
case kAtomicLoadInt16:

Powered by Google App Engine
This is Rietveld 408576698