diff options
author | LDj3SNuD <35856442+LDj3SNuD@users.noreply.github.com> | 2020-08-08 17:18:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-08 17:18:51 +0200 |
commit | e36e97c64d7b973fbbc3ac92e9f115d74a4d9e2d (patch) | |
tree | 80bdb45273e6bbc0d862276bdb6f6551b0a2541d /ARMeilleure/Instructions/NativeInterface.cs | |
parent | 8d59ad88b4d59ef6ad26b9a747dc871fd1f1007a (diff) |
CPU: This PR fixes Fpscr, among other things. (#1433)
* CPU: This PR fixes Fpscr, among other things.
* Add Fpscr.Qc = 1 if sat. for Vqrshrn & Vqrshrun.
* Fix Vcmp & Vcmpe opcode table.
* Revert "Fix Vcmp & Vcmpe opcode table."
This reverts commit c117d9410d693185ff5f8ee8e457ffbfb2027dd5.
* Address PR feedbacks.
Diffstat (limited to 'ARMeilleure/Instructions/NativeInterface.cs')
-rw-r--r-- | ARMeilleure/Instructions/NativeInterface.cs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/ARMeilleure/Instructions/NativeInterface.cs b/ARMeilleure/Instructions/NativeInterface.cs index e8f0db84..b4afcc02 100644 --- a/ARMeilleure/Instructions/NativeInterface.cs +++ b/ARMeilleure/Instructions/NativeInterface.cs @@ -87,14 +87,8 @@ namespace ARMeilleure.Instructions { var context = GetContext(); - uint result = (uint)(context.Fpsr & FPSR.A32Mask) | (uint)(context.Fpcr & FPCR.A32Mask); - - result |= context.GetFPstateFlag(FPState.NFlag) ? (1u << 31) : 0; - result |= context.GetFPstateFlag(FPState.ZFlag) ? (1u << 30) : 0; - result |= context.GetFPstateFlag(FPState.CFlag) ? (1u << 29) : 0; - result |= context.GetFPstateFlag(FPState.VFlag) ? (1u << 28) : 0; - - return result; + return (uint)(context.Fpsr & FPSR.A32Mask & ~FPSR.Nzcv) | + (uint)(context.Fpcr & FPCR.A32Mask); } public static ulong GetTpidrEl0() @@ -142,17 +136,17 @@ namespace ARMeilleure.Instructions GetContext().Fpsr = (FPSR)value; } - public static void SetFpscr(uint value) + public static void SetFpsrQc() { - var context = GetContext(); + GetContext().Fpsr |= FPSR.Qc; + } - context.SetFPstateFlag(FPState.NFlag, (value & (1u << 31)) != 0); - context.SetFPstateFlag(FPState.ZFlag, (value & (1u << 30)) != 0); - context.SetFPstateFlag(FPState.CFlag, (value & (1u << 29)) != 0); - context.SetFPstateFlag(FPState.VFlag, (value & (1u << 28)) != 0); + public static void SetFpscr(uint fpscr) + { + var context = GetContext(); - context.Fpsr = FPSR.A32Mask & (FPSR)value; - context.Fpcr = FPCR.A32Mask & (FPCR)value; + context.Fpsr = FPSR.A32Mask & (FPSR)fpscr; + context.Fpcr = FPCR.A32Mask & (FPCR)fpscr; } public static void SetTpidrEl0(ulong value) |