Replies: 8 comments
-
Tagging subscribers to this area: @tannergooding Issue DetailsCan we have generalised intrinsic which are not dependent on any particular platform. This can follow the approach used in SIMDe but not limited to SIMD instructions. Also the intrinsic can be more generalised.
|
Beta Was this translation helpful? Give feedback.
-
Is Use SIMD-accelerated numeric types something you have in mind? |
Beta Was this translation helpful? Give feedback.
-
What I had in mind is having additional functionality in |
Beta Was this translation helpful? Give feedback.
-
Assuming that intrinsics implemented by any given platform are higher performance than doing the same work without them because otherwise there would be no reason for their existence, what is the benefit of doing what you suggest? It would allow you to write more complex code that ran slower and that doesn't seem helpful. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Intrinsics code should always be written with general fallbacks and guarded by availability checks. A good example of this is the string comparison code in .net 5. The downside of this is that there are multiple code paths for the same operation, the upside is that each variation is entirely optimized for the instructions that are available to it. If the only version that were provided is the most intrinsic heavy version then the versions of that code compiled with partial hardware support for the required operations could still be slower than a hand optimized version. To users the reason for the speed differences wouldn't be clear and the code would be the most complex version possible rather than it being obvious that there were multiple strategies depending on the available hardware. Given that all intrinsics code must be new since the feature is relatively recent there is no large body of code which needs to be brought into the new runtime via compatibility layers. Intrinsics are optional and an advanced use case for highly optimized scenarios.
Where possible the exposed api surface is made sensible and reviewed in excruciating depth by the api design review team. It's exposing very complex instructions and behaviours though so there isn't a simple way to abstract them and maintain the ability to lookup the vendor supplied documentation. |
Beta Was this translation helpful? Give feedback.
-
Of all intrinsic APIs (which is approx. 1500-2000 methods, including overloads) there is a limited subset that can be represented as "general-purpose" APIs and that is essentially what is exposed today via The functionality that isn't exposed either isn't easy to express cross-platform or may not be possible to expose on I have a backlog item to create a proposal for similar functionality on |
Beta Was this translation helpful? Give feedback.
-
You can use an approach like what SIMDe but not limited to SIMD where there is support of bittwidling, parallel programming, string and array manipulation, memory management, memory model related intrinsics, etc. Where possible there should be a generalised methods which may or may-not map into platform specific intrinsics. Platform specific intrinsics should always have a fall back. Maybe you can borrow some of this code from SIMDe and perhaps upstream it also. Again intrisics need not be limited to SIMD. |
Beta Was this translation helpful? Give feedback.
-
Can we have generalised intrinsic which are not dependent on any particular platform. This can follow the approach used in SIMDe but not limited to SIMD instructions. Also the intrinsic can be more generalised. Also there should be a generic or platform specific fall back for platforms which do not directly support a particular intrinsic.
Beta Was this translation helpful? Give feedback.
All reactions