Skip to content

Commit 927b809

Browse files
committed
[GlobalISel] Describe undefined values for G_SBFX/G_UBFX operands
Differential Revision: https://reviews.llvm.org/D104245
1 parent 833bdbe commit 927b809

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

llvm/docs/GlobalISel/GenericOpcode.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ The source operands are registers as follows:
252252
- The least-significant bit for the extraction
253253
- The width of the extraction
254254

255+
The least-significant bit (lsb) and width operands are in the range:
256+
257+
::
258+
259+
0 <= lsb < lsb + width <= source bitwidth, where all values are unsigned
260+
255261
G_SBFX sign-extends the result, while G_UBFX zero-extends the result.
256262

257263
.. code-block:: none

llvm/include/llvm/Target/GenericOpcodes.td

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,14 +1379,16 @@ def G_BZERO : GenericInstruction {
13791379
// Bitfield extraction.
13801380
//------------------------------------------------------------------------------
13811381

1382-
// Generic signed bitfield extraction.
1382+
// Generic signed bitfield extraction. The operands are in the range
1383+
// 0 <= lsb < lsb + width <= src bitwidth, where all values are unsigned.
13831384
def G_SBFX : GenericInstruction {
13841385
let OutOperandList = (outs type0:$dst);
13851386
let InOperandList = (ins type0:$src, type1:$lsb, type1:$width);
13861387
let hasSideEffects = false;
13871388
}
13881389

1389-
// Generic unsigned bitfield extraction.
1390+
// Generic unsigned bitfield extraction. The operands are in the range
1391+
// 0 <= lsb < lsb + width <= src bitwidth, where all values are unsigned.
13901392
def G_UBFX : GenericInstruction {
13911393
let OutOperandList = (outs type0:$dst);
13921394
let InOperandList = (ins type0:$src, type1:$lsb, type1:$width);

0 commit comments

Comments
 (0)