[llvm] [DXIL] Add lowering for `reversebits` and `trunc` (PR #86909)

S. Bharadwaj Yadavalli via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 07:30:53 PDT 2024


================
@@ -285,13 +285,19 @@ def RSqrt : DXILOpMapping<25, unary, int_dx_rsqrt,
                          "Returns the reciprocal of the square root of the specified value."
                          "rsqrt(x) = 1 / sqrt(x).",
                          [llvm_halforfloat_ty, LLVMMatchType<0>]>;
+def Rbits : DXILOpMapping<30, unary, int_bitreverse,
+                         "Returns the specified value with its bits reversed.",
+                         [llvm_anyint_ty, LLVMMatchType<0>]>;
----------------
bharadwajy wrote:

> @bharadwajy i'm pretty sure llvm_anyint_ty also covers int vectors. don't we need to limit to int scalars?

Yes. At present, such a narrower scalar type is not yet defined in `DXIL.td`. Additional refinement will follow once a way to represent the narrower overload type is added.

https://github.com/llvm/llvm-project/pull/86909


More information about the llvm-commits mailing list