forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64: Add support for Bitwise XOR NOT
* Contributes towards dotnet#68028 Change-Id: Ifad031a92270668bb3970fb1af817fda05851116
- Loading branch information
1 parent
c47a53d
commit ea3bb79
Showing
11 changed files
with
162 additions
and
9 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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// 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; | ||
using Xunit; | ||
|
||
namespace TestEon | ||
{ | ||
public class Program | ||
{ | ||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
[Fact] | ||
public static int CheckEon() | ||
{ | ||
bool fail = false; | ||
|
||
if (Eon(5, 1) != 0xFFFFFFFB) | ||
{ | ||
fail = true; | ||
} | ||
|
||
if (EonLSL(0x12345678, 0xA) != 0xEDC92987) | ||
{ | ||
fail = true; | ||
} | ||
|
||
if (EonLSR(0x87654321, 0xFEDCBA) != 0x789D4A3B) | ||
{ | ||
fail = true; | ||
} | ||
|
||
if (EonASR(0x2468, 0xFEDCBA) != -0x246C) | ||
{ | ||
fail = true; | ||
} | ||
|
||
if (EonLargeShift(0x87654321, 0x12345678) != 0xB89ABCDE) | ||
{ | ||
fail = true; | ||
} | ||
|
||
if (EonLargeShift64Bit(0x1357135713571357, 0x123456789ABCDEF0) != 0xECA8ECA8ECE03DF1) | ||
{ | ||
fail = true; | ||
} | ||
|
||
if (fail) | ||
{ | ||
return 101; | ||
} | ||
return 100; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static uint Eon(uint a, uint b) | ||
{ | ||
//ARM64-FULL-LINE: eon {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}} | ||
return a ^ ~b; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static uint EonLSL(uint a, uint b) | ||
{ | ||
//ARM64-FULL-LINE: eon {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, LSL #14 | ||
return a ^ ~(b<<14); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static uint EonLSR(uint a, uint b) | ||
{ | ||
//ARM64-FULL-LINE: eon {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, LSR #5 | ||
return a ^ ~(b>>5); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static int EonASR(int a, int b) | ||
{ | ||
//ARM64-FULL-LINE: eon {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, ASR #22 | ||
return a ^ ~(b>>22); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static uint EonLargeShift(uint a, uint b) | ||
{ | ||
//ARM64-FULL-LINE: eon {{w[0-9]+}}, {{w[0-9]+}}, {{w[0-9]+}}, LSL #27 | ||
return a ^ ~(b<<123); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static ulong EonLargeShift64Bit(ulong a, ulong b) | ||
{ | ||
//ARM64-FULL-LINE: eon {{x[0-9]+}}, {{x[0-9]+}}, {{x[0-9]+}}, LSR #38 | ||
return a ^ ~(b>>166); | ||
} | ||
} | ||
} |
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,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<!-- Needed for CLRTestEnvironmentVariable --> | ||
<RequiresProcessIsolation>true</RequiresProcessIsolation> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Eon.cs"> | ||
<HasDisasmCheck>true</HasDisasmCheck> | ||
</Compile> | ||
<CLRTestEnvironmentVariable Include="DOTNET_TieredCompilation" Value="0" /> | ||
<CLRTestEnvironmentVariable Include="DOTNET_JITMinOpts" Value="0" /> | ||
</ItemGroup> | ||
</Project> |