} while (0)
+#define ASSEMBLE_FLOAT_MAX(scratch_reg) \
+ do { \
+ __ fsub(scratch_reg, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
+ __ fsel(i.OutputDoubleRegister(), scratch_reg, i.InputDoubleRegister(0), \
+ i.InputDoubleRegister(1)); \
+ } while (0)
+
+
+#define ASSEMBLE_FLOAT_MIN(scratch_reg) \
+ do { \
+ __ fsub(scratch_reg, i.InputDoubleRegister(0), i.InputDoubleRegister(1)); \
+ __ fsel(i.OutputDoubleRegister(), scratch_reg, i.InputDoubleRegister(1), \
+ i.InputDoubleRegister(0)); \
+ } while (0)
+
+
#define ASSEMBLE_LOAD_FLOAT(asm_instr, asm_instrx) \
do { \
DoubleRegister result = i.OutputDoubleRegister(); \
case kPPC_Neg64:
__ neg(i.OutputRegister(), i.InputRegister(0), LeaveOE, i.OutputRCBit());
break;
+ case kPPC_MaxFloat64:
+ ASSEMBLE_FLOAT_MAX(kScratchDoubleReg);
+ break;
+ case kPPC_MinFloat64:
+ ASSEMBLE_FLOAT_MIN(kScratchDoubleReg);
+ break;
case kPPC_SqrtFloat64:
ASSEMBLE_FLOAT_UNOP_RC(fsqrt);
break;
}
-void InstructionSelector::VisitFloat64Max(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Max(Node* node) {
+ VisitRRRFloat64(this, node, kPPC_MaxFloat64);
+}
-void InstructionSelector::VisitFloat64Min(Node* node) { UNREACHABLE(); }
+void InstructionSelector::VisitFloat64Min(Node* node) {
+ VisitRRRFloat64(this, node, kPPC_MinFloat64);
+}
void InstructionSelector::VisitFloat64Sqrt(Node* node) {
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
- return MachineOperatorBuilder::kFloat64RoundDown |
+ return MachineOperatorBuilder::kFloat64Max |
+ MachineOperatorBuilder::kFloat64Min |
+ MachineOperatorBuilder::kFloat64RoundDown |
MachineOperatorBuilder::kFloat64RoundTruncate |
MachineOperatorBuilder::kFloat64RoundTiesAway;
// We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f.