Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement various other simple vector APIs from 93513 (#103837)
* Update Vector<T> to implement ISimdVector<TSelf, T> * Expose various constants for Vector2/3/4 * Expose Exp, Log, and Log2 on the other vector types * Expose CopySign on the vector types * Expose DegreesToRadians and RadiansToDegrees on the vector types * Expose Hypot on the vector types * Expose Lerp on the vector types * Expose Truncate and Round on the vector types * Cleanup some of the implementations to use helper functions where possible * Expose Max, MaxMagnitude, MaxMagnitudeNumber, MaxNumber, Min, MinMagnitude, MinMagnitudeNumber, and MinNumber for the vector types * Expose Clamp on the various vector types * Ensure mono handles the various zero and low-cost vector conversions * Apply formatting patch * Ensure that TensorPrimitives uses the in-box vector operations on .NET 9+ * Fix some build failures * Workaround a MonoJIT assertion * Ensure Hypot for double handles insignificant results * Remove part of the mono changes that were extracted to a separate PR * Apply suggestions from code review Co-authored-by: Stephen Toub <stoub@microsoft.com> * Ensure tests are added for the new vector APIs * Fix the mono handling for IsNaN, IsNegative, and IsPositive * Use the right op for WASM * Fix a round test to correctly expect -0 * Fix some tests where the wrong parameter counts were being passed * Ensure APIs are correctly handled for Vector<T> * Fix the mono handling for OP_XCOMPARE_FP * Have Mono use the proper klass for IsPositive/IsNegative since we're reinterpreting * Ensure Mono looks up the class namespace * Ensure mono inserts xcast where required and handles MultiplyAddEstimate * Add missing underscores to fix the mono build * Add the if is_element_type_primitive check to MultiplyAddEstimate for mono * Pass the right klass on Mono * Ensure mono sets the metadata for add_ins * Ensure mono passes down the cast arg0 * Fix the lerp for Mono to match the managed impl * Ensure mono lerp uses ins_amount for scaling y * Use gtCloneExpr after the first fgMakeMultiUse if we need another copy * Combine the SN_IsNegative and SN_IsPositive logic * Update src/mono/mono/mini/simd-intrinsics.c --------- Co-authored-by: Stephen Toub <stoub@microsoft.com>
- Loading branch information