Commit 81d51e9c authored by thomas dettbarn's avatar thomas dettbarn
Browse files

first loop of the right_64() is correct.

parent b7b0ce6f
Loading
Loading
Loading
Loading
+16 −21
Original line number Diff line number Diff line
@@ -885,17 +885,12 @@ static void HouseholderReduction_fx(
    Word16 singularVectors_Left_fx_e[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS];
#ifdef	 MYCHANGES
	push_wmops("HouseholderReduction_fx 64");
	printf("\n");
	printf("DAFUQ0: %08X\n",singularVectors_Left_fx[0][0]);
    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
    {
	printf("CONV ");
        FOR( iCh = 0; iCh < nChannelsC; iCh++ )
        {
            singularVectors_Left_64[jCh][iCh] = W_shr(W_deposit32_h(singularVectors_Left_fx[jCh][iCh]),32);
		printf("%08X --> %016llX    ",singularVectors_Left_fx[jCh][iCh],singularVectors_Left_64[jCh][iCh]);
        }
	printf("\n");
    }
	for (nCh=0;nCh<nChannelsC;nCh++)
	{
@@ -909,7 +904,7 @@ static void HouseholderReduction_fx(

		{
			int i,j;
			printf("COMPARE%d \x1b[1;32mstart\x1b[0m\n",nCh);
			printf("\nCOMPARE%d, (%d)\x1b[1;32mstart\x1b[0m\n",nCh,singularVectors_Left_e);
			for (i=0;i<nChannelsL;i++)
			{
				printf("COMPARE%d,%d: \x1b[1;32m",nCh,i);
@@ -936,7 +931,6 @@ static void HouseholderReduction_fx(
	}	
	pop_wmops();
#endif
	printf("DAFUQ1: %08X\n",singularVectors_Left_fx[0][0]);
	push_wmops("HouseholderReduction_fx 32");
    FOR( jCh = 0; jCh < nChannelsL; jCh++ )
    {
@@ -946,7 +940,6 @@ static void HouseholderReduction_fx(
            move16();
        }
    }
	printf("DAFUQ2: %08X\n",singularVectors_Left_fx[0][0]);

    /* Bidiagonal Reduction for every channel */
    FOR( nCh = 0; nCh < nChannelsC; nCh++ ) /* nChannelsC */
@@ -955,7 +948,7 @@ static void HouseholderReduction_fx(
        biDiagonalReductionLeft_fx( singularVectors_Left_fx, singularValues_fx, singularVectors_Left_fx_e, singularValues_fx_e, nChannelsL, nChannelsC, nCh );
		{
			int i,j;
			printf("COMPARE%d start\n",nCh);
			printf("COMPARE%d, start\n",nCh);
			for (i=0;i<nChannelsL;i++)
			{
				printf("COMPARE%d,%d: ",nCh,i);
@@ -966,7 +959,7 @@ static void HouseholderReduction_fx(
				}
				printf("\n");
			}
			printf("COMPARE%d end\n",nCh);
			printf("COMPARE%d, end\n",nCh);
		}
        biDiagonalReductionRight_fx( singularVectors_Left_fx, secDiag_fx, singularVectors_Left_fx_e, secDiag_fx_e, nChannelsL, nChannelsC, nCh, &g_fx, &g_e );
#else
@@ -1036,7 +1029,6 @@ static void biDiagonalReductionLeft_64(
        norm_x=W_extract_h(W_shl(norm_64, tmpe ));
        norm_x_e = add(sub(shl(singularVectors_e, 1), tmpe), 3 );
    }
	printf("\n");
    IF ( norm_x )
    {
        Word16 invVal_e;
@@ -1079,7 +1071,6 @@ static void biDiagonalReductionLeft_64(
        tmp=W_extract_l(W_shr(singularVectors_Left_64[currChannel][currChannel],tmpe));
        for ( iCh=currChannel+1; iCh<nChannelsC; iCh++)
        {
	  	Word16 shifter[16]={ 27,27,27,28,30,28,29,27,30,28,30,29,29,27,27,27,27};
            Word32 tmp2;
            Word32 tmp3;

@@ -1096,7 +1087,7 @@ 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("MYADD%d,%d: [%08X<%2x]    (norm_x:%d r_e:%d  invVal_e:%d f_e:%d -->%d)  \x1b[1;33m",iCh,currChannel,f,f_e,norm_x_e,r_e,invVal_e,f_e,shifter[iCh]);
		//printf("MYADD%d,%d: [%08X<%2x]    (norm_x:%d r_e:%d  invVal_e:%d f_e:%d -->%d)  \x1b[1;33m",iCh,currChannel,f,f_e,norm_x_e,r_e,invVal_e,f_e,shifter[iCh]);
            for (jCh=currChannel;jCh<nChannelsL; jCh++)
            {

@@ -1106,10 +1097,10 @@ static void biDiagonalReductionLeft_64(
		{
			Word16 n;
			n=W_norm(singularVectors_Left_64[jCh][iCh]);
			printf("%08X ",W_extract_h(W_shl(singularVectors_Left_64[jCh][iCh],n)));
			//printf("%08X ",W_extract_h(W_shl(singularVectors_Left_64[jCh][iCh],n)));
		}
            }
		printf("\x1b[0m\n");
		//printf("\x1b[0m\n");
        }
    }
}
@@ -1155,15 +1146,17 @@ static void biDiagonalReductionRight_64(
        move64();
        move64();
        tmpe=add(singularVectors_e,1);
	printf("NORM64: \x1b[1;33m");
        for (jCh=idx;jCh<nChannelsC; jCh++)
        {
            tmp=W_extract_l(W_shr(singularVectors_Left_64[jCh][currChannel],tmpe));
            tmp=W_extract_l(W_shr(singularVectors_Left_64[currChannel][jCh],tmpe));
            norm_64=W_add(norm_64,W_mult0_32_32(tmp,tmp));
            abs_x=W_add(abs_x, W_abs(singularVectors_Left_64[jCh][currChannel]));
            abs_x=W_add(abs_x, W_abs(singularVectors_Left_64[currChannel][jCh]));
        }
        tmpe=W_norm(norm_64);
        norm_x=W_extract_h(W_shl(norm_64, tmpe ));
        norm_x_e = add(sub(shl(singularVectors_e, 1), tmpe), 3 );
	printf("%016llX --> %08X<%2X   abs_x:%016llX \x1b[0m\n",norm_64,norm_x,norm_x_e,abs_x);
        IF (norm_x)
        {
            Word16 invVal_e;
@@ -1397,14 +1390,14 @@ 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("MYADD%d,%d: [%08X<%2x]  ",iCh,currChannel,f,f_e);
		//printf("MYADD%d,%d: [%08X<%2x]  ",iCh,currChannel,f,f_e);
                FOR( jCh = currChannel; jCh < nChannelsL; jCh++ ) /* nChannelsL */
                {
                    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]);
			//printf("%08X ",singularVectors[jCh][iCh]);
                    move32();
                }
		printf("\n");
		//printf("\n");
            }
        }
        // rescaling block
@@ -1412,7 +1405,7 @@ static void biDiagonalReductionLeft_fx(
        move32();
        singularValues_e[currChannel] = g_e;
        move16();
	printf("MYADD done\n");
	//printf("MYADD done\n");
    }

    return;
@@ -1594,11 +1587,13 @@ static void biDiagonalReductionRight_fx(
        move32();
        abs_x_e = 0;
        move16();
	printf("NORM64: ");
        FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */
        {
            norm_x = BASOP_Util_Add_Mant32Exp( norm_x, norm_x_e, Mpy_32_32( singularVectors[currChannel][jCh], singularVectors[currChannel][jCh] ), shl( singularVectors2_e[currChannel][jCh], 1 ), &norm_x_e ); /* exp(norm_x_e) */
            abs_x = BASOP_Util_Add_Mant32Exp( abs_x, abs_x_e, L_abs( singularVectors[currChannel][jCh] ), singularVectors2_e[currChannel][jCh], &abs_x_e );
        }
	printf("%08X<%2X   %08X<%2X \x1b[0m\n",norm_x,norm_x_e,abs_x,abs_x_e);

        IF( norm_x ) /*(fabsf(*sig_x) > EPSILON * fabsf(*sig_x)) { */
        {