__ sqrt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
}
+ case kMipsMaxS:
+ __ max_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
+ case kMipsMinS:
+ __ min_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
case kMipsCmpD:
// Psuedo-instruction used for FP cmp/branch. No opcode emitted here.
break;
__ sqrt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
}
+ case kMipsMaxD:
+ __ max_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
+ case kMipsMinD:
+ __ min_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
case kMipsFloat64RoundDown: {
ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(floor_l_d, Floor);
break;
V(MipsModS) \
V(MipsAbsS) \
V(MipsSqrtS) \
+ V(MipsMaxS) \
+ V(MipsMinS) \
V(MipsCmpD) \
V(MipsAddD) \
V(MipsSubD) \
V(MipsModD) \
V(MipsAbsD) \
V(MipsSqrtD) \
+ V(MipsMaxD) \
+ V(MipsMinD) \
V(MipsFloat64RoundDown) \
V(MipsFloat64RoundTruncate) \
V(MipsFloat64RoundUp) \
}
-void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat32Max(Node* node) {
+ DCHECK(kArchVariant == kMips32r6);
+ VisitRRR(this, kMipsMaxS, node);
+}
-void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Max(Node* node) {
+ DCHECK(kArchVariant == kMips32r6);
+ VisitRRR(this, kMipsMaxD, node);
+}
-void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat32Min(Node* node) {
+ DCHECK(kArchVariant == kMips32r6);
+ VisitRRR(this, kMipsMinS, node);
+}
-void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Min(Node* node) {
+ DCHECK(kArchVariant == kMips32r6);
+ VisitRRR(this, kMipsMinD, node);
+}
void InstructionSelector::VisitFloat32Abs(Node* node) {
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags;
+ if (IsMipsArchVariant(kMips32r6)) {
+ flags |= MachineOperatorBuilder::kFloat32Max |
+ MachineOperatorBuilder::kFloat32Min |
+ MachineOperatorBuilder::kFloat64Max |
+ MachineOperatorBuilder::kFloat64Min;
+ }
if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) &&
IsFp64Mode()) {
flags |= MachineOperatorBuilder::kFloat64RoundDown |
__ sqrt_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
}
+ case kMips64MaxS:
+ __ max_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
+ case kMips64MinS:
+ __ min_s(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
case kMips64CmpD:
// Psuedo-instruction used for FP cmp/branch. No opcode emitted here.
break;
__ sqrt_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
break;
}
+ case kMips64MaxD:
+ __ max_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
+ case kMips64MinD:
+ __ min_d(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
+ i.InputDoubleRegister(1));
+ break;
case kMips64Float64RoundDown: {
ASSEMBLE_ROUND_DOUBLE_TO_DOUBLE(floor_l_d, Floor);
break;
V(Mips64ModS) \
V(Mips64AbsS) \
V(Mips64SqrtS) \
+ V(Mips64MaxS) \
+ V(Mips64MinS) \
V(Mips64CmpD) \
V(Mips64AddD) \
V(Mips64SubD) \
V(Mips64ModD) \
V(Mips64AbsD) \
V(Mips64SqrtD) \
+ V(Mips64MaxD) \
+ V(Mips64MinD) \
V(Mips64Float64RoundDown) \
V(Mips64Float64RoundTruncate) \
V(Mips64Float64RoundUp) \
}
-void InstructionSelector::VisitFloat32Max(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat32Max(Node* node) {
+ DCHECK(kArchVariant == kMips64r6);
+ VisitRRR(this, kMips64MaxS, node);
+}
-void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Max(Node* node) {
+ DCHECK(kArchVariant == kMips64r6);
+ VisitRRR(this, kMips64MaxD, node);
+}
-void InstructionSelector::VisitFloat32Min(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat32Min(Node* node) {
+ DCHECK(kArchVariant == kMips64r6);
+ VisitRRR(this, kMips64MinS, node);
+}
-void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Min(Node* node) {
+ DCHECK(kArchVariant == kMips64r6);
+ VisitRRR(this, kMips64MinD, node);
+}
void InstructionSelector::VisitFloat32Abs(Node* node) {
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
- return MachineOperatorBuilder::kFloat64RoundDown |
- MachineOperatorBuilder::kFloat64RoundTruncate;
+ MachineOperatorBuilder::Flags flags =
+ MachineOperatorBuilder::kFloat64RoundDown |
+ MachineOperatorBuilder::kFloat64RoundTruncate;
+ if (kArchVariant == kMips64r6) {
+ flags |= MachineOperatorBuilder::kFloat32Max |
+ MachineOperatorBuilder::kFloat32Min |
+ MachineOperatorBuilder::kFloat64Max |
+ MachineOperatorBuilder::kFloat64Min;
+ }
+ return flags;
}
} // namespace compiler