diff options
author | Jonathan Thackray <jonathan.thackray@arm.com> | 2025-04-30 22:06:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-30 22:06:37 +0100 |
commit | 6e49f73825f1b9cb98352a7c8dca3e0cf83ebd9e (patch) | |
tree | 854e2a21de5728cc71797b49dadf83ddcacb8212 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 9b0eaf71e674a28ee55be3afa11b5f7d4da732c0 (diff) | |
download | llvm-6e49f73825f1b9cb98352a7c8dca3e0cf83ebd9e.zip llvm-6e49f73825f1b9cb98352a7c8dca3e0cf83ebd9e.tar.gz llvm-6e49f73825f1b9cb98352a7c8dca3e0cf83ebd9e.tar.bz2 |
Reland [llvm] Add support for llvm IR atomicrmw fminimum/fmaximum instructions (#137701)
This patch adds support for LLVM IR atomicrmw `fmaximum` and `fminimum`
instructions.
These mirror the `llvm.maximum.*` and `llvm.minimum.*` instructions, but
are atomic and use IEEE754 2019 handling for NaNs, which is different to
`fmax` and `fmin`. See:
https://llvm.org/docs/LangRef.html#llvm-minimum-intrinsic
for more details.
Future changes will allow this LLVM IR to be lowered to specialised
assembler instructions on suitable targets, such as AArch64.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 1d7aa18..0e75c44 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1356,6 +1356,10 @@ static AtomicRMWInst::BinOp getDecodedRMWOperation(unsigned Val) { case bitc::RMW_FSUB: return AtomicRMWInst::FSub; case bitc::RMW_FMAX: return AtomicRMWInst::FMax; case bitc::RMW_FMIN: return AtomicRMWInst::FMin; + case bitc::RMW_FMAXIMUM: + return AtomicRMWInst::FMaximum; + case bitc::RMW_FMINIMUM: + return AtomicRMWInst::FMinimum; case bitc::RMW_UINC_WRAP: return AtomicRMWInst::UIncWrap; case bitc::RMW_UDEC_WRAP: |