================
@@ -4105,14 +4102,21 @@ LValue ScalarExprEmitter::EmitCompoundAssignLValue(
// the loaded integer to double, performing FP arithmetics, and truncation
// back as a single atomic operation. Integer promotion is still
// semantically safe.
- bool CanEmitAtomicRMW =
+ bool CanEmitIntegerRMW =
!AtomicValueTy->isBooleanType() && AtomicValueTy->isIntegerType() &&
ResultTy->isIntegerType() &&
!(AtomicValueTy->isUnsignedIntegerType() &&
CGF.SanOpts.has(SanitizerKind::UnsignedIntegerOverflow)) &&
CGF.getLangOpts().getSignedOverflowBehavior() !=
LangOptions::SOB_Trapping;
- if (CanEmitAtomicRMW) {
+ bool CanEmitFloatingRMW = false;
+ if (!Builder.getIsFPConstrained() && AtomicValueTy->isFloatingType() &&
----------------
Lukacma wrote:
I think I need to limit it based on rounding mode as well. As atomicrmw doesn't
have constrained variant it is only valid with constrained operation, only if
their rounding mode is "round.tonearest" as it needs to match default
floating-point environment assumed by LLVM for non-constrained operations. But
I agree that using getExceptionMode and getRoundingMode is more precise here !
https://github.com/llvm/llvm-project/pull/216033
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits