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

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

Issue 2155323003: [turbofan] Properly handle bit->float64 representation changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Uncement Created 4 years, 5 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
« no previous file with comments | « no previous file | test/cctest/compiler/test-representation-change.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/representation-change.h" 5 #include "src/compiler/representation-change.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 const Operator* op = nullptr; 333 const Operator* op = nullptr;
334 if (IsWord(output_rep)) { 334 if (IsWord(output_rep)) {
335 if (output_type->Is(Type::Signed32())) { 335 if (output_type->Is(Type::Signed32())) {
336 op = machine()->ChangeInt32ToFloat64(); 336 op = machine()->ChangeInt32ToFloat64();
337 } else if (output_type->Is(Type::Unsigned32()) || 337 } else if (output_type->Is(Type::Unsigned32()) ||
338 use_info.truncation().TruncatesToWord32()) { 338 use_info.truncation().TruncatesToWord32()) {
339 // Either the output is uint32 or the uses only care about the 339 // Either the output is uint32 or the uses only care about the
340 // low 32 bits (so we can pick uint32 safely). 340 // low 32 bits (so we can pick uint32 safely).
341 op = machine()->ChangeUint32ToFloat64(); 341 op = machine()->ChangeUint32ToFloat64();
342 } 342 }
343 } else if (output_rep == MachineRepresentation::kBit) {
344 op = machine()->ChangeUint32ToFloat64();
343 } else if (output_rep == MachineRepresentation::kTagged) { 345 } else if (output_rep == MachineRepresentation::kTagged) {
344 if (output_type->Is(Type::Undefined())) { 346 if (output_type->Is(Type::Undefined())) {
345 return jsgraph()->Float64Constant( 347 return jsgraph()->Float64Constant(
346 std::numeric_limits<double>::quiet_NaN()); 348 std::numeric_limits<double>::quiet_NaN());
347 } else if (output_type->Is(Type::TaggedSigned())) { 349 } else if (output_type->Is(Type::TaggedSigned())) {
348 node = InsertChangeTaggedSignedToInt32(node); 350 node = InsertChangeTaggedSignedToInt32(node);
349 op = machine()->ChangeInt32ToFloat64(); 351 op = machine()->ChangeInt32ToFloat64();
350 } else if (output_type->Is(Type::Number())) { 352 } else if (output_type->Is(Type::Number())) {
351 op = simplified()->ChangeTaggedToFloat64(); 353 op = simplified()->ChangeTaggedToFloat64();
352 } else if (output_type->Is(Type::NumberOrOddball())) { 354 } else if (output_type->Is(Type::NumberOrOddball())) {
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 } 809 }
808 810
809 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { 811 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) {
810 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), 812 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(),
811 node); 813 node);
812 } 814 }
813 815
814 } // namespace compiler 816 } // namespace compiler
815 } // namespace internal 817 } // namespace internal
816 } // namespace v8 818 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/compiler/test-representation-change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698