[llvm] 9ef2175 - [SelectionDAG] Add additional documentation to FP_TO_S/UINT_SAT to justify D116870. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 10 18:08:52 PST 2022


Author: Craig Topper
Date: 2022-01-10T18:08:39-08:00
New Revision: 9ef2175f812a9308cbcefc4729f6a6c9e75c2b6f

URL: https://github.com/llvm/llvm-project/commit/9ef2175f812a9308cbcefc4729f6a6c9e75c2b6f
DIFF: https://github.com/llvm/llvm-project/commit/9ef2175f812a9308cbcefc4729f6a6c9e75c2b6f.diff

LOG: [SelectionDAG] Add additional documentation to FP_TO_S/UINT_SAT to justify D116870. NFC

As noted in post-commit review, the value of the bits between
the saturating type and result type were not defined defined. Define
them to be sign extended for FP_TO_SINT_SAT and zero extended for
FP_TO_UINT_SAT.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/ISDOpcodes.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/ISDOpcodes.h b/llvm/include/llvm/CodeGen/ISDOpcodes.h
index fd106f55a43d1..b07c7cd3db3a3 100644
--- a/llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ b/llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -797,6 +797,10 @@ enum NodeType {
   /// The scalar width of the type given in operand 1 must be equal to, or
   /// smaller than, the scalar result type width. It may end up being smaller
   /// than the result width as a result of integer type legalization.
+  ///
+  /// After converting to the scalar integer type in operand 1, the value is
+  /// extended to the result VT. FP_TO_SINT_SAT sign extends and FP_TO_UINT_SAT
+  /// zero extends.
   FP_TO_SINT_SAT,
   FP_TO_UINT_SAT,
 


        


More information about the llvm-commits mailing list