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

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

Issue 484103002: [turbofan] Add TruncateFloat64ToInt32 machine operator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Disable test-run-machops/RunTruncateFloat64ToInt32P on arm64. Created 6 years, 4 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/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-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 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/change-lowering.h" 5 #include "src/compiler/change-lowering.h"
6 6
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 STATIC_ASSERT(kSmiTagMask == 1); 117 STATIC_ASSERT(kSmiTagMask == 1);
118 118
119 Node* tag = graph()->NewNode(machine()->WordAnd(), val, 119 Node* tag = graph()->NewNode(machine()->WordAnd(), val,
120 jsgraph()->Int32Constant(kSmiTagMask)); 120 jsgraph()->Int32Constant(kSmiTagMask));
121 Node* branch = graph()->NewNode(common()->Branch(), tag, control); 121 Node* branch = graph()->NewNode(common()->Branch(), tag, control);
122 122
123 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); 123 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
124 Node* load = graph()->NewNode( 124 Node* load = graph()->NewNode(
125 machine()->Load(kMachFloat64), val, HeapNumberValueIndexConstant(), 125 machine()->Load(kMachFloat64), val, HeapNumberValueIndexConstant(),
126 graph()->NewNode(common()->ControlEffect(), if_true)); 126 graph()->NewNode(common()->ControlEffect(), if_true));
127 Node* change = graph()->NewNode(machine()->ChangeFloat64ToInt32(), load); 127 Node* change = graph()->NewNode(machine()->TruncateFloat64ToInt32(), load);
128 128
129 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); 129 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
130 Node* integer = 130 Node* integer =
131 graph()->NewNode(machine()->WordSar(), val, SmiShiftBitsConstant()); 131 graph()->NewNode(machine()->WordSar(), val, SmiShiftBitsConstant());
132 Node* number = 132 Node* number =
133 machine()->is64() 133 machine()->is64()
134 ? graph()->NewNode(machine()->TruncateInt64ToInt32(), integer) 134 ? graph()->NewNode(machine()->TruncateInt64ToInt32(), integer)
135 : integer; 135 : integer;
136 136
137 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false); 137 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 jsgraph()->Int32Constant(function->nargs), context, effect, control); 197 jsgraph()->Int32Constant(function->nargs), context, effect, control);
198 Node* store = graph()->NewNode( 198 Node* store = graph()->NewNode(
199 machine()->Store(kMachFloat64, kNoWriteBarrier), heap_number, 199 machine()->Store(kMachFloat64, kNoWriteBarrier), heap_number,
200 HeapNumberValueIndexConstant(), value, heap_number, control); 200 HeapNumberValueIndexConstant(), value, heap_number, control);
201 return graph()->NewNode(common()->Finish(1), heap_number, store); 201 return graph()->NewNode(common()->Finish(1), heap_number, store);
202 } 202 }
203 203
204 } // namespace compiler 204 } // namespace compiler
205 } // namespace internal 205 } // namespace internal
206 } // namespace v8 206 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698