diff options
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 211c6417c2..911a429d0b 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -775,28 +775,30 @@ static bool CanAssembleGraphForRiscv64(HGraph* graph) { case HInstruction::kAbs: case HInstruction::kBooleanNot: case HInstruction::kMul: + case HInstruction::kNeg: + case HInstruction::kNot: + case HInstruction::kInvokeVirtual: + case HInstruction::kInvokeInterface: + case HInstruction::kCurrentMethod: break; - case HInstruction::kInvokeStaticOrDirect: { - Intrinsics intrinsic = it.Current()->AsInvokeStaticOrDirect()->GetIntrinsic(); - if (intrinsic != Intrinsics::kDoubleDoubleToRawLongBits && - intrinsic != Intrinsics::kDoubleIsInfinite && - intrinsic != Intrinsics::kDoubleLongBitsToDouble && - intrinsic != Intrinsics::kFloatFloatToRawIntBits && - intrinsic != Intrinsics::kFloatIsInfinite && - intrinsic != Intrinsics::kFloatIntBitsToFloat && - intrinsic != Intrinsics::kMemoryPeekByte && - intrinsic != Intrinsics::kMemoryPeekIntNative && - intrinsic != Intrinsics::kMemoryPeekLongNative && - intrinsic != Intrinsics::kMemoryPeekShortNative && - intrinsic != Intrinsics::kMemoryPokeByte && - intrinsic != Intrinsics::kMemoryPokeIntNative && - intrinsic != Intrinsics::kMemoryPokeLongNative && - intrinsic != Intrinsics::kMemoryPokeShortNative) { + case HInstruction::kInvokeStaticOrDirect: + if (it.Current()->AsInvokeStaticOrDirect()->GetCodePtrLocation() == + CodePtrLocation::kCallCriticalNative && + it.Current()->AsInvokeStaticOrDirect()->GetNumberOfArguments() >= 8u) { + // TODO(riscv64): If there are more than 8 FP args, some may be passed in GPRs + // and this requires a `CriticalNativeAbiFixupRiscv64` pass similar to the one + // we have for ARM. This is not yet implemented. For simplicity, we reject all + // direct @CriticalNative calls with more than 8 args. return false; } break; - } - case HInstruction::kCurrentMethod: + case HInstruction::kMin: + case HInstruction::kMax: + if (DataType::IsFloatingPointType(it.Current()->GetType())) { + // FIXME(riscv64): If one of the operands is NaN and the other is not, riscv64 + // FMIN/FMAX yield the non-NaN operand but we want the result to be the NaN operand. + return false; + } break; default: // Unimplemented instruction. |