MIPS: DSPr2: Fix bug in over_n_8888_8888_ca/over_n_8888_0565_ca routines
authorNemanja Lukic <nemanja.lukic@rt-rk.com>
Mon, 15 Apr 2013 17:32:54 +0000 (19:32 +0200)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Tue, 30 Apr 2013 19:38:43 +0000 (15:38 -0400)
commit66def909ad82ed4ccb49380031cb828655c9a47f
tree4ee15abd6465afe22bb517056ee95b97ca4ffc43
parentd768558ce195caa208262866f9262b29efff22dc
MIPS: DSPr2: Fix bug in over_n_8888_8888_ca/over_n_8888_0565_ca routines

After introducing new PRNG (pseudorandom number generator) a bug in two DSPr2
routines was revealed. Bug manifested by wrong calculation in composite and
glyph tests, which caused make check to fail for MIPS DSPr2 optimizations.

Bug was in the calculation of the:
*dst = over (src, *dst) when ma == 0xffffffff

In this case src was not negated and shifted right by 24 bits, it was only
negated. When implementing this routine in the first place, I missplaced those
shifts, which alowed me to combine code for over operation and:
    UN8x4_MUL_UN8x4 (s, ma);
    UN8x4_MUL_UN8 (ma, srca);
    ma = ~ma;
    UN8x4_MUL_UN8x4_ADD_UN8x4 (d, ma, s);
So I decided to rewrite that piece of code from scratch. I changed logic, so
now assembly code mimics code from pixman-fast-path.c but processes two pixels
at a time. This code should be easier to debug and maintain.

The bug was revealed in commit b31a6962. Errors were detected by composite
and glyph tests.
pixman/pixman-mips-dspr2-asm.S