diff options
| author | 2017-07-13 20:00:20 +0000 | |
|---|---|---|
| committer | 2017-07-13 20:00:20 +0000 | |
| commit | 99d50e80f3d186c9ae19736b9b224ee319d936f9 (patch) | |
| tree | fd6c930adcb2f55f3aa16201f16917fcdb8a34fb /compiler/optimizing/loop_optimization.cc | |
| parent | 2a77a6341e4db51ca372460b64051b55509fc2f6 (diff) | |
| parent | 51765b098301fff1897361b2d1a21af356d9d6d8 (diff) | |
Merge "MIPS32: ART Vectorizer"
Diffstat (limited to 'compiler/optimizing/loop_optimization.cc')
| -rw-r--r-- | compiler/optimizing/loop_optimization.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc index 83f31c77d3..422e58debb 100644 --- a/compiler/optimizing/loop_optimization.cc +++ b/compiler/optimizing/loop_optimization.cc @@ -1171,7 +1171,32 @@ bool HLoopOptimization::TrySetVectorType(Primitive::Type type, uint64_t* restric } return false; case kMips: - // TODO: implement MIPS SIMD. + if (features->AsMipsInstructionSetFeatures()->HasMsa()) { + switch (type) { + case Primitive::kPrimBoolean: + case Primitive::kPrimByte: + *restrictions |= kNoDiv; + return TrySetVectorLength(16); + case Primitive::kPrimChar: + case Primitive::kPrimShort: + *restrictions |= kNoDiv | kNoStringCharAt; + return TrySetVectorLength(8); + case Primitive::kPrimInt: + *restrictions |= kNoDiv; + return TrySetVectorLength(4); + case Primitive::kPrimLong: + *restrictions |= kNoDiv; + return TrySetVectorLength(2); + case Primitive::kPrimFloat: + *restrictions |= kNoMinMax; // min/max(x, NaN) + return TrySetVectorLength(4); + case Primitive::kPrimDouble: + *restrictions |= kNoMinMax; // min/max(x, NaN) + return TrySetVectorLength(2); + default: + break; + } // switch type + } return false; case kMips64: if (features->AsMips64InstructionSetFeatures()->HasMsa()) { |