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

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

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: remove 0 extend for arm 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 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 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2129 break; 2129 break;
2130 case kX64Poke: { 2130 case kX64Poke: {
2131 int const slot = MiscField::decode(instr->opcode()); 2131 int const slot = MiscField::decode(instr->opcode());
2132 if (HasImmediateInput(instr, 0)) { 2132 if (HasImmediateInput(instr, 0)) {
2133 __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0)); 2133 __ movq(Operand(rsp, slot * kPointerSize), i.InputImmediate(0));
2134 } else { 2134 } else {
2135 __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0)); 2135 __ movq(Operand(rsp, slot * kPointerSize), i.InputRegister(0));
2136 } 2136 }
2137 break; 2137 break;
2138 } 2138 }
2139 case kX64Xchgb: {
2140 size_t index = 0;
2141 Operand operand = i.MemoryOperand(&index);
2142 __ xchgb(i.InputRegister(index), operand);
2143 break;
2144 }
2145 case kX64Xchgw: {
2146 size_t index = 0;
2147 Operand operand = i.MemoryOperand(&index);
2148 __ xchgw(i.InputRegister(index), operand);
2149 break;
2150 }
2151 case kX64Xchgl: {
2152 size_t index = 0;
2153 Operand operand = i.MemoryOperand(&index);
2154 __ xchgl(i.InputRegister(index), operand);
2155 break;
2156 }
2157 case kX64Int32x4Splat: { 2139 case kX64Int32x4Splat: {
2158 CpuFeatureScope sse_scope(masm(), SSE4_1); 2140 CpuFeatureScope sse_scope(masm(), SSE4_1);
2159 XMMRegister dst = i.OutputSimd128Register(); 2141 XMMRegister dst = i.OutputSimd128Register();
2160 __ Movd(dst, i.InputRegister(0)); 2142 __ Movd(dst, i.InputRegister(0));
2161 __ shufps(dst, dst, 0x0); 2143 __ shufps(dst, dst, 0x0);
2162 break; 2144 break;
2163 } 2145 }
2164 case kX64Int32x4ExtractLane: { 2146 case kX64Int32x4ExtractLane: {
2165 CpuFeatureScope sse_scope(masm(), SSE4_1); 2147 CpuFeatureScope sse_scope(masm(), SSE4_1);
2166 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1)); 2148 __ Pextrd(i.OutputRegister(), i.InputSimd128Register(0), i.InputInt8(1));
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 break; 2212 break;
2231 case kCheckedStoreFloat32: 2213 case kCheckedStoreFloat32:
2232 ASSEMBLE_CHECKED_STORE_FLOAT(Movss); 2214 ASSEMBLE_CHECKED_STORE_FLOAT(Movss);
2233 break; 2215 break;
2234 case kCheckedStoreFloat64: 2216 case kCheckedStoreFloat64:
2235 ASSEMBLE_CHECKED_STORE_FLOAT(Movsd); 2217 ASSEMBLE_CHECKED_STORE_FLOAT(Movsd);
2236 break; 2218 break;
2237 case kX64StackCheck: 2219 case kX64StackCheck:
2238 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); 2220 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
2239 break; 2221 break;
2222 case kAtomicExchangeInt8: {
2223 __ xchgb(i.InputRegister(0), i.MemoryOperand(1));
2224 __ movsxbl(i.InputRegister(0), i.InputRegister(0));
2225 break;
2226 }
2227 case kAtomicExchangeUint8: {
2228 __ xchgb(i.InputRegister(0), i.MemoryOperand(1));
2229 __ movzxbl(i.InputRegister(0), i.InputRegister(0));
2230 break;
2231 }
2232 case kAtomicExchangeInt16: {
2233 __ xchgw(i.InputRegister(0), i.MemoryOperand(1));
2234 __ movsxwl(i.InputRegister(0), i.InputRegister(0));
2235 break;
2236 }
2237 case kAtomicExchangeUint16: {
2238 __ xchgw(i.InputRegister(0), i.MemoryOperand(1));
2239 __ movzxwl(i.InputRegister(0), i.InputRegister(0));
2240 break;
2241 }
2242 case kAtomicExchangeWord32: {
2243 __ xchgl(i.InputRegister(0), i.MemoryOperand(1));
2244 break;
2245 }
2240 case kAtomicLoadInt8: 2246 case kAtomicLoadInt8:
2241 case kAtomicLoadUint8: 2247 case kAtomicLoadUint8:
2242 case kAtomicLoadInt16: 2248 case kAtomicLoadInt16:
2243 case kAtomicLoadUint16: 2249 case kAtomicLoadUint16:
2244 case kAtomicLoadWord32: 2250 case kAtomicLoadWord32:
2245 case kAtomicStoreWord8: 2251 case kAtomicStoreWord8:
2246 case kAtomicStoreWord16: 2252 case kAtomicStoreWord16:
2247 case kAtomicStoreWord32: 2253 case kAtomicStoreWord32:
2248 UNREACHABLE(); // Won't be generated by instruction selector. 2254 UNREACHABLE(); // Won't be generated by instruction selector.
2249 break; 2255 break;
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2867 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; 2873 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
2868 __ Nop(padding_size); 2874 __ Nop(padding_size);
2869 } 2875 }
2870 } 2876 }
2871 2877
2872 #undef __ 2878 #undef __
2873 2879
2874 } // namespace compiler 2880 } // namespace compiler
2875 } // namespace internal 2881 } // namespace internal
2876 } // namespace v8 2882 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698