5
5
6
6
*<%= inst.long_name %> *
7
7
8
- This instruction is defined by:
9
-
10
- <%= inst.fix_entities(inst.defined_by_condition.to_asciidoc) %>
11
-
12
- This instruction is included in the following profiles:
13
-
14
- <%- cfg_arch.profiles.each do |profile| -%>
15
- <%-
16
- in_profile_mandatory = profile.mandatory_ext_reqs.any? do |ext_req|
17
- ext_versions = ext_req.satisfying_versions
18
- ext_versions.any? { |ext_ver| inst.defined_by_condition.possibly_satisfied_by?(ext_ver) }
19
- end
20
- in_profile_optional = !in_profile_mandatory && profile.optional_ext_reqs.any? do |ext_req|
21
- ext_versions = ext_req.satisfying_versions
22
- ext_versions.any? { |ext_ver| inst.defined_by_condition.possibly_satisfied_by?(ext_ver) }
23
- end
24
- if in_profile_mandatory
25
- -%>
26
- * <%= profile.marketing_name %> (Mandatory)
27
- <%- elsif in_profile_optional -%>
28
- * <%= profile.marketing_name %> (Optional)
29
- <%- end -%>
30
- <%- end -%>
31
-
32
- == Encoding
33
-
34
- <%- if inst.multi_encoding? -%>
35
- [NOTE]
36
- This instruction has different encodings in RV32 and RV64.
37
-
38
- [tabs]
39
- ====
40
- RV32::
41
- +
42
- [wavedrom, ,svg,subs='attributes',width="100%"]
43
- ....
44
- <%= inst.processed_wavedrom_desc(32) %>
45
- ....
46
-
47
- RV64::
48
- +
49
- [wavedrom, ,svg,subs='attributes',width="100%"]
50
- ....
51
- <%= inst.processed_wavedrom_desc(64) %>
52
- ....
53
- ====
54
- <%- else -%>
55
- [wavedrom, ,svg,subs='attributes',width="100%"]
56
- ....
57
- <%= inst.processed_wavedrom_desc(inst.base.nil? ? 32 : inst.base) %>
58
- ....
59
- <%- end -%>
60
-
61
8
== Assembly format
62
9
63
10
`<%= inst.name %> <%= inst.assembly.gsub('x', 'r') %> `
@@ -71,22 +18,6 @@ This instruction must have data-independent timing when extension `Zkt` is enabl
71
18
72
19
<%= inst.fix_entities(inst.description) %>
73
20
74
- == Access
75
- [cols="^,^,^,^,^"]
76
- |===
77
- | M | HS | U | VS | VU
78
-
79
- | [.access-always]#Always#
80
- | [.access-<%= inst.access['s']%> ]#<%= inst.access['s'].capitalize %> #
81
- | [.access-<%= inst.access['u']%> ]#<%= inst.access['u'].capitalize %> #
82
- | [.access-<%= inst.access['vs']%> ]#<%= inst.access['vs'].capitalize %> #
83
- | [.access-<%= inst.access['vu']%> ]#<%= inst.access['vu'].capitalize %> #
84
- |===
85
-
86
- <%- if inst.access_detail? -%>
87
- <%= inst.fix_entities(inst.access_detail) %>
88
- <%- end -%>
89
-
90
21
== Decode Variables
91
22
92
23
<%- if inst.multi_encoding? -%>
@@ -153,3 +84,76 @@ This instruction may result in the following synchronous exceptions:
153
84
<%- end -%>
154
85
155
86
<%- end -%>
87
+
88
+ == Encoding
89
+
90
+ <%- if inst . multi_encoding? -%>
91
+ [NOTE]
92
+ This instruction has different encodings in RV32 and RV64.
93
+
94
+ ====
95
+ RV32::
96
+ +
97
+ [wavedrom, ,svg,subs='attributes',width="100%"]
98
+ ....
99
+ <%= inst . processed_wavedrom_desc ( 32 ) %>
100
+ ....
101
+
102
+ RV64::
103
+ +
104
+ [wavedrom, ,svg,subs='attributes',width="100%"]
105
+ ....
106
+ <%= inst . processed_wavedrom_desc ( 64 ) %>
107
+ ....
108
+ ====
109
+ <%- else -%>
110
+ [wavedrom, ,svg,subs='attributes',width="100%"]
111
+ ....
112
+ <%= inst . processed_wavedrom_desc ( inst . base . nil? ? 32 : inst . base ) %>
113
+ ....
114
+ <%- end -%>
115
+
116
+ == Defining extension
117
+
118
+ <%= inst . fix_entities ( inst . defined_by_condition . to_asciidoc ) %>
119
+
120
+ == Access
121
+ [cols="^,^,^,^,^"]
122
+ |===
123
+ | M | HS | U | VS | VU
124
+
125
+ | [.access-always]#Always#
126
+ | [.access-<%= inst . access [ 's' ] %> ]#<%= inst . access [ 's' ] . capitalize %> #
127
+ | [.access-<%= inst . access [ 'u' ] %> ]#<%= inst . access [ 'u' ] . capitalize %> #
128
+ | [.access-<%= inst . access [ 'vs' ] %> ]#<%= inst . access [ 'vs' ] . capitalize %> #
129
+ | [.access-<%= inst . access [ 'vu' ] %> ]#<%= inst . access [ 'vu' ] . capitalize %> #
130
+ |===
131
+
132
+ <%- if inst . access_detail? -%>
133
+ <%= inst . fix_entities ( inst . access_detail ) %>
134
+ <%- end -%>
135
+
136
+ == Containing profiles
137
+
138
+ <%- inst_mandatory_ext = [ ] -%>
139
+ <%- inst_optional_ext = [ ] -%>
140
+ <%- cfg_arch . profiles . each do |profile | -%>
141
+ <%-
142
+ in_profile_mandatory = profile . mandatory_ext_reqs . any? do |ext_req |
143
+ ext_versions = ext_req . satisfying_versions
144
+ ext_versions . any? { |ext_ver | inst . defined_by_condition . possibly_satisfied_by? ( ext_ver ) }
145
+ end
146
+ in_profile_optional = !in_profile_mandatory && profile . optional_ext_reqs . any? do |ext_req |
147
+ ext_versions = ext_req . satisfying_versions
148
+ ext_versions . any? { |ext_ver | inst . defined_by_condition . possibly_satisfied_by? ( ext_ver ) }
149
+ end
150
+ if in_profile_mandatory
151
+ -%>
152
+ <%- inst_mandatory_ext . push ( profile . marketing_name ) -%>
153
+ <%- elsif in_profile_optional -%>
154
+ <%- inst_optional_ext . push ( profile . marketing_name ) -%>
155
+ <%- end -%>
156
+ <%- end -%>
157
+
158
+ * Mandatory: <%= inst_mandatory_ext . join ( ", " ) %>
159
+ * Optional: <%= inst_optional_ext . join ( ", " ) %>
0 commit comments