krzysz00 wrote: 1. This should live in arith/Transforms 2. Since we're here, I'll note that we could also implement truncation using the same lookup table and a binary search - and probably should. https://github.com/llvm/llvm-project/pull/196321