Commit 72df2963 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

third iteration (left) is working.

parent 0c731914
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -1118,17 +1118,24 @@ static void biDiagonalReductionLeft_64(
            norm_x=W_extract_h(W_shl(norm_64,norm_x_e));
            f=Mpy_32_32(norm_x,invVal);
            f_e=add(invVal_e, sub(norm_x_e, r_e ));
		printf("\nNOCHMAL%d,%d: f_e=%d; norm_x_e:%d r_e:%d   f:%08X \x1b[1;34m",currChannel,iCh,f_e,norm_x_e,r_e,f);
            for (jCh=currChannel;jCh<nChannelsL; jCh++)
            {
		Word16 magic_shift_left;

                tmp2=W_extract_l(W_shr(singularVectors_Left_64[jCh][currChannel],tmpe));
//		singularVectors_Left_64[jCh][iCh]=W_add(singularVectors_Left_64[jCh][iCh],W_shr(W_mult0_32_32(f,tmp2),shifter[iCh]));
		singularVectors_Left_64[jCh][iCh]=W_add(singularVectors_Left_64[jCh][iCh],W_shr(W_mult0_32_32(f,tmp2),norm_x_e+23));
		switch(currChannel)
		{
			Word16 n;
			n=W_norm(singularVectors_Left_64[jCh][iCh]);
			case 0:	magic_shift_left=norm_x_e+23;break;
			case 1:	magic_shift_left=norm_x_e+23;break;
			default:magic_shift_left=norm_x_e+23+r_e;break;
		}
                tmp2=W_extract_l(W_shr(singularVectors_Left_64[jCh][currChannel],tmpe));
		printf("tmp2:%08X magic_shift_left:%d %016llx+%016llx  --> ",tmp2,magic_shift_left,singularVectors_Left_64[jCh][iCh],W_mult0_32_32(f,tmp2));
//		singularVectors_Left_64[jCh][iCh]=W_add(singularVectors_Left_64[jCh][iCh],W_shr(W_mult0_32_32(f,tmp2),shifter[iCh]));
		singularVectors_Left_64[jCh][iCh]=W_add(singularVectors_Left_64[jCh][iCh],W_shr(W_mult0_32_32(f,tmp2),magic_shift_left));
		printf("%016llx]  ",singularVectors_Left_64[jCh][iCh]);
            }
		printf("\x1b[0m\n");
        }
    }
}
@@ -1474,12 +1481,15 @@ static void biDiagonalReductionLeft_fx(
                }
                f = Mpy_32_32( norm_x, invVal ); /* invVal_e + (norm_x_e - r_e) */
                f_e = add( invVal_e, sub( norm_x_e, r_e ) );

		printf("\nNOCHMAL%d,%d: f_e=%d; norm_x_e:%d r_e:%d ",currChannel,iCh,f_e,norm_x_e,r_e);
                FOR( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */
                {
			printf("tmp2:%08X %08X+%08X --> ",singularVectors[jCh][currChannel], singularVectors[jCh][iCh],Mpy_32_32( f, singularVectors[jCh][currChannel] ));
                    singularVectors[jCh][iCh] = BASOP_Util_Add_Mant32Exp( singularVectors[jCh][iCh], singularVectors2_e[jCh][iCh], Mpy_32_32( f, singularVectors[jCh][currChannel] ), add( f_e, singularVectors2_e[jCh][currChannel] ), &singularVectors2_e[jCh][iCh] );
			printf("%08X]  ",singularVectors[jCh][iCh]);
                    move32();
                }
		printf("\n");
            }
        }
        // rescaling block