Changeset 7812a7b5 for libcfa


Ignore:
Timestamp:
Jun 30, 2020, 1:21:39 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
398e8e9, 9f7fff4
Parents:
bdce852
Message:

Fixed errors and warning with x86 build

Location:
libcfa/src
Files:
5 edited

Legend:

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

    rbdce852 r7812a7b5  
    44
    55//--------------------------------------------------
    6 typedef __uint128_t __lehmer64_state_t;
    7 static inline uint64_t __lehmer64( __lehmer64_state_t & state ) {
    8         state *= 0xda942042e4dd58b5;
    9         return state >> 64;
    10 }
     6#if defined(__SIZEOF_INT128__)
     7        typedef __uint128_t __lehmer64_state_t;
     8        static inline uint64_t __lehmer64( __lehmer64_state_t & state ) {
     9                state *= 0xda942042e4dd58b5;
     10                return state >> 64;
     11        }
    1112
    1213//--------------------------------------------------
    13 typedef uint64_t __wyhash64_state_t;
    14 static inline uint64_t __wyhash64( __wyhash64_state_t & state ) {
    15         state += 0x60bee2bee120fc15;
    16         __uint128_t tmp;
    17         tmp = (__uint128_t) state * 0xa3b195354a39b70d;
    18         uint64_t m1 = (tmp >> 64) ^ tmp;
    19         tmp = (__uint128_t)m1 * 0x1b03738712fad5c9;
    20         uint64_t m2 = (tmp >> 64) ^ tmp;
    21         return m2;
    22 }
     14        typedef uint64_t __wyhash64_state_t;
     15        static inline uint64_t __wyhash64( __wyhash64_state_t & state ) {
     16                state += 0x60bee2bee120fc15;
     17                __uint128_t tmp;
     18                tmp = (__uint128_t) state * 0xa3b195354a39b70d;
     19                uint64_t m1 = (tmp >> 64) ^ tmp;
     20                tmp = (__uint128_t)m1 * 0x1b03738712fad5c9;
     21                uint64_t m2 = (tmp >> 64) ^ tmp;
     22                return m2;
     23        }
     24#endif
    2325
    2426//--------------------------------------------------
  • libcfa/src/concurrency/invoke.h

    rbdce852 r7812a7b5  
    6060                                __uint128_t rand_seed;
    6161                        #else
    62                                 uint64 rand_seed;
     62                                uint64_t rand_seed;
    6363                        #endif
    6464                } kernelTLS __attribute__ ((tls_model ( "initial-exec" )));
  • libcfa/src/concurrency/io.cfa

    rbdce852 r7812a7b5  
    505505                        /* paranoid */ verify(&cqe);
    506506
    507                         struct io_user_data * data = (struct io_user_data *)cqe.user_data;
     507                        struct io_user_data * data = (struct io_user_data *)(uintptr_t)cqe.user_data;
    508508                        __cfadbg_print_safe( io, "Kernel I/O : Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd );
    509509
     
    831831                (this){ opcode, fd };
    832832                this.off = off;
    833                 this.addr = (uint64_t)addr;
     833                this.addr = (uint64_t)(uintptr_t)addr;
    834834                this.len = len;
    835835        }
     
    845845                struct io_uring_sqe * sqe; \
    846846                uint32_t idx; \
    847                 [sqe, idx] = __submit_alloc( ring, (uint64_t)&data );
     847                [sqe, idx] = __submit_alloc( ring, (uint64_t)(uintptr_t)&data );
    848848
    849849        #define __submit_wait \
    850850                /*__cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd );*/ \
    851                 verify( sqe->user_data == (uint64_t)&data ); \
     851                verify( sqe->user_data == (uint64_t)(uintptr_t)&data ); \
    852852                __submit( ring, idx ); \
    853853                park( __cfaabi_dbg_ctx ); \
  • libcfa/src/concurrency/kernel_private.hfa

    rbdce852 r7812a7b5  
    9292
    9393static inline uint64_t __tls_rand() {
    94         // kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6;
    95         // kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21;
    96         // kernelTLS.rand_seed ^= kernelTLS.rand_seed << 7;
    97         // return kernelTLS.rand_seed;
    9894        #if defined(__SIZEOF_INT128__)
    9995                return __lehmer64( kernelTLS.rand_seed );
    10096        #else
    101                 return __wyhash64( kernelTLS.rand_seed );
     97                return __xorshift64( kernelTLS.rand_seed );
    10298        #endif
    10399}
  • libcfa/src/concurrency/stats.cfa

    rbdce852 r7812a7b5  
    33
    44#include <unistd.h>                                                             // STDERR_FILENO
     5#include <inttypes.h>
    56#include "bits/debug.hfa"
    67#include "stats.hfa"
     
    9091                        __cfaabi_bits_print_safe( STDOUT_FILENO,
    9192                                "----- %s \"%s\" (%p) - Ready Q Stats -----\n"
    92                                 "- total threads run      : %'15lu\n"
    93                                 "- total threads scheduled: %'15lu\n"
    94                                 "- push average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
    95                                 "- pop  average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
    96                                 "- local push avg prb len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
    97                                 "- local pop  avg prb len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
    98                                 "- thread migrations      : %'15lu\n"
     93                                "- total threads run      : %'15" PRIu64 "\n"
     94                                "- total threads scheduled: %'15" PRIu64 "\n"
     95                                "- push average probe len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n"
     96                                "- pop  average probe len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n"
     97                                "- local push avg prb len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n"
     98                                "- local pop  avg prb len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n"
     99                                "- thread migrations      : %'15" PRIu64 "\n"
    99100                                "- Idle Sleep -\n"
    100                                 "-- halts                 : %'15lu\n"
    101                                 "-- cancelled halts       : %'15lu\n"
    102                                 "-- schedule wake         : %'15lu\n"
    103                                 "-- wake on exit          : %'15lu\n"
     101                                "-- halts                 : %'15" PRIu64 "\n"
     102                                "-- cancelled halts       : %'15" PRIu64 "\n"
     103                                "-- schedule wake         : %'15" PRIu64 "\n"
     104                                "-- wake on exit          : %'15" PRIu64 "\n"
    104105                                "\n"
    105106                                , cluster ? "Cluster" : "Processor",  name, id
     
    137138                                __cfaabi_bits_print_safe( STDOUT_FILENO,
    138139                                        "----- %s \"%s\" (%p) - I/O Stats -----\n"
    139                                         "- total submit calls     : %'15lu\n"
     140                                        "- total submit calls     : %'15" PRIu64 "\n"
    140141                                        "- avg ready entries      : %'18.2lf\n"
    141142                                        "- avg submitted entries  : %'18.2lf\n"
    142143                                        "- avg available entries  : %'18.2lf\n"
    143                                         "- total ready search     : %'15lu\n"
     144                                        "- total ready search     : %'15" PRIu64 "\n"
    144145                                        "- avg ready search len   : %'18.2lf\n"
    145146                                        "- avg ready search block : %'18.2lf\n"
    146                                         "- total alloc search     : %'15lu\n"
     147                                        "- total alloc search     : %'15" PRIu64 "\n"
    147148                                        "- avg alloc search len   : %'18.2lf\n"
    148149                                        "- avg alloc search block : %'18.2lf\n"
    149                                         "- total wait calls       : %'15lu   (%'lu slow, %'lu fast)\n"
     150                                        "- total wait calls       : %'15" PRIu64 "   (%'" PRIu64 " slow, %'" PRIu64 " fast)\n"
    150151                                        "- avg completion/wait    : %'18.2lf\n"
    151152                                        "\n"
Note: See TracChangeset for help on using the changeset viewer.