You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: document/metadata/code/binary.rst
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@ Binary Format
8
8
Code Metadata
9
9
-------------
10
10
11
+
A Code Metadata item is a piece of information logically attached to an instruction.
12
+
13
+
An item is associated with a format, which defines the item's payload.
14
+
11
15
All code metadata items of a format named *T* are grouped under a custom section
12
16
named *'metadata.code.T'*.
13
17
The following parametrized grammar rules define the generic structure of a code metadata
@@ -30,14 +34,19 @@ section of format *T*.
30
34
31
35
Where :math:`\X{off}` is the byte offset of the annotation starting from the beginning of the function body, and :math:`\X{data}` is a further payload, whose content depends on the format :math:`T`.
32
36
33
-
*code metadata function* entries must appear in order of increasing *function id*, and duplicate id values are not allowed. *code metadata item* entries must appear in order of increasing *instruction offset*, and duplicate offset values are not allowed.
37
+
|Bcodemetadatafunc| entries must appear in order of increasing :math:`x`, and duplicate id values are not allowed. |Bcodemetadata| entries must appear in order of increasing :math:`\X{off}`, and duplicate offset values are not allowed.
34
38
35
39
.. _binary-branchhints:
36
40
37
41
Branch Hints
38
42
~~~~~~~~~~~~
39
43
40
-
A Branch Hint is code metadata item with format *branch_hint*.
44
+
A Branch Hint is a code metadata item with format *branch_hint*.
45
+
46
+
It can only be attached to |BRIF| and |IF| instructions.
47
+
48
+
Its payload indicates whether the branch is likely or unlikely to be taken.
49
+
41
50
All branch hints for a module are contained in a single code metadata section
42
51
with name *'metadata.code.branch_hint'*.
43
52
@@ -55,3 +64,6 @@ with name *'metadata.code.branch_hint'*.
55
64
\end{array}
56
65
.. index:: ! branch hint section
57
66
67
+
A value of |Blikely| means that the branch is likely to be taken, while a
68
+
value of |Bunlikely| means the opposite. A branch with no hints is considered
0 commit comments