summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingFile.c
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-12-14 19:00:21 +0000
committerReid Kleckner <rnk@google.com>2017-12-14 19:00:21 +0000
commit627f45fe5289193854329a75f46bd3d2197f8fa8 (patch)
tree0df598d34bd5269981a7497f3b6a63685bfee32b /compiler-rt/lib/profile/InstrProfilingFile.c
parentf19d3cd43b1f175b9c60e20d45c4c84161e15322 (diff)
downloadbcm5719-llvm-627f45fe5289193854329a75f46bd3d2197f8fa8.tar.gz
bcm5719-llvm-627f45fe5289193854329a75f46bd3d2197f8fa8.zip
[CodeGen][X86] Implement _InterlockedCompareExchange128 intrinsic
Summary: InterlockedCompareExchange128 is a bit more complicated than the other InterlockedCompareExchange functions, so it requires a bit more work. It doesn't directly refer to 128bit ints, instead it takes pointers to 64bit ints for Destination and ComparandResult, and exchange is taken as two 64bit ints (high & low). The previous value is written to ComparandResult, and success is returned. This implementation does the following in order to produce a cmpxchg instruction: 1. Cast everything to 128bit ints or int pointers, and glues together the Exchange values 2. Reads from CompareandResult to get the comparand 3. Calls cmpxchg volatile (on X86 this will produce a lock cmpxchg16b instruction) 1. Result 0 (previous value) is written back to ComparandResult 2. Result 1 (success bool) is zext'ed to a uchar and returned Resolves bug https://llvm.org/PR35251 Patch by Colden Cullen! Reviewers: rnk, agutowski Reviewed By: rnk Subscribers: majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D41032 llvm-svn: 320730
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfilingFile.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud