Lines Matching refs:valA
47 uint16 bbs_sqrt32( uint32 valA ) in bbs_sqrt32() argument
51 expL += ( ( valA >> ( expL + 0x10 ) ) != 0 ) << 4; in bbs_sqrt32()
52 expL += ( ( valA >> ( expL + 0x08 ) ) != 0 ) << 3; in bbs_sqrt32()
53 expL += ( ( valA >> ( expL + 0x04 ) ) != 0 ) << 2; in bbs_sqrt32()
54 expL += ( ( valA >> ( expL + 0x02 ) ) != 0 ) << 1; in bbs_sqrt32()
57 case 15: rootL += ( ( rootL + 0x8000 ) * ( rootL + 0x8000 ) <= valA ) << 15; in bbs_sqrt32()
58 case 14: rootL += ( ( rootL + 0x4000 ) * ( rootL + 0x4000 ) <= valA ) << 14; in bbs_sqrt32()
59 case 13: rootL += ( ( rootL + 0x2000 ) * ( rootL + 0x2000 ) <= valA ) << 13; in bbs_sqrt32()
60 case 12: rootL += ( ( rootL + 0x1000 ) * ( rootL + 0x1000 ) <= valA ) << 12; in bbs_sqrt32()
61 case 11: rootL += ( ( rootL + 0x0800 ) * ( rootL + 0x0800 ) <= valA ) << 11; in bbs_sqrt32()
62 case 10: rootL += ( ( rootL + 0x0400 ) * ( rootL + 0x0400 ) <= valA ) << 10; in bbs_sqrt32()
63 case 9: rootL += ( ( rootL + 0x0200 ) * ( rootL + 0x0200 ) <= valA ) << 9; in bbs_sqrt32()
64 case 8: rootL += ( ( rootL + 0x0100 ) * ( rootL + 0x0100 ) <= valA ) << 8; in bbs_sqrt32()
65 case 7: rootL += ( ( rootL + 0x0080 ) * ( rootL + 0x0080 ) <= valA ) << 7; in bbs_sqrt32()
66 case 6: rootL += ( ( rootL + 0x0040 ) * ( rootL + 0x0040 ) <= valA ) << 6; in bbs_sqrt32()
67 case 5: rootL += ( ( rootL + 0x0020 ) * ( rootL + 0x0020 ) <= valA ) << 5; in bbs_sqrt32()
68 case 4: rootL += ( ( rootL + 0x0010 ) * ( rootL + 0x0010 ) <= valA ) << 4; in bbs_sqrt32()
69 case 3: rootL += ( ( rootL + 0x0008 ) * ( rootL + 0x0008 ) <= valA ) << 3; in bbs_sqrt32()
70 case 2: rootL += ( ( rootL + 0x0004 ) * ( rootL + 0x0004 ) <= valA ) << 2; in bbs_sqrt32()
71 case 1: rootL += ( ( rootL + 0x0002 ) * ( rootL + 0x0002 ) <= valA ) << 1; in bbs_sqrt32()
72 case 0: rootL += ( ( rootL + 0x0001 ) * ( rootL + 0x0001 ) <= valA ) << 0; in bbs_sqrt32()
80 uint8 bbs_sqrt16( uint16 valA ) in bbs_sqrt16() argument
83 rootL += ( ( rootL + 0x80 ) * ( rootL + 0x80 ) <= valA ) << 7; in bbs_sqrt16()
84 rootL += ( ( rootL + 0x40 ) * ( rootL + 0x40 ) <= valA ) << 6; in bbs_sqrt16()
85 rootL += ( ( rootL + 0x20 ) * ( rootL + 0x20 ) <= valA ) << 5; in bbs_sqrt16()
86 rootL += ( ( rootL + 0x10 ) * ( rootL + 0x10 ) <= valA ) << 4; in bbs_sqrt16()
87 rootL += ( ( rootL + 0x08 ) * ( rootL + 0x08 ) <= valA ) << 3; in bbs_sqrt16()
88 rootL += ( ( rootL + 0x04 ) * ( rootL + 0x04 ) <= valA ) << 2; in bbs_sqrt16()
89 rootL += ( ( rootL + 0x02 ) * ( rootL + 0x02 ) <= valA ) << 1; in bbs_sqrt16()
90 rootL += ( ( rootL + 0x01 ) * ( rootL + 0x01 ) <= valA ) << 0; in bbs_sqrt16()
125 uint16 bbs_fastSqrt32( uint32 valA ) in bbs_fastSqrt32() argument
132 if( valA == 0 ) return 0; in bbs_fastSqrt32()
135 expL += ( ( valA >> ( expL + 0x10 ) ) != 0 ) << 4; in bbs_fastSqrt32()
136 expL += ( ( valA >> ( expL + 0x08 ) ) != 0 ) << 3; in bbs_fastSqrt32()
137 expL += ( ( valA >> ( expL + 0x04 ) ) != 0 ) << 2; in bbs_fastSqrt32()
138 expL += ( ( valA >> ( expL + 0x02 ) ) != 0 ) << 1; in bbs_fastSqrt32()
140 valL = ( ( valA << ( 30 - expL ) ) - 1073741824 ); /* ( 1 << 30 ) */ in bbs_fastSqrt32()
179 uint32 bbs_invSqrt32( uint32 valA ) in bbs_invSqrt32() argument
187 if( valA == 0U ) return 0x80000000; in bbs_invSqrt32()
190 expL += ( ( valA >> ( expL + 0x10 ) ) != 0 ) << 4; in bbs_invSqrt32()
191 expL += ( ( valA >> ( expL + 0x08 ) ) != 0 ) << 3; in bbs_invSqrt32()
192 expL += ( ( valA >> ( expL + 0x04 ) ) != 0 ) << 2; in bbs_invSqrt32()
193 expL += ( ( valA >> ( expL + 0x02 ) ) != 0 ) << 1; in bbs_invSqrt32()
195 valL = ( ( valA << ( 30 - expL ) ) - 1073741824 ); /* ( 1 << 30 ) */ in bbs_invSqrt32()
218 int32 bbs_inv32( int32 valA ) in bbs_inv32() argument
222 int32 signL = ( ( valA >> 30 ) & 0xFFFFFFFE ) + 1; in bbs_inv32()
223 int32 valL = signL * valA; in bbs_inv32()
245 uint32 bbs_intLog2( uint32 valA ) in bbs_intLog2() argument
248 expL += 0x10 * ( ( valA >> ( expL + 0x10 ) ) != 0 ); in bbs_intLog2()
249 expL += 0x08 * ( ( valA >> ( expL + 0x08 ) ) != 0 ); in bbs_intLog2()
250 expL += 0x04 * ( ( valA >> ( expL + 0x04 ) ) != 0 ); in bbs_intLog2()
251 expL += 0x02 * ( ( valA >> ( expL + 0x02 ) ) != 0 ); in bbs_intLog2()
252 expL += 0x01 * ( ( valA >> ( expL + 0x01 ) ) != 0 ); in bbs_intLog2()
278 uint32 bbs_pow2M1( uint32 valA ) in bbs_pow2M1() argument
280 uint32 offsL = ( valA & 0x03FFFFFF ) >> 10; in bbs_pow2M1()
281 uint16 indexL = ( ( valA & 0xFC000000 ) >> 26 ) << 1; in bbs_pow2M1()
287 uint32 bbs_pow2( int32 valA ) in bbs_pow2() argument
289 int32 shiftL = 16 - ( valA >> 27 ); in bbs_pow2()
290 uint32 offsL = ( uint32 )( valA << 5 ); in bbs_pow2()
297 uint32 bbs_exp( int32 valA ) in bbs_exp() argument
304 if( valA < -1488522236 ) in bbs_exp()
308 else if( valA > 1488522236 ) in bbs_exp()
314 adjustedL = ( valA >> 16 ) * 94548 + ( ( ( ( ( uint32 )valA ) & 0x0FFFF ) * 47274 ) >> 15 ); in bbs_exp()
324 int16 bbs_satS16( int32 valA ) in bbs_satS16() argument
326 if( valA > 32767 ) return 32767; in bbs_satS16()
327 if( valA < -32768 ) return -32768; in bbs_satS16()
328 return valA; in bbs_satS16()
729 int32 bbs_fermi( int32 valA ) in bbs_fermi() argument
731 uint32 indexL = ( ( valA >> 15 ) + 20 ) << 1; in bbs_fermi()
732 uint32 offsL = ( ( valA & 0x00007FFF ) + 4 ) >> 3; in bbs_fermi()
733 if( valA < -655360 ) return 1; in bbs_fermi()
734 if( valA >= 655360 ) return 1073741824 - 1; /* ( 1 << 30 ) */ in bbs_fermi()