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

Side by Side Diff: src/compiler/mips64/instruction-selector-mips64.cc

Issue 1356913002: [turbofan] Add support for reinterpreting integers as floating point and vice versa. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename ReinterpretAs to BitcastTo Created 5 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
« no previous file with comments | « src/compiler/mips64/instruction-codes-mips64.h ('k') | src/compiler/opcodes.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 #include "src/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 switch (TruncationModeOf(node->op())) { 571 switch (TruncationModeOf(node->op())) {
572 case TruncationMode::kJavaScript: 572 case TruncationMode::kJavaScript:
573 return VisitRR(this, kArchTruncateDoubleToI, node); 573 return VisitRR(this, kArchTruncateDoubleToI, node);
574 case TruncationMode::kRoundToZero: 574 case TruncationMode::kRoundToZero:
575 return VisitRR(this, kMips64TruncWD, node); 575 return VisitRR(this, kMips64TruncWD, node);
576 } 576 }
577 UNREACHABLE(); 577 UNREACHABLE();
578 } 578 }
579 579
580 580
581 void InstructionSelector::VisitBitcastFloat32ToInt32(Node* node) {
582 VisitRR(this, kMips64Float64ExtractLowWord32, node);
583 }
584
585
586 void InstructionSelector::VisitBitcastFloat64ToInt64(Node* node) {
587 VisitRR(this, kMips64BitcastDL, node);
588 }
589
590
591 void InstructionSelector::VisitBitcastInt32ToFloat32(Node* node) {
592 Mips64OperandGenerator g(this);
593 Emit(kMips64Float64InsertLowWord32, g.DefineAsRegister(node),
594 ImmediateOperand(ImmediateOperand::INLINE, 0),
595 g.UseRegister(node->InputAt(0)));
596 }
597
598
599 void InstructionSelector::VisitBitcastInt64ToFloat64(Node* node) {
600 VisitRR(this, kMips64BitcastLD, node);
601 }
602
603
581 void InstructionSelector::VisitFloat32Add(Node* node) { 604 void InstructionSelector::VisitFloat32Add(Node* node) {
582 VisitRRR(this, kMips64AddS, node); 605 VisitRRR(this, kMips64AddS, node);
583 } 606 }
584 607
585 608
586 void InstructionSelector::VisitFloat64Add(Node* node) { 609 void InstructionSelector::VisitFloat64Add(Node* node) {
587 VisitRRR(this, kMips64AddD, node); 610 VisitRRR(this, kMips64AddD, node);
588 } 611 }
589 612
590 613
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 } 1347 }
1325 1348
1326 1349
1327 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { 1350 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
1328 FlagsContinuation cont(kUnsignedLessThanOrEqual, node); 1351 FlagsContinuation cont(kUnsignedLessThanOrEqual, node);
1329 VisitFloat64Compare(this, node, &cont); 1352 VisitFloat64Compare(this, node, &cont);
1330 } 1353 }
1331 1354
1332 1355
1333 void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) { 1356 void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) {
1334 Mips64OperandGenerator g(this); 1357 VisitRR(this, kMips64Float64ExtractLowWord32, node);
1335 Emit(kMips64Float64ExtractLowWord32, g.DefineAsRegister(node),
1336 g.UseRegister(node->InputAt(0)));
1337 } 1358 }
1338 1359
1339 1360
1340 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) { 1361 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
1341 Mips64OperandGenerator g(this); 1362 VisitRR(this, kMips64Float64ExtractHighWord32, node);
1342 Emit(kMips64Float64ExtractHighWord32, g.DefineAsRegister(node),
1343 g.UseRegister(node->InputAt(0)));
1344 } 1363 }
1345 1364
1346 1365
1347 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) { 1366 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
1348 Mips64OperandGenerator g(this); 1367 Mips64OperandGenerator g(this);
1349 Node* left = node->InputAt(0); 1368 Node* left = node->InputAt(0);
1350 Node* right = node->InputAt(1); 1369 Node* right = node->InputAt(1);
1351 Emit(kMips64Float64InsertLowWord32, g.DefineSameAsFirst(node), 1370 Emit(kMips64Float64InsertLowWord32, g.DefineSameAsFirst(node),
1352 g.UseRegister(left), g.UseRegister(right)); 1371 g.UseRegister(left), g.UseRegister(right));
1353 } 1372 }
(...skipping 11 matching lines...) Expand all
1365 // static 1384 // static
1366 MachineOperatorBuilder::Flags 1385 MachineOperatorBuilder::Flags
1367 InstructionSelector::SupportedMachineOperatorFlags() { 1386 InstructionSelector::SupportedMachineOperatorFlags() {
1368 return MachineOperatorBuilder::kFloat64RoundDown | 1387 return MachineOperatorBuilder::kFloat64RoundDown |
1369 MachineOperatorBuilder::kFloat64RoundTruncate; 1388 MachineOperatorBuilder::kFloat64RoundTruncate;
1370 } 1389 }
1371 1390
1372 } // namespace compiler 1391 } // namespace compiler
1373 } // namespace internal 1392 } // namespace internal
1374 } // namespace v8 1393 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/instruction-codes-mips64.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698