ARM64: Support SVE VL other than 128-bit.
Arm SVE register size is not fixed and can be a
multiple of 128 bits. To support that the patch
removes explicit assumptions on the SIMD register
size to be 128 bit from the vectorizer and code
generators and enables configurable SVE vector
length autovectorization, e.g. extends SIMD register
save/restore routines.
Test: art SIMD tests on VIXL simulator.
Test: art tests on FVP (steps in test/README.arm_fvp.md)
with FVP arg:
-C SVE.ScalableVectorExtension.veclen=[2,4]
(SVE vector [128,256] bits wide)
Change-Id: Icb46e7eb17f21d3bd38b16dd50f735c29b316427
diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h
index eb3e954..d4546e5 100644
--- a/compiler/optimizing/code_generator_arm64.h
+++ b/compiler/optimizing/code_generator_arm64.h
@@ -309,6 +309,10 @@
virtual void LoadSIMDRegFromStack(Location destination, Location source) = 0;
virtual void MoveSIMDRegToSIMDReg(Location destination, Location source) = 0;
virtual void MoveToSIMDStackSlot(Location destination, Location source) = 0;
+ virtual void SaveLiveRegistersHelper(LocationSummary* locations,
+ int64_t spill_offset) = 0;
+ virtual void RestoreLiveRegistersHelper(LocationSummary* locations,
+ int64_t spill_offset) = 0;
protected:
void GenerateClassInitializationCheck(SlowPathCodeARM64* slow_path,
@@ -462,6 +466,8 @@
void LoadSIMDRegFromStack(Location destination, Location source) override;
void MoveSIMDRegToSIMDReg(Location destination, Location source) override;
void MoveToSIMDStackSlot(Location destination, Location source) override;
+ void SaveLiveRegistersHelper(LocationSummary* locations, int64_t spill_offset) override;
+ void RestoreLiveRegistersHelper(LocationSummary* locations, int64_t spill_offset) override;
};
class LocationsBuilderARM64Neon : public LocationsBuilderARM64 {
@@ -495,8 +501,14 @@
void LoadSIMDRegFromStack(Location destination, Location source) override;
void MoveSIMDRegToSIMDReg(Location destination, Location source) override;
void MoveToSIMDStackSlot(Location destination, Location source) override;
+ void SaveLiveRegistersHelper(LocationSummary* locations, int64_t spill_offset) override;
+ void RestoreLiveRegistersHelper(LocationSummary* locations, int64_t spill_offset) override;
private:
+ // Validate that instruction vector length and packed type are compliant with the SIMD
+ // register size (full SIMD register is used).
+ void ValidateVectorLength(HVecOperation* instr) const;
+
// Returns default predicate register which is used as governing vector predicate
// to implement predicated loop execution.
//
@@ -579,9 +591,7 @@
return vixl::aarch64::kDRegSizeInBytes;
}
- size_t GetSIMDRegisterWidth() const override {
- return vixl::aarch64::kQRegSizeInBytes;
- }
+ size_t GetSIMDRegisterWidth() const override;
uintptr_t GetAddressOf(HBasicBlock* block) override {
vixl::aarch64::Label* block_entry_label = GetLabelOf(block);