Skip to content

[SelectionDAG] Document that UADDO/USUBO_CARRRY follow getBooleanContents. NFC - #224764

Merged
topperc merged 1 commit into
llvm:mainfrom
topperc:pr/carry-doc
Sep 20, 2026
Merged

topperc merged 1 commit into
llvm:mainfrom
topperc:pr/carry-doc

Conversation

@topperc

@topperc topperc commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Use 'true' instead of '1'.

Follow up from post commit discussion in #223396.

…ents. NFC

Use 'true' instead of '1'.

Follow up from post commit discussion in llvm#223396.
@llvmorg-github-actions llvmorg-github-actions Bot added the llvm:SelectionDAG SelectionDAGISel as well label Sep 18, 2026
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-selectiondag

Author: Craig Topper (topperc)

Changes

Use 'true' instead of '1'.

Follow up from post commit discussion in #223396.


Full diff: https://github.com/llvm/llvm-project/pull/224764.diff

1 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/ISDOpcodes.h (+5-4)
diff --git a/llvm/include/llvm/CodeGen/ISDOpcodes.h b/llvm/include/llvm/CodeGen/ISDOpcodes.h
index 9c3757203299ed..bcf7173b19dfc8 100644
--- a/llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ b/llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -306,13 +306,14 @@ enum NodeType {
 
   /// Carry-using nodes for multiple precision addition and subtraction.
   /// These nodes take three operands: The first two are the normal lhs and
-  /// rhs to the add or sub, and the third is a boolean value that is 1 if and
-  /// only if there is an incoming carry/borrow. These nodes produce two
+  /// rhs to the add or sub, and the third is a boolean value that is true if
+  /// and only if there is an incoming carry/borrow. These nodes produce two
   /// results: the normal result of the add or sub, and a boolean value that is
-  /// 1 if and only if there is an outgoing carry/borrow.
+  /// true if and only if there is an outgoing carry/borrow. If the type of the
+  /// boolean is not i1 then the high bits conform to getBooleanContents.
   ///
   /// Care must be taken if these opcodes are lowered to hardware instructions
-  /// that use the inverse logic -- 0 if and only if there is an
+  /// that use the inverse logic -- false if and only if there is an
   /// incoming/outgoing carry/borrow.  In such cases, you must preserve the
   /// semantics of these opcodes by inverting the incoming carry/borrow, feeding
   /// it to the add/sub hardware instruction, and then inverting the outgoing

@RKSimon RKSimon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - cheers

@topperc
topperc merged commit ffe4693 into llvm:main Sep 20, 2026
13 checks passed
@topperc
topperc deleted the pr/carry-doc branch September 20, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:SelectionDAG SelectionDAGISel as well

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants