Skip to content

Commit 2ceb7ca

Browse files
davemgreenLukacma
authored andcommitted
[GlobalISel] Update the documentation of abd. (llvm#164594)
The abd nodes do not perform the same as abs(x-y), although they are often mistaken to do so. They extend into a larger bit size before performing the sub / abs and so produce different results. Update the description of the instruction to avoid misunderstandings.
1 parent 295ee5c commit 2ceb7ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/docs/GlobalISel/GenericOpcode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ undefined.
504504
G_ABDS, G_ABDU
505505
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
506506

507-
Compute the absolute difference (signed and unsigned), e.g. abs(x-y).
507+
Compute the absolute difference (signed and unsigned), e.g. trunc(abs(ext(x)-ext(y)).
508508

509509
.. code-block:: none
510510

0 commit comments

Comments
 (0)