From cbf7f3cea6ba429e296d83da21de68a2b95e0dea Mon Sep 17 00:00:00 2001 From: Benji Smith Date: Sat, 21 Sep 2024 11:42:45 -0400 Subject: [PATCH] [C API] Add usub_cond and usub_sat atomic ops to C API These were added in the C++ API in https://github.com/llvm/llvm-project/pull/105568 but were not exposed via the C API previously --- llvm/docs/ReleaseNotes.rst | 1 + llvm/include/llvm-c/Core.h | 3 +++ llvm/lib/IR/Core.cpp | 8 ++++++++ llvm/test/Bindings/llvm-c/atomics.ll | 3 +++ 4 files changed, 15 insertions(+) diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst index 660a3785367a3..e2a6480c153ae 100644 --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -204,6 +204,7 @@ Changes to the C API * ``LLVMGetNextDbgRecord`` * ``LLVMGetPreviousDbgRecord`` +* Added ``LLVMAtomicRMWBinOpUSubCond`` and ``LLVMAtomicRMWBinOpUSubSat`` to ``LLVMAtomicRMWBinOp`` enum for AtomicRMW instructions. Changes to the CodeGen infrastructure ------------------------------------- diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index 19e059295018e..26d4ef424b2a1 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -395,6 +395,9 @@ typedef enum { when incremented above input value */ LLVMAtomicRMWBinOpUDecWrap, /**< Decrements the value, wrapping back to the input value when decremented below zero */ + LLVMAtomicRMWBinOpUSubCond, /**