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

Side by Side Diff: src/compiler/x64/code-generator-x64.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 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 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 break; 2128 break;
2129 case kX64Poke: { 2129 case kX64Poke: {
2130 int const slot = MiscField::decode(instr->opcode()); 2130 int const slot = MiscField::decode(instr->opcode());
2131 if (HasImmediateInput(instr, 0)) { 2131 if (HasImmediateInput(instr, 0)) {
2132 __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0)); 2132 __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0));
2133 } else { 2133 } else {
2134 __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0)); 2134 __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0));
2135 } 2135 }
2136 break; 2136 break;
2137 } 2137 }
2138 case kX64Xchgb: {
2139 size_t index = 0;
2140 Operand operand = i.MemoryOperand(&index);
2141 __ xchgb(i.InputRegister(index), operand);
2142 break;
2143 }
2144 case kX64Xchgw: {
2145 size_t index = 0;
2146 Operand operand = i.MemoryOperand(&index);
2147 __ xchgw(i.InputRegister(index), operand);
2148 break;
2149 }
2150 case kX64Xchgl: {
2151 size_t index = 0;
2152 Operand operand = i.MemoryOperand(&index);
2153 __ xchgl(i.InputRegister(index), operand);
2154 break;
2155 }
2156 case kX64Int32x4Create: { 2138 case kX64Int32x4Create: {
2157 CpuFeatureScope sse_scope(masm(), SSE4_1); 2139 CpuFeatureScope sse_scope(masm(), SSE4_1);
2158 XMMRegister dst = i.OutputSimd128Register(); 2140 XMMRegister dst = i.OutputSimd128Register();
2159 __ Movd(dst, i.InputRegister(0)); 2141 __ Movd(dst, i.InputRegister(0));
2160 __ shufps(dst, dst, 0x0); 2142 __ shufps(dst, dst, 0x0);
2161 break; 2143 break;
2162 } 2144 }
2163 case kX64Int32x4ExtractLane: { 2145 case kX64Int32x4ExtractLane: {
2164 CpuFeatureScope sse_scope(masm(), SSE4_1); 2146 CpuFeatureScope sse_scope(masm(), SSE4_1);
2165 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); 2147 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 break; 2205 break;
2224 case kCheckedStoreFloat32: 2206 case kCheckedStoreFloat32:
2225 ASSEMBLE_CHECKED_STORE_FLOAT(Movss); 2207 ASSEMBLE_CHECKED_STORE_FLOAT(Movss);
2226 break; 2208 break;
2227 case kCheckedStoreFloat64: 2209 case kCheckedStoreFloat64:
2228 ASSEMBLE_CHECKED_STORE_FLOAT(Movsd); 2210 ASSEMBLE_CHECKED_STORE_FLOAT(Movsd);
2229 break; 2211 break;
2230 case kX64StackCheck: 2212 case kX64StackCheck:
2231 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); 2213 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
2232 break; 2214 break;
2215 #define EXCHANGE_OPERANDS \
2216 size_t index = 0; \
2217 Register r = i.InputRegister(index++); \
binji 2017/02/22 02:08:38 same comment here as for ia32
aseemgarg 2017/02/22 03:29:02 Done.
2218 Operand operand = i.MemoryOperand(&index);
2219 case kAtomicExchangeInt8: {
2220 EXCHANGE_OPERANDS
2221 __ xchgb(r, operand);
2222 __ movsxbl(r, r);
2223 break;
2224 }
2225 case kAtomicExchangeUint8: {
2226 EXCHANGE_OPERANDS
2227 __ xchgb(r, operand);
2228 __ movzxbl(r, r);
2229 break;
2230 }
2231 case kAtomicExchangeInt16: {
2232 EXCHANGE_OPERANDS
2233 __ xchgw(r, operand);
2234 __ movsxwl(r, r);
2235 break;
2236 }
2237 case kAtomicExchangeUint16: {
2238 EXCHANGE_OPERANDS
2239 __ xchgw(r, operand);
2240 __ movzxwl(r, r);
2241 break;
2242 }
2243 case kAtomicExchangeWord32: {
2244 EXCHANGE_OPERANDS
2245 __ xchgl(r, operand);
2246 break;
2247 }
2248 #undef EXCHANGE_OPERANDS
2233 case kAtomicLoadInt8: 2249 case kAtomicLoadInt8:
2234 case kAtomicLoadUint8: 2250 case kAtomicLoadUint8:
2235 case kAtomicLoadInt16: 2251 case kAtomicLoadInt16:
2236 case kAtomicLoadUint16: 2252 case kAtomicLoadUint16:
2237 case kAtomicLoadWord32: 2253 case kAtomicLoadWord32:
2238 case kAtomicStoreWord8: 2254 case kAtomicStoreWord8:
2239 case kAtomicStoreWord16: 2255 case kAtomicStoreWord16:
2240 case kAtomicStoreWord32: 2256 case kAtomicStoreWord32:
2241 UNREACHABLE(); // Won't be generated by instruction selector. 2257 UNREACHABLE(); // Won't be generated by instruction selector.
2242 break; 2258 break;
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2876 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2861 __ Nop(padding_size); 2877 __ Nop(padding_size);
2862 } 2878 }
2863 } 2879 }
2864 2880
2865 #undef __ 2881 #undef __
2866 2882
2867 } // namespace compiler 2883 } // namespace compiler
2868 } // namespace internal 2884 } // namespace internal
2869 } // namespace v8 2885 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698