[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 2 07:54:38 PST 2020


arsenm added inline comments.


================
Comment at: clang/lib/CodeGen/CGAtomic.cpp:597-598
   case AtomicExpr::AO__atomic_add_fetch:
-    PostOp = llvm::Instruction::Add;
+    PostOp = E->getValueType()->isFloatingType() ? llvm::Instruction::FAdd
+                                                 : llvm::Instruction::Add;
     LLVM_FALLTHROUGH;
----------------
Should this really be based on the type, or should the builtin name be different for FP?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71726/new/

https://reviews.llvm.org/D71726





More information about the cfe-commits mailing list