From fb0939f9b68d7fb83d863b22ef99af93452bb4bf Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 29 Feb 2020 17:51:55 -0300 Subject: 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) --- Ryujinx.Tests.Unicorn/UnicornAArch32.cs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Ryujinx.Tests.Unicorn') 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() -- cgit v1.2.3