diff options
| author | 2018-12-18 08:51:24 +0000 | |
|---|---|---|
| committer | 2018-12-18 08:51:24 +0000 | |
| commit | c9456fe943b9f41dc3409debfef047e871bae8fa (patch) | |
| tree | 7bfe21de314dbaa6973f8d9ecf6142b7e872bb48 | |
| parent | ea1550c1722a283ce6b7f87027c51d5c078d202b (diff) | |
| parent | 37346c5c7bcdd1c4532d90fd3089341b22152048 (diff) | |
Merge changes Iec59c32f,If2f4b65e
* changes:
ART: Correct attributes of CRC32Update intrinsic
ART: Optimize use of registers for CRC32.update intrinsic
| -rw-r--r-- | compiler/optimizing/intrinsics_arm64.cc | 12 | ||||
| -rw-r--r-- | runtime/intrinsics_list.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc index 1688ea7811..0b17c9d27e 100644 --- a/compiler/optimizing/intrinsics_arm64.cc +++ b/compiler/optimizing/intrinsics_arm64.cc @@ -2927,7 +2927,7 @@ void IntrinsicLocationsBuilderARM64::VisitCRC32Update(HInvoke* invoke) { locations->SetInAt(0, Location::RequiresRegister()); locations->SetInAt(1, Location::RequiresRegister()); - locations->SetOut(Location::RequiresRegister()); + locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap); } // Lower the invoke of CRC32.update(int crc, int b). @@ -2945,9 +2945,13 @@ void IntrinsicCodeGeneratorARM64::VisitCRC32Update(HInvoke* invoke) { // result = crc32_for_byte(crc, b) // crc = ~result // It is directly lowered to three instructions. - __ Mvn(out, crc); - __ Crc32b(out, out, val); - __ Mvn(out, out); + + UseScratchRegisterScope temps(masm); + Register tmp = temps.AcquireSameSizeAs(out); + + __ Mvn(tmp, crc); + __ Crc32b(tmp, tmp, val); + __ Mvn(out, tmp); } // The threshold for sizes of arrays to use the library provided implementation diff --git a/runtime/intrinsics_list.h b/runtime/intrinsics_list.h index 82ea47609b..db43b243df 100644 --- a/runtime/intrinsics_list.h +++ b/runtime/intrinsics_list.h @@ -219,7 +219,7 @@ V(VarHandleLoadLoadFence, kStatic, kNeedsEnvironmentOrCache, kWriteSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "loadLoadFence", "()V") \ V(VarHandleStoreStoreFence, kStatic, kNeedsEnvironmentOrCache, kReadSideEffects, kNoThrow, "Ljava/lang/invoke/VarHandle;", "storeStoreFence", "()V") \ V(ReachabilityFence, kStatic, kNeedsEnvironmentOrCache, kWriteSideEffects, kNoThrow, "Ljava/lang/ref/Reference;", "reachabilityFence", "(Ljava/lang/Object;)V") \ - V(CRC32Update, kStatic, kNeedsEnvironmentOrCache, kReadSideEffects, kCanThrow, "Ljava/util/zip/CRC32;", "update", "(II)I") \ + V(CRC32Update, kStatic, kNeedsEnvironmentOrCache, kNoSideEffects, kNoThrow, "Ljava/util/zip/CRC32;", "update", "(II)I") \ V(CRC32UpdateBytes, kStatic, kNeedsEnvironmentOrCache, kReadSideEffects, kCanThrow, "Ljava/util/zip/CRC32;", "updateBytes", "(I[BII)I") \ SIGNATURE_POLYMORPHIC_INTRINSICS_LIST(V) |