26 return (
u16) (((
u32) op1 * (
u32) op2) >> 16);
40 if (op1 == (
s16) 0x8000 && op2 == (
s16) 0x8000)
43 result = ((
s32) (op1) * (
s32) (op2));
45 return (
s16) (result >> 15);
57 if (op1 < 0 && op2 < 0 && result > 0)
59 else if (op1 > 0 && op2 > 0 && result < 0)
74 if (temp > (
s32) 0x7fff)
75 result = (
s16) 0x7fff;
76 else if (temp < (
s32) 0xffff8000)
77 result = (
s16) 0xffff8000;
93 if (temp > (
s32) 0x7fff)
94 result = (
s16) 0x7fff;
95 else if (temp < (
s32) 0xffff8000)
96 result = (
s16) 0xffff8000;
116 else if (shift < -31)
119 for (i = 0; i < shift; i++)
122 result = result >> (-shift);
141 else if (shift < -15)
144 for (i = 0; i < shift; i++)
147 result = result >> (-shift);
169 u16 u16extraSignBits;
173 u16extraSignBits = 0;
174 while ((op >> 31) == (op >> 30)) {
179 return u16extraSignBits;
183 static const s16 log_table[] = {
218 #define LOG_TABLE_SIZE 32
219 #define LOG2_LOG_TABLE_SIZE 5
220 #define Q_LOG_TABLE 15
221 #define LOG10_2 19728
244 s16 s16norm, s16tableIndex, s16errorApproximation;
258 qN = qN + s16norm - 30;
276 s32log = log_table[s16tableIndex];
280 (
u16) (log_table[s16tableIndex + 1] -
281 log_table[s16tableIndex]));
284 s32log =
qm_add16((
s16) s32log, s16errorApproximation);
296 s32log =
qm_shl32(s32log, s16norm - 16);
305 *qLog10N = 15 + s16norm - 16 + 1;