all repos — mgba @ 61c6b7186e6889ad6e3250c7dd83678f775e6150

mGBA Game Boy Advance Emulator

Implement UMLAL
Jeffrey Pfau jeffrey@endrift.com
Wed, 01 May 2013 23:11:00 -0700
commit

61c6b7186e6889ad6e3250c7dd83678f775e6150

parent

cd73c562eaae4629b6a6789e5fe27f2b22387f86

1 files changed, 9 insertions(+), 2 deletions(-)

jump to
M src/arm/isa-arm.csrc/arm/isa-arm.c

@@ -594,8 +594,15 @@ int64_t d = ((int64_t) cpu->gprs[rm]) * ((int64_t) cpu->gprs[rs]);

cpu->gprs[rd] = d; cpu->gprs[rdHi] = d >> 32;, ARM_NEUTRAL_HI_S(cpu->gprs[rd], cpu->gprs[rdHi])) -DEFINE_INSTRUCTION_ARM(UMLAL, ARM_STUB) -DEFINE_INSTRUCTION_ARM(UMLALS, ARM_STUB) + +DEFINE_MULTIPLY_INSTRUCTION_ARM(UMLAL, + uint64_t d = ((uint64_t) cpu->gprs[rm]) * ((uint64_t) cpu->gprs[rs]); + int32_t dm = cpu->gprs[rd]; + int32_t dn = d; + cpu->gprs[rd] = dm + dn; + cpu->gprs[rdHi] = cpu->gprs[rdHi] + (d >> 32) + ARM_CARRY_FROM(dm, dn, cpu->gprs[rd]);, + ARM_NEUTRAL_HI_S(cpu->gprs[rd], cpu->gprs[rdHi])) + DEFINE_MULTIPLY_INSTRUCTION_ARM(UMULL, uint64_t d = ((uint64_t) cpu->gprs[rm]) * ((uint64_t) cpu->gprs[rs]); cpu->gprs[rd] = d;