Skip to content
  • Peter Trommler's avatar
    PPC NCG: Impl branch prediction, atomic ops. · 1130c67b
    Peter Trommler authored and Ben Gamari's avatar Ben Gamari committed
    Implement AtomicRMW ops, atomic read, atomic write
    in PowerPC native code generator. Also implement
    branch prediction because we need it in atomic ops
    anyway.
    
    This patch improves the issue in #12537 a bit but
    does not fix it entirely.
    
    The fallback operations for atomicread and atomicwrite
    in libraries/ghc-prim/cbits/atomic.c are incorrect.
    This patch avoids those functions by implementing the
    operations directly in the native code generator. This
    is also what the x86/amd64 NCG and the LLVM backend
    do.
    
    Test Plan: validate on AIX and PowerPC (32-bit) Linux
    
    Reviewers: erikd, hvr, austin, bgamari, simonmar
    
    Reviewed By: hvr, bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #12537
    
    Differential Revision: https://phabricator.haskell.org/D3984
    1130c67b