diff options
author | 2017-06-22 13:49:59 +0200 | |
---|---|---|
committer | 2017-07-13 10:34:27 +0200 | |
commit | 51765b098301fff1897361b2d1a21af356d9d6d8 (patch) | |
tree | 5d35468c9ecd428803fe7e4339fb8e251b6ed926 /compiler/optimizing/loop_optimization.cc | |
parent | e63a91111d13f33028c2988ded53a4659140ca2e (diff) |
MIPS32: ART Vectorizer
MIPS32 implementation which uses MSA extension.
Note: Testing is done with checker parts of tests 640, 645, 646 and
651, locally changed to cover MIPS32 cases. These changes can't
be included in this patch since MSA is not a default option.
Test: ./testrunner.py --target --optimizing -j1 in QEMU (mips32r6)
Change-Id: Ieba28f94c48c943d5444017bede9a5d409149762
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()) { |