[llvm] Add 3 way compare <=> integer intrinsics to Langref (PR #83227)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 11:37:20 PDT 2024


Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,
Miguel Raz =?utf-8?q?Guzmán?= Macedo,miguelraz
 <miguelraz at ciencias.unam.mx>,miguelraz <miguelraz at ciencias.unam.mx>,miguelraz
 <miguelraz at ciencias.unam.mx>,miguelraz <miguelraz at ciencias.unam.mx>,miguelraz
 <miguelraz at ciencias.unam.mx>,miguelraz <miguelraz at ciencias.unam.mx>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/83227 at github.com>


================
@@ -14531,6 +14531,63 @@ The arguments (``%a`` and ``%b``) may be of any integer type or a vector with
 integer element type. The argument types must match each other, and the return
 type must match the argument type.
 
+.. _int_scmp:
+
+'``llvm.scmp.*``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+This is an overloaded intrinsic. You can use ``@llvm.scmp`` on any
+integer bit width or any vector of integer elements.
+
+::
+
+      declare i2 @llvm.scmp.i2.i32(i32 %a, i32 %b)
+      declare <4 x i32> @llvm.scmp.i32.v4i32(<4 x i32> %a, <4 x i32> %b)
----------------
scottmcm wrote:

Down below in the test (https://github.com/llvm/llvm-project/pull/83227/files#diff-3ef2e557d2222d33ab41ef1ad1be804957d34a7329f7a89c8c12b9295a8d227dR7) I see that the vector return type is also listed in the intrinsic name.

Does that mean that this should be
```suggestion
      declare <4 x i32> @llvm.scmp.v4i32.v4i32(<4 x i32> %a, <4 x i32> %b)
```

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


More information about the llvm-commits mailing list