[llvm] [GISel] Add G_CTLS Opcode and combines, lower to cls(w) (PR #175069)

Stefan Weigl-Bosker via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 15 08:20:35 PST 2026


================
@@ -501,6 +501,17 @@ undefined.
   %2:_(s33) = G_CTLZ_ZERO_UNDEF %1
   %2:_(s33) = G_CTTZ_ZERO_UNDEF %1
 
+G_CTLS
+^^^^^^
+
+Count leading redundant sign bits. If the value is positive then the result is
+the number of extra leading zeros. If the value is negative then the result is
+the number of extra leading ones.
+
+.. code-block:: none
+
+  %2:_(s33) = G_CTLS %1
----------------
sweiglbosker wrote:

No idea either, i just went with what was nearby. Will change to s32

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


More information about the llvm-commits mailing list