From 49b1602a401c7f8d309150b52f406b6f55e00b84 Mon Sep 17 00:00:00 2001
From: Chris Lattner
Date: Sat, 5 Nov 2005 22:32:06 +0000
Subject: [PATCH] enumerate non-standard argument encoding cases, such as
alignment info for allocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24205 91177308-0d34-0410-b5e6-96231b3b80d8
---
docs/BytecodeFormat.html | 44 +++++++++++++++++++++++++++++++---------
1 file changed, 34 insertions(+), 10 deletions(-)
diff --git a/docs/BytecodeFormat.html b/docs/BytecodeFormat.html
index 5c22530f958..6aa3ba5e106 100644
--- a/docs/BytecodeFormat.html
+++ b/docs/BytecodeFormat.html
@@ -1371,8 +1371,8 @@ of formats. See Instructions for details.
Instructions are written out one at a time as distinct units. Each
instruction
record contains at least an opcode and a type field,
-and may contain a list of operands (whose interpretation depends on the opcode).
-Based on the number of operands, the
+and may contain a list of operands (whose
+interpretation depends on the opcode). Based on the number of operands, the
instruction is encoded in a
dense format that tries to encoded each instruction into 32-bits if
possible.
@@ -1477,6 +1477,36 @@ opcode (Invoke, Call, Store) plus some set of modifiers, as follows:
+
+
+
+Based on the instruction opcode and type, the bytecode format implicitly (to
+save space) specifies the interpretation of the operand list. For most
+instructions, the type of each operand is implicit from the type of the
+instruction itself (e.g. the type of operands of a binary operator must match
+the type of the instruction). As such, the bytecode format generally only
+encodes the value number of the operand, not the type.
+
+
In some cases, however, this is not sufficient. This section enumerates
+those cases:
+
+
+- getelementptr: the slot numbers for sequential type indexes are shifted up
+two bits. This allows the low order bits will encode the type of index used,
+as follows: 0=uint, 1=int, 2=ulong, 3=long.
+- cast: the result type number is encoded as the second operand.
+- alloca/malloc: If the allocation has an explicit alignment, the log2 of the
+ alignment is encoded as the second operand.
+- call: If the tail marker and calling convention cannot be encoded into the opcode of the call, it is passed as an
+ additional operand. The low bit of the operand is a flag indicating whether
+ the call is a tail call. The rest of the bits contain the calling
+ convention number (shifted left by one bit).
+
+