| 215 | } |
| 216 | |
| 217 | static inline void pcg_cm_step_r(pcg_state_setseq_128 *rng) { |
| 218 | #if defined _WIN32 && _M_AMD64 |
| 219 | uint64_t h1; |
| 220 | pcg128_t product; |
| 221 | |
| 222 | /* Manually inline the multiplication and addition using intrinsics */ |
| 223 | h1 = rng->state.high * PCG_CHEAP_MULTIPLIER_128; |
| 224 | product.low = |
| 225 | _umul128(rng->state.low, PCG_CHEAP_MULTIPLIER_128, &(product.high)); |
| 226 | product.high += h1; |
| 227 | _addcarry_u64(_addcarry_u64(0, product.low, rng->inc.low, &(rng->state.low)), |
| 228 | product.high, rng->inc.high, &(rng->state.high)); |
| 229 | #else |
| 230 | rng->state = pcg128_add(pcg128_mult_64(rng->state, PCG_CHEAP_MULTIPLIER_128), |
| 231 | rng->inc); |
| 232 | #endif |
| 233 | } |
| 234 | |
| 235 | |
| 236 | static inline void pcg_cm_srandom_r(pcg_state_setseq_128 *rng, pcg128_t initstate, pcg128_t initseq) { |
no test coverage detected