diff options
| author | LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com> | 2019-10-31 19:09:03 +0100 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-10-31 19:09:03 +0100 |
| commit | eee639d6ba544fa5dd9352426d55e91bc54e157d (patch) | |
| tree | 1df440ca57d8c1725e84f403fbeecddb8e508a3a /ARMeilleure | |
| parent | 35443bac5a16ced668d84e0a22c21ca9076b3924 (diff) | |
.NET Core 3.0 is here! (#784)
* .NET Core 3.0 is here!
* Remove IMemoryManager.cs and its references.
* Add T Math/F.FusedMultiplyAdd(T, T, T). Nits.
* Nit.
* Update appveyor.yml
* Revert "Resolve Visual Studio build issues"
This reverts commit 1772128ce0fc058e6280001aace3a77a7a96897b.
* Update SvcTable.cs
Diffstat (limited to 'ARMeilleure')
| -rw-r--r-- | ARMeilleure/ARMeilleure.csproj | 3 | ||||
| -rw-r--r-- | ARMeilleure/Instructions/InstEmitSimdArithmetic.cs | 10 | ||||
| -rw-r--r-- | ARMeilleure/Instructions/SoftFloat.cs | 30 | ||||
| -rw-r--r-- | ARMeilleure/Memory/IMemoryManager.cs | 40 | ||||
| -rw-r--r-- | ARMeilleure/Memory/MemoryHelper.cs | 8 | ||||
| -rw-r--r-- | ARMeilleure/Memory/MemoryManager.cs | 2 | ||||
| -rw-r--r-- | ARMeilleure/State/ExecutionContext.cs | 2 | ||||
| -rw-r--r-- | ARMeilleure/State/IExecutionContext.cs | 37 | ||||
| -rw-r--r-- | ARMeilleure/Translation/ITranslator.cs | 9 | ||||
| -rw-r--r-- | ARMeilleure/Translation/Translator.cs | 6 |
10 files changed, 19 insertions, 128 deletions
diff --git a/ARMeilleure/ARMeilleure.csproj b/ARMeilleure/ARMeilleure.csproj index 15e5c027..4f55243f 100644 --- a/ARMeilleure/ARMeilleure.csproj +++ b/ARMeilleure/ARMeilleure.csproj @@ -1,9 +1,8 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>netcoreapp2.1</TargetFramework> + <TargetFramework>netcoreapp3.0</TargetFramework> <RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers> - <LangVersion>latest</LangVersion> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> diff --git a/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs b/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs index 44659e80..c411a6d3 100644 --- a/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs +++ b/ARMeilleure/Instructions/InstEmitSimdArithmetic.cs @@ -1033,14 +1033,13 @@ namespace ARMeilleure.Instructions } } - public static void Fnmadd_S(ArmEmitterContext context) + public static void Fnmadd_S(ArmEmitterContext context) // Fused. { OpCodeSimdReg op = (OpCodeSimdReg)context.CurrOp; int sizeF = op.Size & 1; - OperandType type = sizeF != 0 ? OperandType.FP64 - : OperandType.FP32; + OperandType type = sizeF != 0 ? OperandType.FP64 : OperandType.FP32; Operand ne = context.VectorExtract(type, GetVec(op.Rn), 0); Operand me = context.VectorExtract(type, GetVec(op.Rm), 0); @@ -1051,14 +1050,13 @@ namespace ARMeilleure.Instructions context.Copy(GetVec(op.Rd), context.VectorInsert(context.VectorZero(), res, 0)); } - public static void Fnmsub_S(ArmEmitterContext context) + public static void Fnmsub_S(ArmEmitterContext context) // Fused. { OpCodeSimdReg op = (OpCodeSimdReg)context.CurrOp; int sizeF = op.Size & 1; - OperandType type = sizeF != 0 ? OperandType.FP64 - : OperandType.FP32; + OperandType type = sizeF != 0 ? OperandType.FP64 : OperandType.FP32; Operand ne = context.VectorExtract(type, GetVec(op.Rn), 0); Operand me = context.VectorExtract(type, GetVec(op.Rm), 0); diff --git a/ARMeilleure/Instructions/SoftFloat.cs b/ARMeilleure/Instructions/SoftFloat.cs index 7358e6b2..af22c85d 100644 --- a/ARMeilleure/Instructions/SoftFloat.cs +++ b/ARMeilleure/Instructions/SoftFloat.cs @@ -1073,10 +1073,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T MathF.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = valueA + (value1 * value2); + result = MathF.FusedMultiplyAdd(value1, value2, valueA); if ((context.Fpcr & FPCR.Fz) != 0 && float.IsSubnormal(result)) { @@ -1256,10 +1253,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T MathF.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = 2f + (value1 * value2); + result = MathF.FusedMultiplyAdd(value1, value2, 2f); if ((context.Fpcr & FPCR.Fz) != 0 && float.IsSubnormal(result)) { @@ -1388,10 +1382,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T MathF.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = (3f + (value1 * value2)) / 2f; + result = MathF.FusedMultiplyAdd(value1, value2, 3f) / 2f; if ((context.Fpcr & FPCR.Fz) != 0 && float.IsSubnormal(result)) { @@ -2142,10 +2133,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T Math.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = valueA + (value1 * value2); + result = Math.FusedMultiplyAdd(value1, value2, valueA); if ((context.Fpcr & FPCR.Fz) != 0 && double.IsSubnormal(result)) { @@ -2323,10 +2311,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T Math.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = 2d + (value1 * value2); + result = Math.FusedMultiplyAdd(value1, value2, 2d); if ((context.Fpcr & FPCR.Fz) != 0 && double.IsSubnormal(result)) { @@ -2455,10 +2440,7 @@ namespace ARMeilleure.Instructions } else { - // TODO: When available, use: T Math.FusedMultiplyAdd(T, T, T); - // https://github.com/dotnet/corefx/issues/31903 - - result = (3d + (value1 * value2)) / 2d; + result = Math.FusedMultiplyAdd(value1, value2, 3d) / 2d; if ((context.Fpcr & FPCR.Fz) != 0 && double.IsSubnormal(result)) { diff --git a/ARMeilleure/Memory/IMemoryManager.cs b/ARMeilleure/Memory/IMemoryManager.cs deleted file mode 100644 index bcee5db2..00000000 --- a/ARMeilleure/Memory/IMemoryManager.cs +++ /dev/null @@ -1,40 +0,0 @@ -using ARMeilleure.State; -using System; - -namespace ARMeilleure.Memory -{ - public interface IMemoryManager : IMemory, IDisposable - { - void Map(long va, long pa, long size); - - void Unmap(long position, long size); - - bool IsMapped(long position); - - long GetPhysicalAddress(long virtualAddress); - - bool IsRegionModified(long position, long size); - - bool TryGetHostAddress(long position, long size, out IntPtr ptr); - - bool IsValidPosition(long position); - - bool AtomicCompareExchangeInt32(long position, int expected, int desired); - - int AtomicIncrementInt32(long position); - - int AtomicDecrementInt32(long position); - - byte[] ReadBytes(long position, long size); - - void ReadBytes(long position, byte[] data, int startIndex, int size); - - void WriteVector128(long position, V128 value); - - void WriteBytes(long position, byte[] data); - - void WriteBytes(long position, byte[] data, int startIndex, int size); - - void CopyBytes(long src, long dst, long size); - } -}
\ No newline at end of file diff --git a/ARMeilleure/Memory/MemoryHelper.cs b/ARMeilleure/Memory/MemoryHelper.cs index 71ddac23..8e310d4d 100644 --- a/ARMeilleure/Memory/MemoryHelper.cs +++ b/ARMeilleure/Memory/MemoryHelper.cs @@ -7,7 +7,7 @@ namespace ARMeilleure.Memory { public static class MemoryHelper { - public static void FillWithZeros(IMemoryManager memory, long position, int size) + public static void FillWithZeros(MemoryManager memory, long position, int size) { int size8 = size & ~(8 - 1); @@ -22,7 +22,7 @@ namespace ARMeilleure.Memory } } - public unsafe static T Read<T>(IMemoryManager memory, long position) where T : struct + public unsafe static T Read<T>(MemoryManager memory, long position) where T : struct { long size = Marshal.SizeOf<T>(); @@ -34,7 +34,7 @@ namespace ARMeilleure.Memory } } - public unsafe static void Write<T>(IMemoryManager memory, long position, T value) where T : struct + public unsafe static void Write<T>(MemoryManager memory, long position, T value) where T : struct { long size = Marshal.SizeOf<T>(); @@ -48,7 +48,7 @@ namespace ARMeilleure.Memory memory.WriteBytes(position, data); } - public static string ReadAsciiString(IMemoryManager memory, long position, long maxSize = -1) + public static string ReadAsciiString(MemoryManager memory, long position, long maxSize = -1) { using (MemoryStream ms = new MemoryStream()) { diff --git a/ARMeilleure/Memory/MemoryManager.cs b/ARMeilleure/Memory/MemoryManager.cs index 12c11843..c6224988 100644 --- a/ARMeilleure/Memory/MemoryManager.cs +++ b/ARMeilleure/Memory/MemoryManager.cs @@ -7,7 +7,7 @@ using static ARMeilleure.Memory.MemoryManagement; namespace ARMeilleure.Memory { - public unsafe class MemoryManager : IMemoryManager + public unsafe class MemoryManager { public const int PageBits = 12; public const int PageSize = 1 << PageBits; diff --git a/ARMeilleure/State/ExecutionContext.cs b/ARMeilleure/State/ExecutionContext.cs index 22cfcb69..40676680 100644 --- a/ARMeilleure/State/ExecutionContext.cs +++ b/ARMeilleure/State/ExecutionContext.cs @@ -3,7 +3,7 @@ using System.Diagnostics; namespace ARMeilleure.State { - public class ExecutionContext : IExecutionContext + public class ExecutionContext { private const int MinCountForCheck = 40000; diff --git a/ARMeilleure/State/IExecutionContext.cs b/ARMeilleure/State/IExecutionContext.cs deleted file mode 100644 index df91b7a1..00000000 --- a/ARMeilleure/State/IExecutionContext.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; - -namespace ARMeilleure.State -{ - public interface IExecutionContext : IDisposable - { - uint CtrEl0 { get; } - uint DczidEl0 { get; } - - ulong CntfrqEl0 { get; set; } - ulong CntpctEl0 { get; } - - long TpidrEl0 { get; set; } - long Tpidr { get; set; } - - FPCR Fpcr { get; set; } - FPSR Fpsr { get; set; } - - bool IsAarch32 { get; set; } - - bool Running { get; set; } - - event EventHandler<EventArgs> Interrupt; - event EventHandler<InstExceptionEventArgs> Break; - event EventHandler<InstExceptionEventArgs> SupervisorCall; - event EventHandler<InstUndefinedEventArgs> Undefined; - - ulong GetX(int index); - void SetX(int index, ulong value); - - V128 GetV(int index); - - bool GetPstateFlag(PState flag); - - void RequestInterrupt(); - } -}
\ No newline at end of file diff --git a/ARMeilleure/Translation/ITranslator.cs b/ARMeilleure/Translation/ITranslator.cs deleted file mode 100644 index 1063d3a6..00000000 --- a/ARMeilleure/Translation/ITranslator.cs +++ /dev/null @@ -1,9 +0,0 @@ -using ARMeilleure.State; - -namespace ARMeilleure.Translation -{ - public interface ITranslator - { - void Execute(IExecutionContext context, ulong address); - } -}
\ No newline at end of file diff --git a/ARMeilleure/Translation/Translator.cs b/ARMeilleure/Translation/Translator.cs index 6a745121..6531e9f0 100644 --- a/ARMeilleure/Translation/Translator.cs +++ b/ARMeilleure/Translation/Translator.cs @@ -12,7 +12,7 @@ using static ARMeilleure.IntermediateRepresentation.OperandHelper; namespace ARMeilleure.Translation { - public class Translator : ITranslator + public class Translator { private const ulong CallFlag = InstEmitFlowHelper.CallFlag; @@ -54,10 +54,8 @@ namespace ARMeilleure.Translation } } - public void Execute(IExecutionContext ctx, ulong address) + public void Execute(State.ExecutionContext context, ulong address) { - State.ExecutionContext context = (State.ExecutionContext)ctx; - if (Interlocked.Increment(ref _threadCount) == 1) { Thread backgroundTranslatorThread = new Thread(TranslateQueuedSubs); |
