diff options
Diffstat (limited to 'libFDK/include/mips')
-rw-r--r-- | libFDK/include/mips/abs_mips.h | 2 | ||||
-rw-r--r-- | libFDK/include/mips/cplx_mul_mips.h | 47 | ||||
-rw-r--r-- | libFDK/include/mips/scale_mips.h | 2 |
3 files changed, 7 insertions, 44 deletions
diff --git a/libFDK/include/mips/abs_mips.h b/libFDK/include/mips/abs_mips.h index dbb2063..5644bc0 100644 --- a/libFDK/include/mips/abs_mips.h +++ b/libFDK/include/mips/abs_mips.h @@ -107,7 +107,7 @@ amm-info@iis.fraunhofer.de #if defined(__GNUC__) && defined(__mips__) -#if defined(__mips_dsp) +#if defined(__mips_dsp) && !defined(__mips16) #define FUNCTION_fixabs_D #define FUNCTION_fixabs_I #define FUNCTION_fixabs_S diff --git a/libFDK/include/mips/cplx_mul_mips.h b/libFDK/include/mips/cplx_mul_mips.h index acae118..4ade3e5 100644 --- a/libFDK/include/mips/cplx_mul_mips.h +++ b/libFDK/include/mips/cplx_mul_mips.h @@ -103,7 +103,7 @@ amm-info@iis.fraunhofer.de #if !defined(CPLX_MUL_MIPS_H) #define CPLX_MUL_MIPS_H -#if defined(__GNUC__) && defined(__mips__) && __mips_isa_rev < 6 +#if defined(__GNUC__) && defined(__mips__) //#define FUNCTION_cplxMultDiv2_32x16 //#define FUNCTION_cplxMultDiv2_32x16X2 @@ -115,53 +115,16 @@ amm-info@iis.fraunhofer.de #if defined(FUNCTION_cplxMultDiv2_32x32X2) inline void cplxMultDiv2(FIXP_DBL *c_Re, FIXP_DBL *c_Im, FIXP_DBL a_Re, FIXP_DBL a_Im, FIXP_DBL b_Re, FIXP_DBL b_Im) { - INT result; - - __asm__( - "mult %[a_Re], %[b_Re];\n" - "msub %[a_Im], %[b_Im];\n" - "mfhi %[result];\n" - : [result] "=r"(result) - : [a_Re] "d"(a_Re), [b_Re] "d"(b_Re), [a_Im] "d"(a_Im), [b_Im] "d"(b_Im) - : "lo"); - - *c_Re = result; - - __asm__( - "mult %[a_Re], %[b_Im];\n" - "madd %[a_Im], %[b_Re];\n" - "mfhi %[result];\n" - : [result] "=r"(result) - : [a_Re] "r"(a_Re), [b_Im] "r"(b_Im), [a_Im] "r"(a_Im), [b_Re] "r"(b_Re) - : "lo"); - *c_Im = result; + *c_Re = (((long long)a_Re * (long long)b_Re) - ((long long)a_Im * (long long)b_Im))>>32; + *c_Im = (((long long)a_Re * (long long)b_Im) + ((long long)a_Im * (long long)b_Re))>>32; } #endif #if defined(FUNCTION_cplxMult_32x32X2) inline void cplxMult(FIXP_DBL *c_Re, FIXP_DBL *c_Im, FIXP_DBL a_Re, FIXP_DBL a_Im, FIXP_DBL b_Re, FIXP_DBL b_Im) { - INT result; - - __asm__( - "mult %[a_Re], %[b_Re];\n" - "msub %[a_Im], %[b_Im];\n" - "mfhi %[result];\n" - //"extr_w %[result], 31;\n" - : [result] "=r"(result) - : [a_Re] "r"(a_Re), [b_Re] "r"(b_Re), [a_Im] "r"(a_Im), [b_Im] "r"(b_Im) - : "lo"); - *c_Re = result << 1; - - __asm__( - "mult %[a_Re], %[b_Im];\n" - "madd %[a_Im], %[b_Re];\n" - "mfhi %[result];\n" - //"extr_w %[result], 31;\n" - : [result] "=r"(result) - : [a_Re] "r"(a_Re), [b_Im] "r"(b_Im), [a_Im] "r"(a_Im), [b_Re] "r"(b_Re) - : "lo"); - *c_Im = result << 1; + *c_Re = ((((long long)a_Re * (long long)b_Re) - ((long long)a_Im * (long long)b_Im))>>32)<<1; + *c_Im = ((((long long)a_Re * (long long)b_Im) + ((long long)a_Im * (long long)b_Re))>>32)<<1; } #endif diff --git a/libFDK/include/mips/scale_mips.h b/libFDK/include/mips/scale_mips.h index 3c141fc..882ef35 100644 --- a/libFDK/include/mips/scale_mips.h +++ b/libFDK/include/mips/scale_mips.h @@ -103,7 +103,7 @@ amm-info@iis.fraunhofer.de #ifndef SCALE_MIPS_H #define SCALE_MIPS_H -#if defined(__mips_dsp) +#if defined(__mips_dsp) && !defined(__mips16) /*! * |