Skip to content

Commit

Permalink
Arm64/Sve: Enable Sve only if vector length is 128 (#104174)
Browse files Browse the repository at this point in the history
* Enable InstructionSet_Sve only if system VL == 128

* Update src/coreclr/vm/codeman.cpp

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Update src/coreclr/vm/codeman.cpp

* Remove hardcoding of 128 for windows

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
  • Loading branch information
kunalspathak and jkotas authored Jun 28, 2024
1 parent a177d24 commit 7f7bb7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/coreclr/vm/arm64/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@

;; uint64_t GetSveLengthFromOS(void);
LEAF_ENTRY GetSveLengthFromOS
;; TODO-SVE: Remove the hardcoded value 128 and uncomment once CI machines are updated to use MASM 14.4 or later
;; rdvl x0, 1
mov x0, #128
rdvl x0, 1
ret lr
LEAF_END

Expand Down
6 changes: 4 additions & 2 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1514,8 +1514,10 @@ void EEJitManager::SetCpuInfo()
uint32_t maxVectorTLength = (maxVectorTBitWidth / 8);
uint64_t sveLengthFromOS = GetSveLengthFromOS();

// Do not enable SVE when the user specified vector length is smaller than the one offered by underlying OS.
if ((maxVectorTLength >= sveLengthFromOS) || (maxVectorTBitWidth == 0))
// For now, enable SVE only when the system vector length is 128-bits
// TODO: https://github.com/dotnet/runtime/issues/101477
if (sveLengthFromOS == 128)
// if ((maxVectorTLength >= sveLengthFromOS) || (maxVectorTBitWidth == 0))
{
CPUCompileFlags.Set(InstructionSet_Sve);
}
Expand Down

0 comments on commit 7f7bb7b

Please sign in to comment.