@@ -1139,6 +1139,8 @@ EECodeGenManager::EECodeGenManager()
11391139EEJitManager::EEJitManager ()
11401140 : m_CPUCompileFlags()
11411141 , m_JitLoadLock( CrstSingleUseLock )
1142+ , m_vectorTByteLength(0 )
1143+ , m_useScalableVectorT(false )
11421144{
11431145 CONTRACTL {
11441146 THROWS;
@@ -1546,35 +1548,49 @@ void EEJitManager::SetCpuInfo()
15461548#endif // TARGET_X86 || TARGET_AMD64
15471549
15481550 m_CPUCompileFlags = CPUCompileFlags;
1549- }
15501551
1551- uint32_t EEJitManager::GetSizeOfVectorT ()
1552- {
1553- LIMITED_METHOD_CONTRACT;
1554-
1555- uint32_t size = 0 ;
1552+ m_useScalableVectorT = false ;
1553+ m_vectorTByteLength = 0 ;
15561554
15571555#if defined(TARGET_X86) || defined(TARGET_AMD64)
15581556 if (m_CPUCompileFlags.IsSet (InstructionSet_VectorT512))
15591557 {
1560- length = 64 ;
1558+ m_vectorTByteLength = 64 ;
15611559 }
1562- else if (CPUCompileFlags .IsSet (InstructionSet_VectorT256))
1560+ else if (m_CPUCompileFlags .IsSet (InstructionSet_VectorT256))
15631561 {
1564- length = 32 ;
1562+ m_vectorTByteLength = 32 ;
1563+ }
1564+ else if (m_CPUCompileFlags.IsSet (InstructionSet_VectorT128))
1565+ {
1566+ m_vectorTByteLength = 16 ;
15651567 }
15661568#elif defined(TARGET_ARM64)
1567- if (UseScalableVectorT ( ))
1569+ if (m_CPUCompileFlags. IsSet (InstructionSet_VectorT128 ))
15681570 {
1569- size = ( uint32_t ) GetSveLengthFromOS () ;
1571+ m_vectorTByteLength = 16 ;
15701572 }
1571- else if (m_CPUCompileFlags.IsSet (InstructionSet_VectorT128))
1573+
1574+ if (CLRConfig::GetConfigValue (CLRConfig::EXTERNAL_JitUseScalableVectorT)
1575+ && m_CPUCompileFlags.IsSet (InstructionSet_Sve_Arm64))
15721576 {
1573- size = 16 ;
1577+ uint64_t sveLengthFromOS = GetSveLengthFromOS ();
1578+ if (sveLengthFromOS != 0 )
1579+ {
1580+ m_useScalableVectorT = true ;
1581+ m_vectorTByteLength = static_cast <uint32_t >(sveLengthFromOS);
1582+ }
15741583 }
15751584#endif
15761585
1577- return size;
1586+ g_vectorTByteLength = m_vectorTByteLength;
1587+ g_vectorTIsScalable = m_useScalableVectorT ? 1 : 0 ;
1588+ }
1589+
1590+ uint32_t EEJitManager::GetSizeOfVectorT () const
1591+ {
1592+ LIMITED_METHOD_DAC_CONTRACT;
1593+ return m_vectorTByteLength;
15781594}
15791595
15801596// Define some data that we can use to get a better idea of what happened when we get a Watson dump that indicates the JIT failed to load.
0 commit comments