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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 591023003: WIP: Add first-class support for float32 representations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/opcodes.h ('k') | no next file » | 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 #include "src/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/graph-inl.h" 10 #include "src/compiler/graph-inl.h"
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 case IrOpcode::kWord64And: 685 case IrOpcode::kWord64And:
686 case IrOpcode::kWord64Or: 686 case IrOpcode::kWord64Or:
687 case IrOpcode::kWord64Xor: 687 case IrOpcode::kWord64Xor:
688 case IrOpcode::kWord64Shl: 688 case IrOpcode::kWord64Shl:
689 case IrOpcode::kWord64Shr: 689 case IrOpcode::kWord64Shr:
690 case IrOpcode::kWord64Sar: 690 case IrOpcode::kWord64Sar:
691 return VisitBinop(node, kRepWord64, kRepWord64); 691 return VisitBinop(node, kRepWord64, kRepWord64);
692 case IrOpcode::kWord64Equal: 692 case IrOpcode::kWord64Equal:
693 return VisitBinop(node, kRepWord64, kRepBit); 693 return VisitBinop(node, kRepWord64, kRepBit);
694 694
695 case IrOpcode::kChangeInt32ToInt64: 695 case IrOpcode::kChangeFloat32ToFloat64:
696 return VisitUnop(node, kTypeInt32 | kRepWord32, 696 return VisitUnop(node, kTypeNumber | kRepFloat32,
697 kTypeInt32 | kRepWord64); 697 kTypeNumber | kRepFloat64);
698 case IrOpcode::kChangeUint32ToUint64: 698 case IrOpcode::kChangeFloat64ToFloat32:
699 return VisitUnop(node, kTypeUint32 | kRepWord32, 699 return VisitUnop(node, kTypeNumber | kRepFloat64,
700 kTypeUint32 | kRepWord64); 700 kTypeNumber | kRepFloat32);
701 case IrOpcode::kTruncateInt64ToInt32:
702 // TODO(titzer): Is kTypeInt32 correct here?
703 return VisitUnop(node, kTypeInt32 | kRepWord64,
704 kTypeInt32 | kRepWord32);
705
706 case IrOpcode::kChangeInt32ToFloat64:
707 return VisitUnop(node, kTypeInt32 | kRepWord32,
708 kTypeInt32 | kRepFloat64);
709 case IrOpcode::kChangeUint32ToFloat64:
710 return VisitUnop(node, kTypeUint32 | kRepWord32,
711 kTypeUint32 | kRepFloat64);
712 case IrOpcode::kChangeFloat64ToInt32: 701 case IrOpcode::kChangeFloat64ToInt32:
713 return VisitUnop(node, kTypeInt32 | kRepFloat64, 702 return VisitUnop(node, kTypeInt32 | kRepFloat64,
714 kTypeInt32 | kRepWord32); 703 kTypeInt32 | kRepWord32);
715 case IrOpcode::kChangeFloat64ToUint32: 704 case IrOpcode::kChangeFloat64ToUint32:
716 return VisitUnop(node, kTypeUint32 | kRepFloat64, 705 return VisitUnop(node, kTypeUint32 | kRepFloat64,
717 kTypeUint32 | kRepWord32); 706 kTypeUint32 | kRepWord32);
718 707
708 case IrOpcode::kChangeInt32ToFloat64:
709 return VisitUnop(node, kTypeInt32 | kRepWord32,
710 kTypeInt32 | kRepFloat64);
711 case IrOpcode::kChangeInt32ToInt64:
712 return VisitUnop(node, kTypeInt32 | kRepWord32,
713 kTypeInt32 | kRepWord64);
714 case IrOpcode::kChangeUint32ToFloat64:
715 return VisitUnop(node, kTypeUint32 | kRepWord32,
716 kTypeUint32 | kRepFloat64);
717 case IrOpcode::kChangeUint32ToUint64:
718 return VisitUnop(node, kTypeUint32 | kRepWord32,
719 kTypeUint32 | kRepWord64);
720
721 case IrOpcode::kTruncateFloat64ToFloat32:
722 return VisitUnop(node, kTypeNumber | kRepFloat64,
723 kTypeNumber | kRepFloat32);
724 case IrOpcode::kTruncateFloat64ToInt32:
725 return VisitUnop(node, kTypeNumber | kRepFloat64,
726 kTypeInt32 | kRepWord32);
727 case IrOpcode::kTruncateInt64ToInt32:
728 // TODO(titzer): Is kTypeInt32 correct here?
729 return VisitUnop(node, kTypeInt32 | kRepWord64,
730 kTypeInt32 | kRepWord32);
731
719 case IrOpcode::kFloat64Add: 732 case IrOpcode::kFloat64Add:
720 case IrOpcode::kFloat64Sub: 733 case IrOpcode::kFloat64Sub:
721 case IrOpcode::kFloat64Mul: 734 case IrOpcode::kFloat64Mul:
722 case IrOpcode::kFloat64Div: 735 case IrOpcode::kFloat64Div:
723 case IrOpcode::kFloat64Mod: 736 case IrOpcode::kFloat64Mod:
724 return VisitFloat64Binop(node); 737 return VisitFloat64Binop(node);
725 case IrOpcode::kFloat64Equal: 738 case IrOpcode::kFloat64Equal:
726 case IrOpcode::kFloat64LessThan: 739 case IrOpcode::kFloat64LessThan:
727 case IrOpcode::kFloat64LessThanOrEqual: 740 case IrOpcode::kFloat64LessThanOrEqual:
728 return VisitFloat64Cmp(node); 741 return VisitFloat64Cmp(node);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { 943 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) {
931 node->set_op(machine()->IntLessThanOrEqual()); 944 node->set_op(machine()->IntLessThanOrEqual());
932 node->ReplaceInput(0, StringComparison(node, true)); 945 node->ReplaceInput(0, StringComparison(node, true));
933 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); 946 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
934 } 947 }
935 948
936 949
937 } // namespace compiler 950 } // namespace compiler
938 } // namespace internal 951 } // namespace internal
939 } // namespace v8 952 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/opcodes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698