@@ -15,6 +15,16 @@ func (b *builder) createAtomicOp(name string) llvm.Value {
15
15
oldVal := b .CreateAtomicRMW (llvm .AtomicRMWBinOpAdd , ptr , val , llvm .AtomicOrderingSequentiallyConsistent , true )
16
16
// Return the new value, not the original value returned by atomicrmw.
17
17
return b .CreateAdd (oldVal , val , "" )
18
+ case "AndInt32" , "AndInt64" , "AndUint32" , "AndUint64" , "AndUintptr" :
19
+ ptr := b .getValue (b .fn .Params [0 ], getPos (b .fn ))
20
+ val := b .getValue (b .fn .Params [1 ], getPos (b .fn ))
21
+ oldVal := b .CreateAtomicRMW (llvm .AtomicRMWBinOpAnd , ptr , val , llvm .AtomicOrderingSequentiallyConsistent , true )
22
+ return oldVal
23
+ case "OrInt32" , "OrInt64" , "OrUint32" , "OrUint64" , "OrUintptr" :
24
+ ptr := b .getValue (b .fn .Params [0 ], getPos (b .fn ))
25
+ val := b .getValue (b .fn .Params [1 ], getPos (b .fn ))
26
+ oldVal := b .CreateAtomicRMW (llvm .AtomicRMWBinOpOr , ptr , val , llvm .AtomicOrderingSequentiallyConsistent , true )
27
+ return oldVal
18
28
case "SwapInt32" , "SwapInt64" , "SwapUint32" , "SwapUint64" , "SwapUintptr" , "SwapPointer" :
19
29
ptr := b .getValue (b .fn .Params [0 ], getPos (b .fn ))
20
30
val := b .getValue (b .fn .Params [1 ], getPos (b .fn ))
0 commit comments