Commit 9abe4159 authored by thomas dettbarn's avatar thomas dettbarn
Browse files

it is calculating the same way it did before.

parent 9ad25685
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -881,6 +881,7 @@ static void HouseholderReduction_fx(
    Word16 singularVectors_Left_fx_e[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS];
#ifdef	 MYCHANGES
	push_wmops("HouseholderReduction_fx 64");
	printf("\n");
    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
    {
        FOR( iCh = 0; iCh < nChannelsC; iCh++ )
@@ -1151,22 +1152,24 @@ static void biDiagonalReductionRight_64(
    ( *g_e ) = 0;
    move32();
    move16();

	printf("\n");
    IF ( LT_16( currChannel, nChannelsL ) && NE_16( currChannel, sub( nChannelsC, 1 ) ) ) /* i <=m && i !=n */  
    {
        norm_64=0;
        abs_64=0;
        move64();
        move64();
        idx = add( currChannel, 1);
        FOR ( jCh = idx; jCh < nChannelsC; jCh++ )
        {
            Word32 tmp;
            tmp = W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], bitwindow) );
            tmp = W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], bitwindow+1) );
            norm_64 = W_add( norm_64, W_mult0_32_32( tmp, tmp) );
            abs_64 = W_add( abs_64, W_abs( singularVectors_Left_64[currChannel][jCh]) );            
        }
        norm_x_e = W_norm( norm_64);
        norm_x = W_extract_h( W_shl( norm_64, norm_x_e) );
        norm_x_e = add( sub( add( bitwindow, bitwindow), norm_x_e), 1);
        norm_x_e = add( sub( add( bitwindow+1, bitwindow+1), norm_x_e), 1);
        move16();
        abs_x_e = W_norm( abs_64);
        abs_x = W_extract_h( W_shl( abs_64, abs_x_e) );
@@ -1201,11 +1204,11 @@ static void biDiagonalReductionRight_64(
            move32();
            move16();
            factor2=W_extract_l( W_shr( singularVectors_Left_64[currChannel][idx], bitwindow) );
            tmp_e = sub( sub( tmp_g_e, bitwindow), 3);
            tmp_e = sub( tmp_g_e, bitwindow);
            tmpmul = W_mult0_32_32( tmp_g, factor2);
            tmpmul = W_shl(tmpmul, tmp_e);
            
            r_64 = W_sub( W_shr( tmpmul, 1), W_shr( norm_64, 1) );// FIXME: why those two shi(f)ts?
            r_64 = W_sub( W_shr( tmpmul, 1), W_shl( norm_64, 1) );// FIXME: why those two shi(f)ts?
            r_e = W_norm( r_64);
            r = W_extract_h( W_shl( r_64, r_e) );
            r_e = sub( sub( add( bitwindow, tmp_g_e), tmp_e), r_e); // FIXME: reduce this!!
@@ -1216,7 +1219,6 @@ static void biDiagonalReductionRight_64(

            magic_shift=32-tmp_g_e;
            singularVectors_Left_64[currChannel][idx]=W_sub( singularVectors_Left_64[currChannel][idx], W_shr( W_deposit32_h( tmp_g), magic_shift) );

            bitwindow=add(bitwindow, 1);
            FOR( iCh = idx; iCh < nChannelsC; iCh++ )
            {
@@ -1235,11 +1237,15 @@ static void biDiagonalReductionRight_64(
                f = Mpy_32_32( norm_x, invVal);
                f_e = add( invVal_e, sub( norm_x_e, r_e) );
                magic_shift = -3*currChannel+22-2*norm_x_e+4*r_e+3*f_e;		// FIXME: HOW IS THIS WORKING?????!?!?!?!?!?!?!?!?!?
                FOR( iCh = idx; iCh < nChannelsC; iCh++ )
		printf("SHIT4: norm:%016llX %08X<%2X f:%08X magic_shift:%d\n",norm_64,norm_x,norm_x_e,f,magic_shift);
		printf("SHIT5: ");
                FOR( jCh = idx; jCh < nChannelsC; jCh++ )
                {
                    factor2 = W_extract_l( W_shr( singularVectors_Left_64[currChannel][jCh], bitwindow) );
                    singularVectors_Left_64[iCh][jCh] = W_add( singularVectors_Left_64[iCh][jCh], W_shr( W_mult0_32_32( f, factor2), magic_shift) );
			printf("%016llX ",singularVectors_Left_64[iCh][jCh]);
                }
		printf("\n");
            }
            // FIXME BEGIN: The following code has not yet been tested 
            invVal_e = 0;