[clang] [llvm] [HLSL][DXIL][SPIRV] Create llvm dot intrinsic and use for HLSL (PR #102872)
Thorsten Schütt via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 13 08:49:41 PDT 2024
================
@@ -1088,6 +1088,27 @@ def G_FNEARBYINT : GenericInstruction {
let hasSideEffects = false;
}
+/// Floating point vector dot product
+def G_FDOTPROD : GenericInstruction {
+ let OutOperandList = (outs type0:$dst);
+ let InOperandList = (ins type0:$src1, type0:$src2);
+ let hasSideEffects = false;
----------------
tschuett wrote:
dot products take two vectors and return a scalar.
```
f G_FDOTPROD : GenericInstruction {
let OutOperandList = (outs type0:$dst);
let InOperandList = (ins type1:$src1, type1:$src2);
let hasSideEffects = false;
```
You have to change the sources to type1 and adapt your legalizer accordingly.
https://github.com/llvm/llvm-project/pull/102872
More information about the cfe-commits
mailing list