[llvm] Reland "[NVPTX] Add support for atomic add for f16 type" (PR #85197)
Adrian Kuegel via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 14 01:29:07 PDT 2024
================
@@ -1520,11 +1520,13 @@ multiclass F_ATOMIC_2_imp<ValueType ptrT, NVPTXRegClass ptrclass,
def imm : NVPTXInst<(outs regclass:$dst), (ins ptrclass:$addr, IMMType:$b),
!strconcat("atom", SpaceStr, OpcStr, TypeStr, " \t$dst, [$addr], $b;", ""),
[(set (regT regclass:$dst), (IntOp (ptrT ptrclass:$addr), IMM:$b))]>,
- Requires<Pred>;
+ Requires<!listconcat(Pred, [!if(!eq(TypeStr, ".f16"), Predicate<"false">, Predicate<"true">)])>;
}
multiclass F_ATOMIC_2<ValueType regT, NVPTXRegClass regclass, string SpaceStr, string TypeStr,
string OpcStr, PatFrag IntOp, Operand IMMType, SDNode IMM,
list<Predicate> Pred = []> {
+ defm p16 : F_ATOMIC_2_imp<i16, Int16Regs, regT, regclass, SpaceStr, TypeStr, OpcStr,
----------------
akuegel wrote:
When debugging, I thought that we may need this (pattern matching what exists), but not 100% sure as I don't understand what it does.
https://github.com/llvm/llvm-project/pull/85197
More information about the llvm-commits
mailing list