| Index: src/compiler/mips64/code-generator-mips64.cc
|
| diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc
|
| index b3f8088e55f1403308399881dce3a64723a8c4c0..a8bcb53b9696856a59f705e5c5b03857c1b9a8c2 100644
|
| --- a/src/compiler/mips64/code-generator-mips64.cc
|
| +++ b/src/compiler/mips64/code-generator-mips64.cc
|
| @@ -264,8 +264,8 @@ Condition FlagsConditionToConditionOvf(FlagsCondition condition) {
|
| }
|
|
|
|
|
| -FPUCondition FlagsConditionToConditionCmpD(bool& predicate,
|
| - FlagsCondition condition) {
|
| +FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate,
|
| + FlagsCondition condition) {
|
| switch (condition) {
|
| case kEqual:
|
| predicate = true;
|
| @@ -1061,22 +1061,33 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
|
| cc = FlagsConditionToConditionCmp(condition);
|
| __ Branch(USE_DELAY_SLOT, &done, cc, left, right);
|
| __ li(result, Operand(1)); // In delay slot.
|
| - } else if (instr->arch_opcode() == kMips64CmpD) {
|
| + } else if (instr->arch_opcode() == kMips64CmpD ||
|
| + instr->arch_opcode() == kMips64CmpS) {
|
| FPURegister left = i.InputDoubleRegister(0);
|
| FPURegister right = i.InputDoubleRegister(1);
|
|
|
| bool predicate;
|
| - FPUCondition cc = FlagsConditionToConditionCmpD(predicate, condition);
|
| + FPUCondition cc = FlagsConditionToConditionCmpFPU(predicate, condition);
|
| if (kArchVariant != kMips64r6) {
|
| __ li(result, Operand(1));
|
| - __ c(cc, D, left, right);
|
| + if (instr->arch_opcode() == kMips64CmpD) {
|
| + __ c(cc, D, left, right);
|
| + } else {
|
| + DCHECK(instr->arch_opcode() == kMips64CmpS);
|
| + __ c(cc, S, left, right);
|
| + }
|
| if (predicate) {
|
| __ Movf(result, zero_reg);
|
| } else {
|
| __ Movt(result, zero_reg);
|
| }
|
| } else {
|
| - __ cmp(cc, L, kDoubleCompareReg, left, right);
|
| + if (instr->arch_opcode() == kMips64CmpD) {
|
| + __ cmp(cc, L, kDoubleCompareReg, left, right);
|
| + } else {
|
| + DCHECK(instr->arch_opcode() == kMips64CmpS);
|
| + __ cmp(cc, W, kDoubleCompareReg, left, right);
|
| + }
|
| __ dmfc1(at, kDoubleCompareReg);
|
| __ dsrl32(result, at, 31); // Cmp returns all 1s for true.
|
| if (!predicate) // Toggle result for not equal.
|
|
|