MCPcopy Create free account
hub / github.com/numpy/numpy / BigInt_Set_2x_uint64

Function BigInt_Set_2x_uint64

numpy/core/src/multiarray/dragon4.c:224–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222 defined(HAVE_LDOUBLE_IEEE_QUAD_LE) || \
223 defined(HAVE_LDOUBLE_IEEE_QUAD_BE))
224static void
225BigInt_Set_2x_uint64(BigInt *i, npy_uint64 hi, npy_uint64 lo)
226{
227 if (hi > bitmask_u64(32)) {
228 i->length = 4;
229 }
230 else if (hi != 0) {
231 i->length = 3;
232 }
233 else if (lo > bitmask_u64(32)) {
234 i->length = 2;
235 }
236 else if (lo != 0) {
237 i->length = 1;
238 }
239 else {
240 i->length = 0;
241 }
242
243 /* Note deliberate fallthrough in this switch */
244 switch (i->length) {
245 case 4:
246 i->blocks[3] = (hi >> 32) & bitmask_u64(32);
247 case 3:
248 i->blocks[2] = hi & bitmask_u64(32);
249 case 2:
250 i->blocks[1] = (lo >> 32) & bitmask_u64(32);
251 case 1:
252 i->blocks[0] = lo & bitmask_u64(32);
253 }
254}
255#endif /* DOUBLE_DOUBLE and QUAD */
256
257static void

Calls 1

bitmask_u64Function · 0.85

Tested by

no test coverage detected