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

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

Issue 619663002: [turbofan] support all shift operands on ia32 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « no previous file | src/compiler/ia32/instruction-selector-ia32.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 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 "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 15 matching lines...) Expand all
26 : InstructionOperandConverter(gen, instr) {} 26 : InstructionOperandConverter(gen, instr) {}
27 27
28 Operand InputOperand(int index) { return ToOperand(instr_->InputAt(index)); } 28 Operand InputOperand(int index) { return ToOperand(instr_->InputAt(index)); }
29 29
30 Immediate InputImmediate(int index) { 30 Immediate InputImmediate(int index) {
31 return ToImmediate(instr_->InputAt(index)); 31 return ToImmediate(instr_->InputAt(index));
32 } 32 }
33 33
34 Operand OutputOperand() { return ToOperand(instr_->Output()); } 34 Operand OutputOperand() { return ToOperand(instr_->Output()); }
35 35
36 Operand TempOperand(int index) { return ToOperand(instr_->TempAt(index)); }
37
38 Operand ToOperand(InstructionOperand* op, int extra = 0) { 36 Operand ToOperand(InstructionOperand* op, int extra = 0) {
39 if (op->IsRegister()) { 37 if (op->IsRegister()) {
40 DCHECK(extra == 0); 38 DCHECK(extra == 0);
41 return Operand(ToRegister(op)); 39 return Operand(ToRegister(op));
42 } else if (op->IsDoubleRegister()) { 40 } else if (op->IsDoubleRegister()) {
43 DCHECK(extra == 0); 41 DCHECK(extra == 0);
44 return Operand(ToDoubleRegister(op)); 42 return Operand(ToDoubleRegister(op));
45 } 43 }
46 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); 44 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
47 // The linkage computes where all spill slots are located. 45 // The linkage computes where all spill slots are located.
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 break; 271 break;
274 case kIA32Sub: 272 case kIA32Sub:
275 if (HasImmediateInput(instr, 1)) { 273 if (HasImmediateInput(instr, 1)) {
276 __ sub(i.InputOperand(0), i.InputImmediate(1)); 274 __ sub(i.InputOperand(0), i.InputImmediate(1));
277 } else { 275 } else {
278 __ sub(i.InputRegister(0), i.InputOperand(1)); 276 __ sub(i.InputRegister(0), i.InputOperand(1));
279 } 277 }
280 break; 278 break;
281 case kIA32Shl: 279 case kIA32Shl:
282 if (HasImmediateInput(instr, 1)) { 280 if (HasImmediateInput(instr, 1)) {
283 __ shl(i.OutputRegister(), i.InputInt5(1)); 281 __ shl(i.OutputOperand(), i.InputInt5(1));
284 } else { 282 } else {
285 __ shl_cl(i.OutputRegister()); 283 __ shl_cl(i.OutputOperand());
286 } 284 }
287 break; 285 break;
288 case kIA32Shr: 286 case kIA32Shr:
289 if (HasImmediateInput(instr, 1)) { 287 if (HasImmediateInput(instr, 1)) {
290 __ shr(i.OutputRegister(), i.InputInt5(1)); 288 __ shr(i.OutputOperand(), i.InputInt5(1));
291 } else { 289 } else {
292 __ shr_cl(i.OutputRegister()); 290 __ shr_cl(i.OutputOperand());
293 } 291 }
294 break; 292 break;
295 case kIA32Sar: 293 case kIA32Sar:
296 if (HasImmediateInput(instr, 1)) { 294 if (HasImmediateInput(instr, 1)) {
297 __ sar(i.OutputRegister(), i.InputInt5(1)); 295 __ sar(i.OutputOperand(), i.InputInt5(1));
298 } else { 296 } else {
299 __ sar_cl(i.OutputRegister()); 297 __ sar_cl(i.OutputOperand());
300 } 298 }
301 break; 299 break;
302 case kIA32Ror: 300 case kIA32Ror:
303 if (HasImmediateInput(instr, 1)) { 301 if (HasImmediateInput(instr, 1)) {
304 __ ror(i.OutputRegister(), i.InputInt5(1)); 302 __ ror(i.OutputOperand(), i.InputInt5(1));
305 } else { 303 } else {
306 __ ror_cl(i.OutputRegister()); 304 __ ror_cl(i.OutputOperand());
307 } 305 }
308 break; 306 break;
309 case kSSEFloat64Cmp: 307 case kSSEFloat64Cmp:
310 __ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1)); 308 __ ucomisd(i.InputDoubleRegister(0), i.InputOperand(1));
311 break; 309 break;
312 case kSSEFloat64Add: 310 case kSSEFloat64Add:
313 __ addsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); 311 __ addsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
314 break; 312 break;
315 case kSSEFloat64Sub: 313 case kSSEFloat64Sub:
316 __ subsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); 314 __ subsd(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 } 1029 }
1032 } 1030 }
1033 MarkLazyDeoptSite(); 1031 MarkLazyDeoptSite();
1034 } 1032 }
1035 1033
1036 #undef __ 1034 #undef __
1037 1035
1038 } // namespace compiler 1036 } // namespace compiler
1039 } // namespace internal 1037 } // namespace internal
1040 } // namespace v8 1038 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698