LLVM-SPIRV-Backend
LLVM-SPIRV-Backend copied to clipboard
Support llvm arithmetic/bit intrinsics
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)
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.