reverting removal of tmpsum and tmpsum2, not using fmsubs
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 16 Jun 2021 10:24:48 +0000 (11:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 16 Jun 2021 10:24:48 +0000 (11:24 +0100)
see http://lists.libre-soc.org/pipermail/libre-soc-dev/2021-June/003145.html

media/audio/mp3/mp3_0_apply_window_float_basicsv.s

index cf32f4cc4b0d7124c5be76aade6884d6f8be84a5..2a9bdaf4aa85d3f1ea6f8276da0f27c42072e730 100644 (file)
@@ -27,6 +27,8 @@
 # floats
 .set sum, 0
 .set sum2, 1
+.set tmpsum, 2
+.set tmpsum2, 3
 
        .machine power9
        .abiversion 2
@@ -60,12 +62,14 @@ ff_mpadsp_apply_window_float_sv:
        # sv.lfs/els fv1.v, 256(p)
        # sv.fmadds/mr sum, fv0.v, fv1.v, sum
 
+       lfiwax tmpsum, 0, 9 # zero it
        addi p, buf, 192
        addi win, win, 128
        # SUM8(MLSS, sum, w + 32, p)
        # sv.lfs/els fv0.v, 256(win)
        # sv.lfs/els fv1.v, 256(p)
-       # sv.fmsubs/mr sum, fv0.v, fv1.v, sum
+       # sv.fmadds/mr tmpsum, fv0.v, fv1.v, tmpsum
+       fsubs sum, sum, tmpsum
        subi win, win, 128
 
        stfs sum, 0(out)
@@ -87,10 +91,13 @@ ff_mpadsp_apply_window_float_sv:
                # sv.lfs/els fv1.v, 256(win)
                # sv.lfs/els fv2.v, 256(win2)
                # sv.fmadds/mr sum, fv0.v, fv1.v, sum
-               # sv.fmsubs/mr sum2, fv0.v, fv2.v, sum2
+               # sv.fmadds/mr sum2, fv0.v, fv2.v, sum2
+               fneg sum2, sum2
 
                addi p, buf, 192
                subf p, i, p
+               lfiwax tmpsum, 0, 9 # zero it
+               lfiwax tmpsum2, 0, 9 # zero it
                addi win, win, 128
                # sv.addi win2, win2, 128
 
@@ -98,8 +105,10 @@ ff_mpadsp_apply_window_float_sv:
                # sv.lfs/els fv0.v, 256(p)
                # sv.lfs/els fv1.v, 256(win)
                # sv.lfs/els fv2.v, 256(win2)
-               # sv.fmsubs/mr sum, fv0.v, fv1.v, sum
-               # sv.fmsubs/mr sum2, fv0.v, fv2.v, sum2
+               # sv.fmadds/mr tmpsum, fv0.v, fv1.v, tmpsum
+               # sv.fmadds/mr tmpsum2, fv0.v, fv2.v, tmpsum2
+               fsubs sum, sum, tmpsum
+               fsubs sum2, sum2, tmpsum2
 
                subi win, win, 128
                # sv.addi win2, win2, -128
@@ -116,12 +125,13 @@ ff_mpadsp_apply_window_float_sv:
 
        addi p, buf, 128
        addi win, win, 128
+       lfiwax tmpsum, 0, 9 # zero it
        lfiwax sum, 0, 9 # zero it
        # SUM8(MLSS, sum, w + 32, p)
        # sv.lfs/els fv0.v, 256(win)
        # sv.lfs/els fv1.v, 256(p)
-       # sv.fmsubs/mr sum, fv0.v, fv1.v, sum
-       # XXX no? possible bug? fneg sum, sum
+       # sv.fmadds/mr tmpsum, fv0.v, fv1.v, tmpsum
+       fsubs sum, sum, tmpsum
 
        stfs sum, 0(out)