Changeset 29702ad for libcfa/src/bits


Ignore:
Timestamp:
Nov 22, 2022, 10:18:04 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
20cf96d
Parents:
1553a55 (diff), d41735a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/random.hfa

    r1553a55 r29702ad  
    1010// Created On       : Fri Jan 14 07:18:11 2022
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 14 07:18:58 2022
    13 // Update Count     : 1
     12// Last Modified On : Mon Nov 21 17:50:12 2022
     13// Update Count     : 15
    1414//
    1515
     
    1717
    1818#include <stdint.h>
     19
     20// Set default PRNG for architecture size.
     21#ifdef __x86_64__                                                                               // 64-bit architecture
     22#define LEHMER64
     23#else                                                                                                   // 32-bit architecture
     24#define XORSHIFT_6_21_7
     25#endif // __x86_64__
     26
     27// C/CFA PRNG name and random-state.
     28#ifdef LEHMER64
     29#define PRNG_NAME lehmer64
     30#define PRNG_ARG_T __uint128_t
     31#endif // LEHMER64
     32
     33#ifdef XORSHIFT_6_21_7
     34#define PRNG_NAME xorshift_6_21_7
     35#define PRNG_ARG_T uint32_t
     36#endif // XORSHIFT_6_21_7
     37
     38#ifdef __cforall                                                                                // don't include in C code (invoke.h)
    1939
    2040// Pipelined to allow out-of-order overlap with reduced dependencies. Critically, the current random state is returned
     
    6181//--------------------------------------------------
    6282typedef struct {
    63   uint32_t a, b, c, d;
    64   uint32_t counter;
     83        uint32_t a, b, c, d;
     84        uint32_t counter;
    6585} xorwow__state_t;
    6686
     
    116136#undef C
    117137#undef D
     138
     139#endif // __cforall
Note: See TracChangeset for help on using the changeset viewer.