@@ -164,6 +164,21 @@ static inline slimb_t sat_add(slimb_t a, slimb_t b)
164
164
return r ;
165
165
}
166
166
167
+ static inline __maybe_unused limb_t shrd (limb_t low , limb_t high , long shift )
168
+ {
169
+ if (shift != 0 )
170
+ low = (low >> shift ) | (high << (LIMB_BITS - shift ));
171
+ return low ;
172
+ }
173
+
174
+ static inline __maybe_unused limb_t shld (limb_t a1 , limb_t a0 , long shift )
175
+ {
176
+ if (shift != 0 )
177
+ return (a1 << shift ) | (a0 >> (LIMB_BITS - shift ));
178
+ else
179
+ return a1 ;
180
+ }
181
+
167
182
#define malloc (s ) malloc_is_forbidden(s)
168
183
#define free (p ) free_is_forbidden(p)
169
184
#define realloc (p , s ) realloc_is_forbidden(p, s)
@@ -236,7 +251,7 @@ int bf_set_ui(bf_t *r, uint64_t a)
236
251
a1 = a >> 32 ;
237
252
shift = clz (a1 );
238
253
r -> tab [0 ] = a0 << shift ;
239
- r -> tab [1 ] = (a1 << shift ) | ( a0 >> ( LIMB_BITS - shift ) );
254
+ r -> tab [1 ] = shld (a1 , a0 , shift );
240
255
r -> expn = 2 * LIMB_BITS - shift ;
241
256
}
242
257
#endif
@@ -5388,21 +5403,6 @@ int bf_acos(bf_t *r, const bf_t *a, limb_t prec, bf_flags_t flags)
5388
5403
5389
5404
#endif /* LIMB_BITS != 64 */
5390
5405
5391
- static inline __maybe_unused limb_t shrd (limb_t low , limb_t high , long shift )
5392
- {
5393
- if (shift != 0 )
5394
- low = (low >> shift ) | (high << (LIMB_BITS - shift ));
5395
- return low ;
5396
- }
5397
-
5398
- static inline __maybe_unused limb_t shld (limb_t a1 , limb_t a0 , long shift )
5399
- {
5400
- if (shift != 0 )
5401
- return (a1 << shift ) | (a0 >> (LIMB_BITS - shift ));
5402
- else
5403
- return a1 ;
5404
- }
5405
-
5406
5406
#if LIMB_DIGITS == 19
5407
5407
5408
5408
/* WARNING: hardcoded for b = 1e19. It is assumed that:
0 commit comments