https://github.com/Naghasan commented: Sorry @frasercrmck I forgot about the PR... The structure looks good, but we should make use of the existing SPIR-V instructions, that probably implies adding new intrinsics though ... https://github.com/llvm/llvm-project/pull/148637