MIPS: DSPr2: Fix for bug in in_n_8 routine.
authorNemanja Lukic <nemanja.lukic@rt-rk.com>
Mon, 15 Apr 2013 17:32:58 +0000 (19:32 +0200)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Tue, 30 Apr 2013 19:38:43 +0000 (15:38 -0400)
commit44174ce51d1ed5a1bf988b9dd9218d8cbd379de3
treed52ed2377cf87ba77803205654ef74fb273e1079
parent5858f09d264ef762ddcf7ede324bfce9f5991d29
MIPS: DSPr2: Fix for bug in in_n_8 routine.

Rounding logic was not implemented right.
Instead of using rounding version of the 8-bit shift, logical shifts were used.
Also, code used unnecessary multiplications, which could be avoided by packing
4 destination (a8) pixel into one 32bit register. There were also, unnecessary
spills on stack. Code is rewritten to address mentioned issues.

The bug was revealed by increasing number of the iterations in blitters-test.

Performance numbers on MIPS-74kc @ 1GHz:

lowlevel-blt-bench results

Referent (before):
                   in_n_8 =  L1:  21.20  L2:  22.86  M: 21.42 ( 14.21%)  HT: 15.97  VT: 15.69  R: 15.47  RT:  8.00 (  48Kops/s)
Optimized (first implementation, with bug):
                   in_n_8 =  L1:  89.38  L2:  86.07  M: 65.48 ( 43.44%)  HT: 44.64  VT: 41.50  R: 40.77  RT: 16.94 (  66Kops/s)
Optimized (with bug fix, and code revisited):
                   in_n_8 =  L1: 102.33  L2:  95.65  M: 70.54 ( 46.84%)  HT: 48.35  VT: 45.06  R: 43.20  RT: 17.60 (  66Kops/s)
pixman/pixman-mips-dspr2-asm.S