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

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: [Atomics] Make Atomics.exchange a builtin using TF Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/code-generator-impl.h" 10 #include "src/compiler/code-generator-impl.h"
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 break; 2127 break;
2128 case kX64Poke: { 2128 case kX64Poke: {
2129 int const slot = MiscField::decode(instr->opcode()); 2129 int const slot = MiscField::decode(instr->opcode());
2130 if (HasImmediateInput(instr, 0)) { 2130 if (HasImmediateInput(instr, 0)) {
2131 __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0)); 2131 __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0));
2132 } else { 2132 } else {
2133 __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0)); 2133 __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0));
2134 } 2134 }
2135 break; 2135 break;
2136 } 2136 }
2137 case kX64Xchgb: {
2138 size_t index = 0;
2139 Operand operand = i.MemoryOperand(&index);
2140 __ xchgb(i.InputRegister(index), operand);
2141 break;
2142 }
2143 case kX64Xchgw: {
2144 size_t index = 0;
2145 Operand operand = i.MemoryOperand(&index);
2146 __ xchgw(i.InputRegister(index), operand);
2147 break;
2148 }
2149 case kX64Xchgl: {
2150 size_t index = 0;
2151 Operand operand = i.MemoryOperand(&index);
2152 __ xchgl(i.InputRegister(index), operand);
2153 break;
2154 }
2155 case kX64Int32x4Create: { 2137 case kX64Int32x4Create: {
2156 CpuFeatureScope sse_scope(masm(), SSE4_1); 2138 CpuFeatureScope sse_scope(masm(), SSE4_1);
2157 XMMRegister dst = i.OutputSimd128Register(); 2139 XMMRegister dst = i.OutputSimd128Register();
2158 __ Movd(dst, i.InputRegister(0)); 2140 __ Movd(dst, i.InputRegister(0));
2159 __ shufps(dst, dst, 0x0); 2141 __ shufps(dst, dst, 0x0);
2160 break; 2142 break;
2161 } 2143 }
2162 case kX64Int32x4ExtractLane: { 2144 case kX64Int32x4ExtractLane: {
2163 CpuFeatureScope sse_scope(masm(), SSE4_1); 2145 CpuFeatureScope sse_scope(masm(), SSE4_1);
2164 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); 2146 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 break; 2204 break;
2223 case kCheckedStoreFloat32: 2205 case kCheckedStoreFloat32:
2224 ASSEMBLE_CHECKED_STORE_FLOAT(Movss); 2206 ASSEMBLE_CHECKED_STORE_FLOAT(Movss);
2225 break; 2207 break;
2226 case kCheckedStoreFloat64: 2208 case kCheckedStoreFloat64:
2227 ASSEMBLE_CHECKED_STORE_FLOAT(Movsd); 2209 ASSEMBLE_CHECKED_STORE_FLOAT(Movsd);
2228 break; 2210 break;
2229 case kX64StackCheck: 2211 case kX64StackCheck:
2230 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); 2212 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
2231 break; 2213 break;
2214 #define EXCHANGE_OPERANDS \
2215 size_t index = 0; \
2216 Register r = i.InputRegister(index++); \
2217 Operand operand = i.MemoryOperand(&index);
2218 case kAtomicExchangeInt8: {
2219 EXCHANGE_OPERANDS
2220 __ xchgb(r, operand, true);
binji 2017/01/17 21:45:50 just add the appropriate extension instruction her
aseemgarg 2017/01/21 08:40:37 Done.
2221 break;
2222 }
2223 case kAtomicExchangeUint8: {
2224 EXCHANGE_OPERANDS
2225 __ xchgb(r, operand, false);
2226 break;
2227 }
2228 case kAtomicExchangeInt16: {
2229 EXCHANGE_OPERANDS
2230 __ xchgw(r, operand, true);
2231 break;
2232 }
2233 case kAtomicExchangeUint16: {
2234 EXCHANGE_OPERANDS
2235 __ xchgw(r, operand, false);
2236 break;
2237 }
2238 case kAtomicExchangeWord32: {
2239 EXCHANGE_OPERANDS
2240 __ xchgl(r, operand);
2241 break;
2242 }
2243 #undef EXCHANGE_OPERANDS
2232 case kAtomicLoadInt8: 2244 case kAtomicLoadInt8:
2233 case kAtomicLoadUint8: 2245 case kAtomicLoadUint8:
2234 case kAtomicLoadInt16: 2246 case kAtomicLoadInt16:
2235 case kAtomicLoadUint16: 2247 case kAtomicLoadUint16:
2236 case kAtomicLoadWord32: 2248 case kAtomicLoadWord32:
2237 case kAtomicStoreWord8: 2249 case kAtomicStoreWord8:
2238 case kAtomicStoreWord16: 2250 case kAtomicStoreWord16:
2239 case kAtomicStoreWord32: 2251 case kAtomicStoreWord32:
2240 UNREACHABLE(); // Won't be generated by instruction selector. 2252 UNREACHABLE(); // Won't be generated by instruction selector.
2241 break; 2253 break;
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
2854 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2866 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2855 __ Nop(padding_size); 2867 __ Nop(padding_size);
2856 } 2868 }
2857 } 2869 }
2858 2870
2859 #undef __ 2871 #undef __
2860 2872
2861 } // namespace compiler 2873 } // namespace compiler
2862 } // namespace internal 2874 } // namespace internal
2863 } // namespace v8 2875 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698