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

Unified Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 680833005: MIPS: Add floor, ceil, round (truncate) instructions for ia32, x64 (if SSE4.1) and add floor, ceil,… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: supported on r6 also. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/mips/instruction-codes-mips.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/mips/instruction-selector-mips.cc
diff --git a/src/compiler/mips/instruction-selector-mips.cc b/src/compiler/mips/instruction-selector-mips.cc
index 637d98b7849773d90d2bca1fd1be592fc6f5dac3..be792b5f28dc5f4989e093af7d89111b47e53f05 100644
--- a/src/compiler/mips/instruction-selector-mips.cc
+++ b/src/compiler/mips/instruction-selector-mips.cc
@@ -56,6 +56,14 @@ class MipsOperandGenerator FINAL : public OperandGenerator {
};
+static void VisitRR(InstructionSelector* selector, ArchOpcode opcode,
+ Node* node) {
+ MipsOperandGenerator g(selector);
+ selector->Emit(opcode, g.DefineAsRegister(node),
+ g.UseRegister(node->InputAt(0)));
+}
+
+
static void VisitRRR(InstructionSelector* selector, ArchOpcode opcode,
Node* node) {
MipsOperandGenerator g(selector);
@@ -409,14 +417,18 @@ void InstructionSelector::VisitFloat64Sqrt(Node* node) {
}
-void InstructionSelector::VisitFloat64Floor(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Floor(Node* node) {
+ VisitRR(this, kMipsFloorD, node);
+}
-void InstructionSelector::VisitFloat64Ceil(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Ceil(Node* node) {
+ VisitRR(this, kMipsCeilD, node);
+}
void InstructionSelector::VisitFloat64RoundTruncate(Node* node) {
- UNREACHABLE();
+ VisitRR(this, kMipsRoundTruncateD, node);
}
@@ -667,10 +679,18 @@ void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) {
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
- return MachineOperatorBuilder::kInt32DivIsSafe |
- MachineOperatorBuilder::kInt32ModIsSafe |
- MachineOperatorBuilder::kUint32DivIsSafe |
- MachineOperatorBuilder::kUint32ModIsSafe;
+ MachineOperatorBuilder::Flags flags =
+ MachineOperatorBuilder::kInt32DivIsSafe |
+ MachineOperatorBuilder::kInt32ModIsSafe |
+ MachineOperatorBuilder::kUint32DivIsSafe |
+ MachineOperatorBuilder::kUint32ModIsSafe;
+
+ if (CpuFeatures::IsSupported(MIPSr2) || CpuFeatures::IsSupported(MIPSr6)) {
+ flags |= MachineOperatorBuilder::kFloat64Floor |
+ MachineOperatorBuilder::kFloat64Ceil |
+ MachineOperatorBuilder::kFloat64RoundTruncate;
+ }
+ return flags;
}
} // namespace compiler
« no previous file with comments | « src/compiler/mips/instruction-codes-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698