-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Consider a new flag COMPlus_EnableVEX #10808
Comments
Additional ThoughtsJust I would imagine that its primary use-case is actually to control whether 128-bit or 256-bit instructions are used for Some scenarios I am thinking of are:
|
CC. @CarolEidt, @eerhardt, @fiigii |
As you point out, |
I agree, this could get complicated depending on how the Simd.cpp code is setup. I think, a good place to be in (ignoring the cost to get there) would be:
The first matters because of all the various ISAs that use VEX, and because it is a generally more efficient encoding. The second matters because The third, we need for debugging HWIntrinsics as we bring them online. It could be provided in release mode if we thought that was a good idea and we also provided one for each other HWIntrinsics ISA. |
Decoupling HW intrinsic from |
@fiigii, I believe so. |
Hmmm, not sure about that. The complexity, if any, I think would arise from dealing with this in the VM, which is where the size of Also, I don't think we can make |
I wouldn't expect that to be very complicated (the code controlling that appears trivial): See https://github.com/dotnet/coreclr/blob/master/src/vm/methodtablebuilder.cpp#L1201 I was more worried about the FEATURE_SIMD/EnableAVX coupling that may make parts of simd.cpp emit 256-bit instructions even if the size were set to 16 (since EnableAVX currently controls both).
Right, although I think there are other issues here with regards to its setup and controlling the Vector size, which may need to be addressed when more sizes become supported. When ARM gets larger Vector support, it would be really strange to control it via
|
It would be better if we also expose HW intrinsic knobs ( |
I think we need to make a strong case for either 1) making a breaking change, or 2) exposing more knobs in release mode. |
For making a breaking change to
Splitting this into two release mode flags would solve the majority of these issues and reduce end-user confusion as support expands/grows:
|
If we make these cross-platfom variables and decouple |
None of these are HWIntrinsic specific knobs, only the
|
I think it is fine to make
I don't think that's necessarily true. We can still have additional options controlling the maximum size of I think your proposal is quite reasonable, but I don't see that it in any way depends upon changing or eliminating |
@CarolEidt, could you clarify on a couple of points? It sounds like, at the high level, you suggest we keep
|
Yes to the above
I would say that a value of 1 indicates
Yes, that's right.
The latter (disable anything depending on AVX).
It should only impact the AVX instruction set, I would think. Again, while this might be considered a "breaking change", since the hw intrinsics are new there's really nothing to break. |
Would that be possible to also expose this flag per application? Eg. some item in app.config or alike, rather than system-wide with env. variables. I believe having this flag tunable for specific application may provide better support experience. |
Proposal
Introduce a new flag (
COMPlus_EnableVEX
) and make some minor changes to the existing flag (COMPlus_EnableAVX
).Rationale
Prior to the HWIntrinsics feature, the
COMPlus_EnableAVX
flag only controlled support for AVX/AVX2 (which it did by enabling/disabling the VEX-encoding path in the emitter).However, now that HWIntrinsics exist, there are a number of additional ISAs that are impacted by this flag (BMI1, BMI2, FMA). Since this flag now controls more than its original scope, and that may cause additional confusion later on, we should instead split the functionality into separate logical flags before the HWIntrinsics feature ships.
Changes
Introduce
COMPlus_EnableVEX
, this would control whether or not the VEX-encoding is support by the emitter. It would impact all ISAs that use the VEX encoding.Change
COMPlus_EnableAVX
to only control the AVX/AVX2 ISAs.category:testing
theme:emitter
skill-level:beginner
cost:small
impact:small
The text was updated successfully, but these errors were encountered: