LLVM-SPIRV-Backend icon indicating copy to clipboard operation
LLVM-SPIRV-Backend copied to clipboard

Support llvm arithmetic/bit intrinsics

Open iliya-diyachkov opened this issue 3 years ago • 1 comments

We have 4 tests with unsupported llvm arithmetic/bit intrinsics. Most of them can be implemented substituting OpExtInst * or other single operations:

llvm-intrinsics/abs.ll (llvm.abs.* -> OpExtInst s_abs)
llvm-intrinsics/fp-intrinsics.ll  (llvm.*-> OpExtInst *)
llvm-intrinsics/fmuladd.ll  (llvm.fmuladd -> OpExtInst mad)
llvm-intrinsics/ctpop.ll (llvm.ctpop -> OpBitCount)

iliya-diyachkov avatar Dec 10 '21 20:12 iliya-diyachkov

Most of the intrinsics were added in #84, however fmuladd.ll is not fixed since we cannot differ llvm.fmuladd and llvm.fma in SPIRVInstructionSelector.cpp where we have G_FMA. Need to specialize it earlier or leave llvm.fmuladd intrinsic call till ISel.

iliya-diyachkov avatar Dec 16 '21 23:12 iliya-diyachkov