-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix arm64 scalar intrinsic use with small arguments (#73876)
The code already uses `emitActualTypeSize` in the scalar case; this also uses `genActualType` to get the "actual" type of small types when deciding the intrinsic base type, used in codegen. Fixes #73804
- Loading branch information
1 parent
a037f0c
commit 3478472
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/tests/JIT/Regression/JitBlue/Runtime_73804/Runtime_73804.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
public unsafe class Runtime_73804 | ||
{ | ||
public static int Main() | ||
{ | ||
short value = 0x1000; | ||
int r = Problem(&value); | ||
|
||
return 100 + r - System.Numerics.BitOperations.LeadingZeroCount((uint)value); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static int Problem(short* s) | ||
{ | ||
if (System.Runtime.Intrinsics.Arm.ArmBase.IsSupported) | ||
{ | ||
return System.Runtime.Intrinsics.Arm.ArmBase.LeadingZeroCount(*s); | ||
} | ||
else | ||
{ | ||
return System.Numerics.BitOperations.LeadingZeroCount((uint)*s); | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/tests/JIT/Regression/JitBlue/Runtime_73804/Runtime_73804.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |