diff options
author | alexbiehl <alex.biehl@gmail.com> | 2016-08-01 18:46:29 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-08-01 18:46:30 +1000 |
commit | 750553a68c126bdbee3d325a606a9537a8d53141 (patch) | |
tree | 660d147ee59f58742da86e3675b706ae9ed0b9dd /compiler/cmm | |
parent | 89ae1e858f6eed42cebd9af01b30e239d4543faf (diff) | |
download | haskell-750553a68c126bdbee3d325a606a9537a8d53141.tar.gz |
Use MO_Cmpxchg in Primops.cmm instead of ccall cas(..)
Adjust `CmmParse.y` to parse the `cmpxchg{8, 16, 32, 64}` instructions
and use the 32 respectively the 64 bit variant in `Primops.cmm`. This
effectively eliminates the compare-and-swap ccall to the rts.
Based off the mailing list question from @osa1
(https://mail.haskell.org/pipermail/ghc-devs/2016-July/012506.html).
Reviewers: simonmar, austin, erikd, bgamari, trommler
Reviewed By: erikd, bgamari, trommler
Subscribers: carter, trommler, osa1, thomie
Differential Revision: https://phabricator.haskell.org/D2431
Diffstat (limited to 'compiler/cmm')
-rw-r--r-- | compiler/cmm/CmmParse.y | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 128cc4e4e1..b8c100a3c0 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -987,7 +987,12 @@ callishMachOps = listToUFM $ ( "popcnt8", (,) $ MO_PopCnt W8 ), ( "popcnt16", (,) $ MO_PopCnt W16 ), ( "popcnt32", (,) $ MO_PopCnt W32 ), - ( "popcnt64", (,) $ MO_PopCnt W64 ) + ( "popcnt64", (,) $ MO_PopCnt W64 ), + + ( "cmpxchg8", (,) $ MO_Cmpxchg W8 ), + ( "cmpxchg16", (,) $ MO_Cmpxchg W16 ), + ( "cmpxchg32", (,) $ MO_Cmpxchg W32 ), + ( "cmpxchg64", (,) $ MO_Cmpxchg W64 ) -- ToDo: the rest, maybe -- edit: which rest? |