================
@@ -1399,13 +1401,22 @@ RValue AtomicInfo::convertAtomicTempToRValue(Address 
addr,
       LVal.getBaseInfo(), TBAAAccessInfo()));
 }
 
+static bool shouldCastToInt(llvm::Type *ValTy, bool CmpXchg) {
----------------
JonPsson1 wrote:

This is a bit messy...

- For one thing, there can't currently be an atomic CmpXchg of float type - per 
the spec - so that must be casted to int. That would be a later patch on its 
own, including as well changes in the spec document and AtomicExpand.

- An atomic struct needs to be casted to integer in EmitAtomicLoadOp().

- In ConvertToValueOrAtomic() and convertRValueToInt(), scalars are treated 
specially. But still FP80 and float/CmpXchg scalars currrently need casting.

- FP80 also seems like a separate patch if there's a need. I guess maybe in 
that case it does make sense to cast it to i128 here, as there is only one 
target using it, and it's a special non-power-of-2 case..?

So it still looks to me that there are these two changes that would first need 
handling, and then this could probably be improved further.

https://github.com/llvm/llvm-project/pull/86691
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to