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