aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Tests.Unicorn
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-02-29 17:51:55 -0300
committerGitHub <noreply@github.com>2020-03-01 07:51:55 +1100
commitfb0939f9b68d7fb83d863b22ef99af93452bb4bf (patch)
tree1be02b3674c8b94fee0cb12503bd00060810ccb5 /Ryujinx.Tests.Unicorn
parentb8ee5b15abc750e0484195633e6c4bb6e05eab6f (diff)
Add SSAT, SSAT16, USAT and USAT16 ARM32 instructions (#954)
* Implement SMULWB, SMULWT, SMLAWB, SMLAWT, and add tests for some multiply instructions * Improve test descriptions * Rename SMULH to SMUL__ * Add SSAT, SSAT16, USAT and USAT16 ARM32 instructions * Fix new tests * Replace AND 0xFFFF with 16-bits zero extension (more efficient)
Diffstat (limited to 'Ryujinx.Tests.Unicorn')
-rw-r--r--Ryujinx.Tests.Unicorn/UnicornAArch32.cs28
1 files changed, 17 insertions, 11 deletions
diff --git a/Ryujinx.Tests.Unicorn/UnicornAArch32.cs b/Ryujinx.Tests.Unicorn/UnicornAArch32.cs
index d7ae90d6..45d2da7a 100644
--- a/Ryujinx.Tests.Unicorn/UnicornAArch32.cs
+++ b/Ryujinx.Tests.Unicorn/UnicornAArch32.cs
@@ -45,10 +45,10 @@ namespace Ryujinx.Tests.Unicorn
set => SetRegister(Arm32Register.PC, value);
}
- public uint APSR
+ public uint CPSR
{
- get => (uint)GetRegister(Arm32Register.APSR);
- set => SetRegister(Arm32Register.APSR, (uint)value);
+ get => (uint)GetRegister(Arm32Register.CPSR);
+ set => SetRegister(Arm32Register.CPSR, (uint)value);
}
public int Fpscr
@@ -57,28 +57,34 @@ namespace Ryujinx.Tests.Unicorn
set => SetRegister(Arm32Register.FPSCR, (uint)value);
}
+ public bool QFlag
+ {
+ get => (CPSR & 0x8000000u) != 0;
+ set => CPSR = (CPSR & ~0x8000000u) | (value ? 0x8000000u : 0u);
+ }
+
public bool OverflowFlag
{
- get => (APSR & 0x10000000u) != 0;
- set => APSR = (APSR & ~0x10000000u) | (value ? 0x10000000u : 0u);
+ get => (CPSR & 0x10000000u) != 0;
+ set => CPSR = (CPSR & ~0x10000000u) | (value ? 0x10000000u : 0u);
}
public bool CarryFlag
{
- get => (APSR & 0x20000000u) != 0;
- set => APSR = (APSR & ~0x20000000u) | (value ? 0x20000000u : 0u);
+ get => (CPSR & 0x20000000u) != 0;
+ set => CPSR = (CPSR & ~0x20000000u) | (value ? 0x20000000u : 0u);
}
public bool ZeroFlag
{
- get => (APSR & 0x40000000u) != 0;
- set => APSR = (APSR & ~0x40000000u) | (value ? 0x40000000u : 0u);
+ get => (CPSR & 0x40000000u) != 0;
+ set => CPSR = (CPSR & ~0x40000000u) | (value ? 0x40000000u : 0u);
}
public bool NegativeFlag
{
- get => (APSR & 0x80000000u) != 0;
- set => APSR = (APSR & ~0x80000000u) | (value ? 0x80000000u : 0u);
+ get => (CPSR & 0x80000000u) != 0;
+ set => CPSR = (CPSR & ~0x80000000u) | (value ? 0x80000000u : 0u);
}
public UnicornAArch32()