Ignore:
Timestamp:
Jan 14, 2022, 7:01:21 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
a2a4566
Parents:
145dcd5 (diff), 9ee3f54 (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

Location:
libcfa/src/concurrency/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/fwd.hfa

    r145dcd5 rc90db2d  
    7979                        return
    8080                        #if defined(__SIZEOF_INT128__)
    81                                 __lehmer64( kernelTLS().rand_seed );
     81                                lehmer64( kernelTLS().rand_seed );
    8282                        #else
    83                                 __xorshift64( kernelTLS().rand_seed );
     83                                xorshift_13_7_17( kernelTLS().rand_seed );
    8484                        #endif
    8585                }
    8686
    87                 #define M  (1_l64u << 48_l64u)
    88                 #define A  (25214903917_l64u)
    89                 #define AI (18446708753438544741_l64u)
    90                 #define C  (11_l64u)
    91                 #define D  (16_l64u)
    92 
    9387                static inline unsigned __tls_rand_fwd() {
    94                         kernelTLS().ready_rng.fwd_seed = (A * kernelTLS().ready_rng.fwd_seed + C) & (M - 1);
    95                         return kernelTLS().ready_rng.fwd_seed >> D;
     88                        return LCGBI_fwd( kernelTLS().ready_rng.fwd_seed );
    9689                }
    9790
    9891                static inline unsigned __tls_rand_bck() {
    99                         unsigned int r = kernelTLS().ready_rng.bck_seed >> D;
    100                         kernelTLS().ready_rng.bck_seed = AI * (kernelTLS().ready_rng.bck_seed - C) & (M - 1);
    101                         return r;
    102                 }
    103 
    104                 #undef M
    105                 #undef A
    106                 #undef AI
    107                 #undef C
    108                 #undef D
     92                        return LCGBI_bck( kernelTLS().ready_rng.bck_seed );
     93                }
    10994
    11095                static inline void __tls_rand_advance_bck(void) {
     
    140125                        }
    141126                }
    142 
    143                 extern uint64_t thread_rand();
    144127
    145128                // Semaphore which only supports a single thread
  • libcfa/src/concurrency/kernel/startup.cfa

    r145dcd5 rc90db2d  
    102102extern void __wake_proc(processor *);
    103103extern int cfa_main_returned;                                                   // from interpose.cfa
     104extern uint32_t __global_random_seed;
    104105
    105106//-----------------------------------------------------------------------------
     
    175176        this.context = &storage_mainThreadCtx;
    176177}
    177 
    178178
    179179
     
    490490        preferred = ready_queue_new_preferred();
    491491        last_proc = 0p;
     492        random_state = __global_random_seed;
    492493        #if defined( __CFA_WITH_VERIFY__ )
    493494                canary = 0x0D15EA5E0D15EA5Ep;
Note: See TracChangeset for help on using the changeset viewer.