21 ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x)) 47 return (
word)(prod & 0xFFFF);
65 if (b >= 0)
return a +
b;
71 else if (b <= 0)
return a +
b;
81 if (b >= 0)
return a -
b;
89 else if (b <= 0)
return a -
b;
98 static unsigned char const bitoff[ 256 ] = {
99 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
100 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
101 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
103 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
104 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
105 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
106 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
107 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
113 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
140 if (a <= -1073741824)
return 0;
144 return a & 0xffff0000
146 ? -1 + bitoff[ 0xFF & (a >> 24) ]
147 : 7 + bitoff[ 0xFF & (a >> 16) ] )
149 ? 15 + bitoff[ 0xFF & (a >> 8) ]
150 : 23 + bitoff[ 0xFF &
a ] );
155 if (n >= 32)
return 0;
156 if (n <= -32)
return -(a < 0);
157 if (n < 0)
return gsm_L_asr(a, -n);
163 if (n >= 16)
return 0;
164 if (n <= -16)
return -(a < 0);
165 if (n < 0)
return gsm_asr(a, -n);
171 if (n >= 32)
return -(a < 0);
172 if (n <= -32)
return 0;
173 if (n < 0)
return a << -n;
178 if (a >= 0)
return a >> n;
185 if (n >= 16)
return -(a < 0);
186 if (n <= -16)
return 0;
187 if (n < 0)
return a << -n;
192 if (a >= 0)
return a >> n;
220 assert(num >= 0 && denum >= num);
228 if (L_num >= L_denum) {
static unsigned char const bitoff[256]
word gsm_abs P1((a), word a)
word gsm_add P2((a, b), word a, word b)