-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to change SVE vector length for current and children processes #101295
Changes from 10 commits
1393c30
2c040a7
19dce8d
22aa47e
43ece1e
9140d82
aca2809
1d14227
23dda80
c080aad
a0c5247
4c0ffa7
aaeb733
8b07210
c0a6910
528e157
63a2be8
ec0c317
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,10 @@ Module Name: | |
#include "gcinfo.h" | ||
#include "eexcp.h" | ||
|
||
#if defined(TARGET_ARM64) | ||
extern "C" DWORD64 __stdcall GetSveLengthFromOS(); | ||
jkotas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#endif | ||
|
||
class MethodDesc; | ||
class ICorJitCompiler; | ||
class IJitManager; | ||
|
@@ -1912,6 +1916,16 @@ protected : | |
return m_CPUCompileFlags; | ||
} | ||
|
||
#if defined(TARGET_ARM64) && !defined(_MSC_VER) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need of this anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need an "sve" attribute for GNUC builds. Not sure if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can only test on Arm64 host with Linux base systems at the moment so have to spam this CI for other build combinations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You do not need this definition because you will be using the one that is defined in asmhelpers.* files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apologies for the delay in responding. It doesn't compile after removing the definition of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you looked into using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SwapnilGaikwad - are you planning to try what @jkotas is suggesting? |
||
__attribute__((target("sve"))) | ||
inline UINT64 GetSveLengthFromOS() | ||
{ | ||
UINT64 size; | ||
__asm__ __volatile__("rdvl %0, #1" : "=r"(size)); | ||
return size; | ||
} | ||
#endif // TARGET_ARM64 | ||
|
||
private: | ||
bool m_storeRichDebugInfo; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed here and the same for the ifdef in the other file? I thought that
asmhelpers.S
was exclusively used by non-MSVC andasmhelpers.asm
was exclusively used by MSVC (or rather MASM) and so there wasn't a need for such ifdefs (and why we don't have them elsewhere in these files)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I don't think
_MSC_VER
is needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the call to this method is guarded under
if (SVE)
, I am actually wondering the implications of calling it by someone without having this check? Is there a way to full proof this to return 0 or something if ran on non-sve arm64 machines?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, Arm64 doesn't have a user-mode way of checking CPU feature support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So basically, if someone calls this method unintentionally, on non-sve arm64, they would just hit "Internal error", which is a fair thing to be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, I didn't know which one was used by MSVC and non-MSVC. In this case, we need to remove the non-MSVC bits from .S file because we need the "sve" attribute to compile it.