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

Side by Side Diff: src/compiler/representation-change.h

Issue 597083002: Translate NumberDivide/NumberModulus operators to Int32Div, Int32Mod in representation-change.h. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add multiply. 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 | « src/compiler/machine-operator-reducer.cc ('k') | src/globals.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_ 5 #ifndef V8_COMPILER_REPRESENTATION_CHANGE_H_
6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_ 6 #define V8_COMPILER_REPRESENTATION_CHANGE_H_
7 7
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // Can't really convert Word64 to anything else. Purported to be internal. 228 // Can't really convert Word64 to anything else. Purported to be internal.
229 return TypeError(node, output_type, kRepWord64); 229 return TypeError(node, output_type, kRepWord64);
230 } 230 }
231 231
232 const Operator* Int32OperatorFor(IrOpcode::Value opcode) { 232 const Operator* Int32OperatorFor(IrOpcode::Value opcode) {
233 switch (opcode) { 233 switch (opcode) {
234 case IrOpcode::kNumberAdd: 234 case IrOpcode::kNumberAdd:
235 return machine()->Int32Add(); 235 return machine()->Int32Add();
236 case IrOpcode::kNumberSubtract: 236 case IrOpcode::kNumberSubtract:
237 return machine()->Int32Sub(); 237 return machine()->Int32Sub();
238 case IrOpcode::kNumberMultiply:
239 return machine()->Int32Mul();
240 case IrOpcode::kNumberDivide:
241 return machine()->Int32Div();
242 case IrOpcode::kNumberModulus:
243 return machine()->Int32Mod();
238 case IrOpcode::kNumberEqual: 244 case IrOpcode::kNumberEqual:
239 return machine()->Word32Equal(); 245 return machine()->Word32Equal();
240 case IrOpcode::kNumberLessThan: 246 case IrOpcode::kNumberLessThan:
241 return machine()->Int32LessThan(); 247 return machine()->Int32LessThan();
242 case IrOpcode::kNumberLessThanOrEqual: 248 case IrOpcode::kNumberLessThanOrEqual:
243 return machine()->Int32LessThanOrEqual(); 249 return machine()->Int32LessThanOrEqual();
244 default: 250 default:
245 UNREACHABLE(); 251 UNREACHABLE();
246 return NULL; 252 return NULL;
247 } 253 }
248 } 254 }
249 255
250 const Operator* Uint32OperatorFor(IrOpcode::Value opcode) { 256 const Operator* Uint32OperatorFor(IrOpcode::Value opcode) {
251 switch (opcode) { 257 switch (opcode) {
252 case IrOpcode::kNumberAdd: 258 case IrOpcode::kNumberAdd:
253 return machine()->Int32Add(); 259 return machine()->Int32Add();
254 case IrOpcode::kNumberSubtract: 260 case IrOpcode::kNumberSubtract:
255 return machine()->Int32Sub(); 261 return machine()->Int32Sub();
262 case IrOpcode::kNumberMultiply:
263 return machine()->Int32Mul();
264 case IrOpcode::kNumberDivide:
265 return machine()->Int32UDiv();
266 case IrOpcode::kNumberModulus:
267 return machine()->Int32UMod();
256 case IrOpcode::kNumberEqual: 268 case IrOpcode::kNumberEqual:
257 return machine()->Word32Equal(); 269 return machine()->Word32Equal();
258 case IrOpcode::kNumberLessThan: 270 case IrOpcode::kNumberLessThan:
259 return machine()->Uint32LessThan(); 271 return machine()->Uint32LessThan();
260 case IrOpcode::kNumberLessThanOrEqual: 272 case IrOpcode::kNumberLessThanOrEqual:
261 return machine()->Uint32LessThanOrEqual(); 273 return machine()->Uint32LessThanOrEqual();
262 default: 274 default:
263 UNREACHABLE(); 275 UNREACHABLE();
264 return NULL; 276 return NULL;
265 } 277 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 JSGraph* jsgraph() { return jsgraph_; } 351 JSGraph* jsgraph() { return jsgraph_; }
340 Isolate* isolate() { return isolate_; } 352 Isolate* isolate() { return isolate_; }
341 SimplifiedOperatorBuilder* simplified() { return simplified_; } 353 SimplifiedOperatorBuilder* simplified() { return simplified_; }
342 MachineOperatorBuilder* machine() { return jsgraph()->machine(); } 354 MachineOperatorBuilder* machine() { return jsgraph()->machine(); }
343 }; 355 };
344 } 356 }
345 } 357 }
346 } // namespace v8::internal::compiler 358 } // namespace v8::internal::compiler
347 359
348 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_ 360 #endif // V8_COMPILER_REPRESENTATION_CHANGE_H_
OLDNEW
« no previous file with comments | « src/compiler/machine-operator-reducer.cc ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698