Skip to content

Conversation

snickolls-arm
Copy link
Contributor

Includes:

  • AddRoundedHighNarrowingEven, AddRoundedHighNarrowingOdd
  • FusedAddRoundedHalving
  • SubtractRoundedHighNarrowingEven, SubtractRoundedHighNarrowingOdd

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 16, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime-intrinsics
See info in area-owners.md if you want to be subscribed.

@a74nh
Copy link
Contributor

a74nh commented Jul 16, 2025

@amanasifkhalid

Copy link
Contributor

@amanasifkhalid amanasifkhalid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preliminary pass LGTM, though CI is blocked by the merge conflicts I introduced (sorry about that)

Includes:
* AddRoundedHighNarrowingEven, AddRoundedHighNarrowingOdd
* FusedAddRoundedHalving
* SubtractRoundedHighNarrowingEven, SubtractRoundedHighNarrowingOdd
Comment on lines +11437 to +11438
dynamic a = op1;
dynamic b = op2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tannergooding what would be the best way to disable these tests on native AOT? I don't want to disable the entire project but whatever calls into the codepaths with dynamic keyword is unsupportable. Outerloop is failing with stacks like

System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) + 0x3c8
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) + 0x10
   at Microsoft.CSharp.RuntimeBinder.ExpressionTreeCallRewriter.VisitSAVE(ExprBinOp) + 0x5c
   at Microsoft.CSharp.RuntimeBinder.Semantics.ExprVisitorBase.Dispatch(Expr) + 0x408
   at Microsoft.CSharp.RuntimeBinder.ExpressionTreeCallRewriter.Rewrite(ExprBinOp, Expression[]) + 0x6c
   at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCore(ICSharpBinder, Expression[], DynamicMetaObject[], DynamicMetaObject&) + 0x1d4
   at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind(ICSharpBinder, Expression[], DynamicMetaObject[], DynamicMetaObject&) + 0x58
   at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind(ICSharpBinder, RuntimeBinder, DynamicMetaObject[], IEnumerable`1, DynamicMetaObject) + 0x490
   at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[], ReadOnlyCollection`1, LabelTarget) + 0x148
   at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1, Object[]) + 0x94
   at HardwareIntrinsics_Arm_ro!<BaseAddress>+0x3e90d4c
   at System.Reflection.DynamicInvokeInfo.InvokeWithFewArguments(IntPtr, Byte&, Byte&, Object[], BinderBundle, Boolean) + 0xd0
--- End of stack trace from previous location ---
   at System.Linq.Expressions.Interpreter.ExceptionHelpers.UnwrapAndRethrow(TargetInvocationException) + 0x18
   at System.Linq.Expressions.Interpreter.MethodInfoCallInstruction.Run(InterpretedFrame) + 0x1cc
   at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame) + 0x48
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] arguments) + 0x8c
   at HardwareIntrinsics_Arm_ro!<BaseAddress>+0x3ce7ac0
   at JIT.HardwareIntrinsics.Arm.Helpers.AddRoundedHighNarrowing[W,N](W op1, W op2) + 0xa4
   at JIT.HardwareIntrinsics.Arm._AdvSimd.SimpleBinaryOpTest__AddRoundedHighNarrowingLower_Vector64_Byte.ValidateResult(UInt16[] left, UInt16[] right, Byte[] result, String method) + 0x90
   at JIT.HardwareIntrinsics.Arm._AdvSimd.Program.AddRoundedHighNarrowingLower_Vector64_Byte() + 0x3c
   at Program.<<Main>$>g__TestExecutor987|0_988(StreamWriter tempLogSw, StreamWriter statsCsvSw, Program.<>c__DisplayClass0_0&) + 0x114

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tannergooding what would be the best way to disable these tests on native AOT? I don't want to disable the entire project but whatever calls into the codepaths with dynamic keyword is unsupportable. Outerloop is failing with stacks like

Given AdvSimd works on AOT then we definitely should be testing on it. @snickolls-arm could you take a look at removing the dynamic keyword from this file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you take a look at removing the dynamic keyword from this file.

For cases like this, I think you can use Convert.ToUInt64() to do the cast without dynamic.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Runtime.Intrinsics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants