| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |