We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90be48c commit a2effc7Copy full SHA for a2effc7
src/libraries/System.Private.CoreLib/src/System/Numerics/BitOperations.cs
@@ -296,6 +296,11 @@ public static int TrailingZeroCount(uint value)
296
return (int)Bmi1.TrailingZeroCount(value);
297
}
298
299
+ if (ArmBase.IsSupported)
300
+ {
301
+ return (int)ArmBase.LeadingZeroCount(ArmBase.ReverseElementBits(value));
302
+ }
303
+
304
// Unguarded fallback contract is 0->0
305
if (value == 0)
306
{
@@ -334,6 +339,10 @@ public static int TrailingZeroCount(ulong value)
334
339
return (int)Bmi1.X64.TrailingZeroCount(value);
335
340
336
341
342
+ if (ArmBase.Arm64.IsSupported)
343
344
+ return (int)ArmBase.Arm64.LeadingZeroCount(ArmBase.Arm64.ReverseElementBits(value));
345
337
346
uint lo = (uint)value;
338
347
348
if (lo == 0)
0 commit comments