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

Side by Side Diff: runtime/vm/assembler_x64.cc

Issue 1089003002: Implement bigint shift intrinsics on IA32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // NOLINT 5 #include "vm/globals.h" // NOLINT
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
(...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 2241
2242 2242
2243 void Assembler::sarl(Register operand, Register shifter) { 2243 void Assembler::sarl(Register operand, Register shifter) {
2244 EmitGenericShift(false, 7, operand, shifter); 2244 EmitGenericShift(false, 7, operand, shifter);
2245 } 2245 }
2246 2246
2247 2247
2248 void Assembler::shldl(Register dst, Register src, const Immediate& imm) { 2248 void Assembler::shldl(Register dst, Register src, const Immediate& imm) {
2249 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 2249 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
2250 ASSERT(imm.is_int8()); 2250 ASSERT(imm.is_int8());
2251 Operand operand(src); 2251 Operand operand(dst);
2252 EmitOperandREX(dst, operand, REX_NONE); 2252 EmitOperandREX(src, operand, REX_NONE);
2253 EmitUint8(0x0F); 2253 EmitUint8(0x0F);
2254 EmitUint8(0xA4); 2254 EmitUint8(0xA4);
2255 EmitOperand(src & 7, Operand(dst)); 2255 EmitOperand(src & 7, operand);
2256 EmitUint8(imm.value() & 0xFF); 2256 EmitUint8(imm.value() & 0xFF);
2257 } 2257 }
2258 2258
2259 2259
2260 void Assembler::shlq(Register reg, const Immediate& imm) { 2260 void Assembler::shlq(Register reg, const Immediate& imm) {
2261 EmitGenericShift(true, 4, reg, imm); 2261 EmitGenericShift(true, 4, reg, imm);
2262 } 2262 }
2263 2263
2264 2264
2265 void Assembler::shlq(Register operand, Register shifter) { 2265 void Assembler::shlq(Register operand, Register shifter) {
(...skipping 17 matching lines...) Expand all
2283 2283
2284 2284
2285 void Assembler::sarq(Register operand, Register shifter) { 2285 void Assembler::sarq(Register operand, Register shifter) {
2286 EmitGenericShift(true, 7, operand, shifter); 2286 EmitGenericShift(true, 7, operand, shifter);
2287 } 2287 }
2288 2288
2289 2289
2290 void Assembler::shldq(Register dst, Register src, const Immediate& imm) { 2290 void Assembler::shldq(Register dst, Register src, const Immediate& imm) {
2291 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 2291 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
2292 ASSERT(imm.is_int8()); 2292 ASSERT(imm.is_int8());
2293 Operand operand(src); 2293 Operand operand(dst);
2294 EmitOperandREX(dst, operand, REX_W); 2294 EmitOperandREX(src, operand, REX_W);
2295 EmitUint8(0x0F); 2295 EmitUint8(0x0F);
2296 EmitUint8(0xA4); 2296 EmitUint8(0xA4);
2297 EmitOperand(src & 7, Operand(dst)); 2297 EmitOperand(src & 7, operand);
2298 EmitUint8(imm.value() & 0xFF); 2298 EmitUint8(imm.value() & 0xFF);
2299 } 2299 }
2300 2300
2301 2301
2302 void Assembler::shldq(Register dst, Register src, Register shifter) { 2302 void Assembler::shldq(Register dst, Register src, Register shifter) {
2303 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 2303 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
2304 ASSERT(shifter == RCX); 2304 ASSERT(shifter == RCX);
2305 Operand operand(src); 2305 Operand operand(dst);
2306 EmitOperandREX(dst, operand, REX_W); 2306 EmitOperandREX(src, operand, REX_W);
2307 EmitUint8(0x0F); 2307 EmitUint8(0x0F);
2308 EmitUint8(0xA5); 2308 EmitUint8(0xA5);
2309 EmitOperand(src & 7, Operand(dst)); 2309 EmitOperand(src & 7, operand);
2310 } 2310 }
2311 2311
2312 2312
2313 void Assembler::shrdq(Register dst, Register src, Register shifter) { 2313 void Assembler::shrdq(Register dst, Register src, Register shifter) {
2314 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 2314 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
2315 ASSERT(shifter == RCX); 2315 ASSERT(shifter == RCX);
2316 Operand operand(src); 2316 Operand operand(dst);
2317 EmitOperandREX(dst, operand, REX_W); 2317 EmitOperandREX(src, operand, REX_W);
2318 EmitUint8(0x0F); 2318 EmitUint8(0x0F);
2319 EmitUint8(0xAD); 2319 EmitUint8(0xAD);
2320 EmitOperand(src & 7, Operand(dst)); 2320 EmitOperand(src & 7, operand);
2321 } 2321 }
2322 2322
2323 2323
2324 void Assembler::incl(const Address& address) { 2324 void Assembler::incl(const Address& address) {
2325 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 2325 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
2326 Operand operand(address); 2326 Operand operand(address);
2327 EmitOperandREX(0, operand, REX_NONE); 2327 EmitOperandREX(0, operand, REX_NONE);
2328 EmitUint8(0xFF); 2328 EmitUint8(0xFF);
2329 EmitOperand(0, operand); 2329 EmitOperand(0, operand);
2330 } 2330 }
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
3917 3917
3918 3918
3919 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3919 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3920 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3920 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3921 return xmm_reg_names[reg]; 3921 return xmm_reg_names[reg];
3922 } 3922 }
3923 3923
3924 } // namespace dart 3924 } // namespace dart
3925 3925
3926 #endif // defined TARGET_ARCH_X64 3926 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_ia32_test.cc ('k') | runtime/vm/assembler_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698