[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 09:05:43 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:

> Does it make sense to do the narrower scalar type in this pr? Alternatively, should we leave this as is, as a placeholder for the future refinement?

Merging this PR in its current form and following up with a refinement in a later PR would be beneficial. That would follow the path of continued addition of DXIL Ops and tests for lowering, even if overload specification includes vector types to inform my ongoing design space exploration of a better specification mechanism, without being blocked on either front. 

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


More information about the llvm-commits mailing list