| Index: src/compiler/arm64/code-generator-arm64.cc
|
| diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc
|
| index 52d61367a49c3c63a6732626cf92ada2ba4bc795..521ed02a3a8cbab0a0ca6b6aed780445c7a4fe53 100644
|
| --- a/src/compiler/arm64/code-generator-arm64.cc
|
| +++ b/src/compiler/arm64/code-generator-arm64.cc
|
| @@ -821,13 +821,17 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| __ Fdiv(i.OutputFloat32Register(), i.InputFloat32Register(0),
|
| i.InputFloat32Register(1));
|
| break;
|
| - case kArm64Float32Max:
|
| - __ Fmax(i.OutputFloat32Register(), i.InputFloat32Register(0),
|
| - i.InputFloat32Register(1));
|
| + case kArm64Float32TernaryMax:
|
| + // (b < a) ? a : b
|
| + __ Fcmp(i.InputFloat32Register(1), i.InputFloat32Register(0));
|
| + __ Fcsel(i.OutputFloat32Register(), i.InputFloat32Register(0),
|
| + i.InputFloat32Register(1), lo);
|
| break;
|
| - case kArm64Float32Min:
|
| - __ Fmin(i.OutputFloat32Register(), i.InputFloat32Register(0),
|
| - i.InputFloat32Register(1));
|
| + case kArm64Float32TernaryMin:
|
| + // (a < b) ? a : b
|
| + __ Fcmp(i.InputFloat32Register(0), i.InputFloat32Register(1));
|
| + __ Fcsel(i.OutputFloat32Register(), i.InputFloat32Register(0),
|
| + i.InputFloat32Register(1), lo);
|
| break;
|
| case kArm64Float32Abs:
|
| __ Fabs(i.OutputFloat32Register(), i.InputFloat32Register(0));
|
| @@ -872,13 +876,17 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
|
| 0, 2);
|
| break;
|
| }
|
| - case kArm64Float64Max:
|
| - __ Fmax(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
|
| - i.InputDoubleRegister(1));
|
| + case kArm64Float64TernaryMax:
|
| + // (b < a) ? a : b
|
| + __ Fcmp(i.InputDoubleRegister(1), i.InputDoubleRegister(0));
|
| + __ Fcsel(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
|
| + i.InputDoubleRegister(1), lo);
|
| break;
|
| - case kArm64Float64Min:
|
| - __ Fmin(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
|
| - i.InputDoubleRegister(1));
|
| + case kArm64Float64TernaryMin:
|
| + // (a < b) ? a : b
|
| + __ Fcmp(i.InputDoubleRegister(0), i.InputDoubleRegister(1));
|
| + __ Fcsel(i.OutputDoubleRegister(), i.InputDoubleRegister(0),
|
| + i.InputDoubleRegister(1), lo);
|
| break;
|
| case kArm64Float64Abs:
|
| __ Fabs(i.OutputDoubleRegister(), i.InputDoubleRegister(0));
|
|
|