1 /* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
20 Pathname: .fxp_mul32_msc_evc_armv5.h
22 ------------------------------------------------------------------------------
27 ------------------------------------------------------------------------------
30 ------------------------------------------------------------------------------
33 #ifndef FXP_MUL32_MSC_EVC_ARMV5
34 #define FXP_MUL32_MSC_EVC_ARMV5
43 #include "pv_audio_type_defs.h"
45 #if defined(PV_ARM_MSC_EVC_V5)
48 #include "cmnintrin.h"
50 #define preload_cache( a)
52 #define shft_lft_1( L_var1) _AddSatInt( L_var1, L_var1)
54 #define fxp_mul_16_by_16bb( L_var1, L_var2) _SmulLo_SW_SL( L_var1, L_var2)
56 #define fxp_mul_16_by_16(a, b) fxp_mul_16_by_16bb( a, b)
58 #define fxp_mul_16_by_16tb( L_var1, L_var2) _SmulHiLo_SW_SL( L_var1, L_var2)
60 #define fxp_mul_16_by_16bt( L_var1, L_var2) _SmulLoHi_SW_SL( L_var1, L_var2)
62 #define fxp_mul_16_by_16tt( L_var1, L_var2) _SmulHi_SW_SL( L_var1, L_var2)
64 #define fxp_mac_16_by_16( L_var1, L_var2, L_add) _SmulAddLo_SW_SL( L_add, L_var1, L_var2)
66 #define fxp_mac_16_by_16_bb(a, b, c) fxp_mac_16_by_16( a, b, c)
68 #define fxp_mac_16_by_16_bt( L_var1, L_var2, L_add) _SmulAddLoHi_SW_SL( L_add, L_var1, L_var2)
71 __inline Int32 cmplx_mul32_by_16(Int32 L_var1, const Int32 L_var2, const Int32 cmplx)
75 result64_hi = _SmulWHi_SW_SL(L_var1, cmplx);
76 result64_hi = _SmulAddWLo_SW_SL(result64_hi, L_var2, cmplx);
81 #define fxp_mul32_by_16( L_var1, L_var2) _SmulWLo_SW_SL( L_var1, L_var2)
83 #define fxp_mul32_by_16b( a, b) fxp_mul32_by_16( a, b)
85 #define fxp_mul32_by_16t( L_var1, L_var2) _SmulWHi_SW_SL( L_var1, L_var2)
87 #define fxp_mac32_by_16( L_var1, L_var2, L_add) _SmulAddWLo_SW_SL( L_add, L_var1, L_var2)
90 __inline int64 fxp_mac64_Q31(int64 sum, const Int32 L_var1, const Int32 L_var2)
92 sum += (int64)L_var1 * L_var2;
96 #define fxp_mul32_Q31( a, b) _MulHigh( b, a)
99 __inline Int32 fxp_mac32_Q31(Int32 L_add, const Int32 a, const Int32 b)
101 return (L_add + _MulHigh(b, a));
105 __inline Int32 fxp_msu32_Q31(Int32 L_sub, const Int32 a, const Int32 b)
107 return (L_sub - _MulHigh(b, a));
111 __inline Int32 fxp_mul32_Q30(const Int32 a, const Int32 b)
113 return (Int32)(((int64)(a) * b) >> 30);
116 __inline Int32 fxp_mac32_Q30(const Int32 a, const Int32 b, Int32 L_add)
118 return (L_add + (Int32)(((int64)(a) * b) >> 30));
122 __inline Int32 fxp_mul32_Q29(const Int32 a, const Int32 b)
124 return (Int32)(((int64)(a) * b) >> 29);
127 __inline Int32 fxp_mac32_Q29(const Int32 a, const Int32 b, Int32 L_add)
129 return (L_add + (Int32)(((int64)(a) * b) >> 29));
132 __inline Int32 fxp_msu32_Q29(const Int32 a, const Int32 b, Int32 L_sub)
134 return (L_sub - (Int32)(((int64)(a) * b) >> 29));
138 __inline Int32 fxp_mul32_Q28(const Int32 a, const Int32 b)
140 return (Int32)(((int64)(a) * b) >> 28);
143 __inline Int32 fxp_mul32_Q27(const Int32 a, const Int32 b)
145 return (Int32)(((int64)(a) * b) >> 27);
148 __inline Int32 fxp_mul32_Q26(const Int32 a, const Int32 b)
150 return (Int32)(((int64)(a) * b) >> 26);
153 __inline Int32 fxp_mul32_Q20(const Int32 a, const Int32 b)
155 return (Int32)(((int64)(a) * b) >> 20);
158 __inline Int32 fxp_mul32_Q15(const Int32 a, const Int32 b)
160 return (Int32)(((int64)(a) * b) >> 15);
163 __inline Int32 fxp_mul32_Q14(const Int32 a, const Int32 b)
165 return (Int32)(((int64)(a) * b) >> 14);
177 #endif /* FXP_MUL32 */