| Index: src/compiler/ppc/code-generator-ppc.cc
|
| diff --git a/src/compiler/ppc/code-generator-ppc.cc b/src/compiler/ppc/code-generator-ppc.cc
|
| index 10da77bb9914eb23ca876645466fb6649c320401..a994b53947cc84d85d0d92f570004b3f1df52043 100644
|
| --- a/src/compiler/ppc/code-generator-ppc.cc
|
| +++ b/src/compiler/ppc/code-generator-ppc.cc
|
| @@ -436,15 +436,33 @@ Condition FlagsConditionToCondition(FlagsCondition condition, ArchOpcode op) {
|
| DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
|
| } while (0)
|
|
|
| -#define ASSEMBLE_FLOAT_LOG() \
|
| - do { \
|
| - FrameScope scope(masm(), StackFrame::MANUAL); \
|
| - __ PrepareCallCFunction(0, 1, kScratchReg); \
|
| - __ MovToFloatParameter(i.InputDoubleRegister(0)); \
|
| - __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 0, \
|
| - 1); \
|
| - __ MovFromFloatResult(i.OutputDoubleRegister()); \
|
| - DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
|
| +#define ASSEMBLE_IEEE754_UNOP(name) \
|
| + do { \
|
| + /* TODO(bmeurer): We should really get rid of this special instruction, */ \
|
| + /* and generate a CallAddress instruction instead. */ \
|
| + FrameScope scope(masm(), StackFrame::MANUAL); \
|
| + __ PrepareCallCFunction(0, 1, kScratchReg); \
|
| + __ MovToFloatParameter(i.InputDoubleRegister(0)); \
|
| + __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \
|
| + 0, 1); \
|
| + /* Move the result in the double result register. */ \
|
| + __ MovFromFloatResult(i.OutputDoubleRegister()); \
|
| + DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
|
| + } while (0)
|
| +
|
| +#define ASSEMBLE_IEEE754_BINOP(name) \
|
| + do { \
|
| + /* TODO(bmeurer): We should really get rid of this special instruction, */ \
|
| + /* and generate a CallAddress instruction instead. */ \
|
| + FrameScope scope(masm(), StackFrame::MANUAL); \
|
| + __ PrepareCallCFunction(0, 2, kScratchReg); \
|
| + __ MovToFloatParameters(i.InputDoubleRegister(0), \
|
| + i.InputDoubleRegister(1)); \
|
| + __ CallCFunction(ExternalReference::ieee754_##name##_function(isolate()), \
|
| + 0, 2); \
|
| + /* Move the result in the double result register. */ \
|
| + __ MovFromFloatResult(i.OutputDoubleRegister()); \
|
| + DCHECK_EQ(LeaveRC, i.OutputRCBit()); \
|
| } while (0)
|
|
|
| #define ASSEMBLE_FLOAT_MAX(scratch_reg) \
|
| @@ -1239,10 +1257,17 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
| // and generate a CallAddress instruction instead.
|
| ASSEMBLE_FLOAT_MODULO();
|
| break;
|
| - case kPPC_LogDouble:
|
| - // TODO(bmeurer): We should really get rid of this special instruction,
|
| - // and generate a CallAddress instruction instead.
|
| - ASSEMBLE_FLOAT_LOG();
|
| + case kIeee754Float64Atan:
|
| + ASSEMBLE_IEEE754_UNOP(atan);
|
| + break;
|
| + case kIeee754Float64Atan2:
|
| + ASSEMBLE_IEEE754_BINOP(atan2);
|
| + break;
|
| + case kIeee754Float64Log:
|
| + ASSEMBLE_IEEE754_UNOP(log);
|
| + break;
|
| + case kIeee754Float64Log1p:
|
| + ASSEMBLE_IEEE754_UNOP(log1p);
|
| break;
|
| case kPPC_Neg:
|
| __ neg(i.OutputRegister(), i.InputRegister(0), LeaveOE, i.OutputRCBit());
|
|
|