[llvm] 927b809 - [GlobalISel] Describe undefined values for G_SBFX/G_UBFX operands

Brendon Cahoon via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 24 06:44:30 PDT 2021


Author: Brendon Cahoon
Date: 2021-06-24T09:31:41-04:00
New Revision: 927b80978345457480ce68eb84d87a5f80d34bc7

URL: https://github.com/llvm/llvm-project/commit/927b80978345457480ce68eb84d87a5f80d34bc7
DIFF: https://github.com/llvm/llvm-project/commit/927b80978345457480ce68eb84d87a5f80d34bc7.diff

LOG: [GlobalISel] Describe undefined values for G_SBFX/G_UBFX operands

Differential Revision: https://reviews.llvm.org/D104245

Added: 
    

Modified: 
    llvm/docs/GlobalISel/GenericOpcode.rst
    llvm/include/llvm/Target/GenericOpcodes.td

Removed: 
    


################################################################################
diff  --git a/llvm/docs/GlobalISel/GenericOpcode.rst b/llvm/docs/GlobalISel/GenericOpcode.rst
index 6f0d7b5b4a6e9..5fd79d0c672f2 100644
--- a/llvm/docs/GlobalISel/GenericOpcode.rst
+++ b/llvm/docs/GlobalISel/GenericOpcode.rst
@@ -252,6 +252,12 @@ The source operands are registers as follows:
 - The least-significant bit for the extraction
 - The width of the extraction
 
+The least-significant bit (lsb) and width operands are in the range:
+
+::
+
+      0 <= lsb < lsb + width <= source bitwidth, where all values are unsigned
+
 G_SBFX sign-extends the result, while G_UBFX zero-extends the result.
 
 .. code-block:: none

diff  --git a/llvm/include/llvm/Target/GenericOpcodes.td b/llvm/include/llvm/Target/GenericOpcodes.td
index 600afa1017a48..113799611e738 100644
--- a/llvm/include/llvm/Target/GenericOpcodes.td
+++ b/llvm/include/llvm/Target/GenericOpcodes.td
@@ -1379,14 +1379,16 @@ def G_BZERO : GenericInstruction {
 // Bitfield extraction.
 //------------------------------------------------------------------------------
 
-// Generic signed bitfield extraction.
+// Generic signed bitfield extraction. The operands are in the range
+// 0 <= lsb < lsb + width <= src bitwidth, where all values are unsigned.
 def G_SBFX : GenericInstruction {
   let OutOperandList = (outs type0:$dst);
   let InOperandList = (ins type0:$src, type1:$lsb, type1:$width);
   let hasSideEffects = false;
 }
 
-// Generic unsigned bitfield extraction.
+// Generic unsigned bitfield extraction. The operands are in the range
+// 0 <= lsb < lsb + width <= src bitwidth, where all values are unsigned.
 def G_UBFX : GenericInstruction {
   let OutOperandList = (outs type0:$dst);
   let InOperandList = (ins type0:$src, type1:$lsb, type1:$width);


        


More information about the llvm-commits mailing list