Changeset 314dab6


Ignore:
Timestamp:
May 18, 2020, 4:40:10 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7c38d53
Parents:
893da07
Message:

add -latomic flag to cfa.cc to get 16-byte CAS, add containers/stackLockFree.hfa to Makefile headers, fix flag for detecting int128 in stackLockFree.hfa

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    r893da07 r314dab6  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 31 16:48:03 2020
    13 // Update Count     : 421
     12// Last Modified On : Mon May 18 13:26:26 2020
     13// Update Count     : 424
    1414//
    1515
     
    301301        } // for
    302302
    303         #ifdef __x86_64__
    304         args[nargs++] = "-mcx16";                                                       // allow double-wide CAA
    305         #endif // __x86_64__
    306 
    307303        #ifdef __DEBUG_H__
    308304        cerr << "args:";
     
    419415                args[nargs++] = "-lcfa";
    420416                args[nargs++] = "-Wl,--pop-state";
     417                #ifdef __x86_64__
     418                args[nargs++] = "-mcx16";                                               // allow double-wide CAS
     419                args[nargs++] = "-latomic";
     420                #endif // __x86_64__
    421421                args[nargs++] = "-pthread";
    422422                args[nargs++] = "-ldl";
  • libcfa/src/Makefile.am

    r893da07 r314dab6  
    1111## Created On       : Sun May 31 08:54:01 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Mon Mar 16 18:07:59 2020
    14 ## Update Count     : 242
     13## Last Modified On : Sun May 17 21:10:26 2020
     14## Update Count     : 243
    1515###############################################################################
    1616
     
    4242                bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa containers/list.hfa
    4343headers = fstream.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa time.hfa stdlib.hfa common.hfa \
    44                 containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa
     44                containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/stackLockFree.hfa containers/vector.hfa
    4545
    4646libsrc = startup.cfa interpose.cfa bits/debug.cfa assert.cfa exception.c virtual.c heap.cfa ${headers:.hfa=.cfa}
  • libcfa/src/containers/stackLockFree.hfa

    r893da07 r314dab6  
    99// Created On       : Wed May 13 20:58:58 2020
    1010// Last Modified By : Peter A. Buhr
    11 // Last Modified On : Sun May 17 20:53:37 2020
    12 // Update Count     : 48
     11// Last Modified On : Mon May 18 13:30:08 2020
     12// Update Count     : 55
    1313//
    1414
     
    2323                uintptr_t count;                                                // count each push
    2424        };
    25         #if _GLIBCXX_USE_INT128 == 1
     25        #if __SIZEOF_INT128__ == 16
    2626        __int128                                                                        // gcc, 128-bit integer
    2727        #else
    2828        uint64_t                                                                        // 64-bit integer
    29         #endif // _GLIBCXX_USE_INT128 == 1
     29        #endif // __SIZEOF_INT128__ == 16
    3030        atom;
    3131}; // Link
     
    4444                        for () {                                                                        // busy wait
    4545                                *getNext( &n ) = stack;                                 // atomic assignment unnecessary, or use CAA
    46                                 if ( __atomic_compare_exchange_n( &stack.atom, &getNext( &n )->atom, (Link(T))@{ {&n, getNext( &n )->count + 1} }.atom, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ) break; // attempt to update top node
     46                          if ( __atomic_compare_exchange_n( &stack.atom, &getNext( &n )->atom, (Link(T))@{ {&n, getNext( &n )->count + 1} }.atom, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ) break; // attempt to update top node
    4747                        } // for
    4848                } // push
Note: See TracChangeset for help on using the changeset viewer.