The first one results from wrong saturation judgment.
The original form is :

uint8_t sub8_usat(uint8_t a, uint8_t b) {
    if (a < b)
        return a - b;
    else
        return 0;
}

it should be " a > b"


The second problem is using op2 as op1 to tell among signed, unsigned, and half 
group


** Patch added: "For case 2"
   
http://launchpadlibrarian.net/50000603/0001-target-arm-fix-thumb2-parallel-add-sub-opcode-decodi.patch

-- 
[ARM]: SIMD add/sub instructions are incorrect
https://bugs.launchpad.net/bugs/591320
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
The thumb2 and unsigned arm state SIMD add/sub instructions are implemented 
incorrectly, for example:

  UQSUB8 r0, r1, r0

gives r0 as 0,  where r0 is 0x12345678 and r1 is 0x23456789 in ARM state, and:

  UHSUB8 r0, r1, r0

gives r0 as 0x1111be01, where r0 is 0x12345678 and r1 is 0x23456789 in thumb2 
state.

This problem is present in git HEAD, (at time of writing, 
fd1dc858370d9a9ac7ea2512812c3a152ee6484b).



Reply via email to