move FATAN2PI and FATAN to top-level funct5
[libreriscv.git] / rv_major_opcode_1010011.mdwn
1 # Summary FP Opcodes
2
3 This page aids and assists in the development of FP proposals,
4 by identifying and listing in full both publicly-known proposals
5 and the full brownfield encoding space available in the 0b010011
6 major opcode.
7
8 A primary critical use-case for extending FP is for 3D and supercomputing.
9
10 Publicly-known FP proposals:
11
12 * Zfrsqrt - Reciprocal SQRT <http://bugs.libre-riscv.org/show_bug.cgi?id=110>
13 * Zftrans - Transcendentals (FSIN, FCOS, FATAN, FPOW, FEXP, FLOG, FRCP)
14 <http://bugs.libre-riscv.org/show_bug.cgi?id=127>
15 * Extension of formats to cover FP16 (RISC-V ISA Manual Table 11.3 "fmt field")
16 * HI-half FP MV - <https://github.com/riscv/riscv-isa-manual/pull/301>
17 <https://groups.google.com/a/groups.riscv.org/forum/m/#!topic/isa-dev/kXgfFqgBv-c>
18 * (Add new entries here: Zextname - Description and URL)
19
20 [[!toc levels=2]]
21
22 # Main FP opcode 1010011 table
23
24 Notes:
25
26 * Proposed new encodings in **bold**.
27 * *Use funct5 sparingly!* - 2-operand functions only.
28 * Single-argument FP operations should go under one of the funct5 tables
29 * Both dual and single argument FP operations that do not require
30 "rounding mode" should go in one of the funct5 tables that already use
31 "funct3".
32 * The rs2 field can be best used to sub-select a considerable number
33 of 1-op operations, with "rounding" in funct3
34 * The funct3 field can be best used to sub-select a considerable number
35 of 2-op operations
36 * 1-op operations that do not need "rounding" have the best brownfield
37 availability: 8 bit sub-selection (rs2=5 + funct3=3). This however is
38 rare as most FP operations need "rounding" selection.
39 * Be careful not to use encoding space for which FP16 has already been
40 reserved (mostly FP conversion opcodes)
41
42 [[!table data="""
43 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
44 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
45 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
46 00000 | xx | rs2 | rs1 | rm | rd | 1010011 | FADD.xx |
47 00001 | xx | rs2 | rs1 | rm | rd | 1010011 | FSUB.xx |
48 00010 | xx | rs2 | rs1 | rm | rd | 1010011 | FMUL.xx |
49 00011 | xx | rs2 | rs1 | rm | rd | 1010011 | FDIV.xx |
50 00100 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
51 00101 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=00101 |
52 00110 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
53 00111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
54 01000 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=01000 |
55 01001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
56 01010 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
57 01011 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=01011 |
58 01100 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
59 01101 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2.xx** |
60 01110 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2PI.xx**|
61 01111 | xx | rs2 | rs1 | rm | rd | 1010011 | **FPOW.xx** |
62 10000 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
63 10001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
64 10010 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
65 10011 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
66 10100 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=10100 |
67 10101 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
68 10110 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
69 10111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
70 11000 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11000 |
71 11001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
72 11010 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11010 |
73 11100 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11100 |
74 11101 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
75 11110 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11110 |
76 11111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
77 """]]
78
79 Code:
80
81 * xx: Opcode format field "fmt" - Table 11.3
82 * xxxxx: 5-bit selection field (usually 1-op selection)
83 * yyy: funct3 selection field (usually 2-op selection)
84 * rm: "rounding mode"
85
86 ## funct5 = 00000 - FADD
87
88 No brownfield encodings available.
89
90 ## funct5 = 00001 - FSUB
91
92 No brownfield encodings available.
93
94 ## funct5 = 00010 - FMUL
95
96 No brownfield encodings available.
97
98 ## funct5 = 00011 - FDIV
99
100 No brownfield encodings available.
101
102 ## funct5 = 00100 - unused
103
104 Brownfield encodings available.
105
106 ## funct5 = 00100
107
108 This table uses funct3 for encoding 2-operand FP operations
109
110 [[!table data="""
111 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
112 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
113 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
114 00100 | xx | rs2 | rs1 | 000 | rd | 1010011 | FSGNJ.xx |
115 00100 | xx | rs2 | rs1 | 001 | rd | 1010011 | FSGNJN.xx |
116 00100 | xx | rs2 | rs1 | 010 | rd | 1010011 | FSGNJX.xx |
117 00100 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
118 00100 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
119 00100 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
120 00100 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
121 00100 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
122 """]]
123
124 ## funct5 = 00101
125
126 This table uses funct3 for encoding 2-operand FP operations where the result
127 register is a **floating-point** value.
128
129 [[!table data="""
130 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
131 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
132 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
133 00101 | xx | rs2 | rs1 | 000 | rd | 1010011 | FMIN.S |
134 00101 | xx | rs2 | rs1 | 001 | rd | 1010011 | FMAX.S |
135 00101 | xx | rs2 | rs1 | 010 | rd | 1010011 | ?f3=010 |
136 00101 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
137 00101 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
138 00101 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
139 00101 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
140 00101 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
141 """]]
142
143 ## funct5 = 00110 - unused
144
145 Brownfield encodings available.
146
147 ## funct5 = 00111 - unused
148
149 Brownfield encodings available.
150
151 ## funct5 = 01000
152
153 This table uses rs2 for encoding 1-operand FP operations, using
154 funct3 to specify the "rounding" mode
155
156 Notes:
157
158 * FP16 logically deduced from fmt field encoding (bits 25-26)
159
160 [[!table data="""
161 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
162 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
163 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
164 01000 | 00 | 00000 | rs1 | rm | rd | 1010011 | ???????? |
165 01000 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.S.D |
166 01000 | 00 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.S.H**|
167 01000 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.S.Q |
168 01000 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
169 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
170 01000 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.D.S |
171 01000 | 01 | 00001 | rs1 | rm | rd | 1010011 | ???????? |
172 01000 | 01 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.D.H**|
173 01000 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.D.Q |
174 01000 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
175 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
176 01000 | 10 | 00000 | rs1 | rm | rd | 1010011 | FCVT.H.S |
177 01000 | 10 | 00001 | rs1 | rm | rd | 1010011 | **FCVT.H.D**|
178 01000 | 10 | 00010 | rs1 | rm | rd | 1010011 | ???????? |
179 01000 | 10 | 00011 | rs1 | rm | rd | 1010011 | FCVT.H.Q |
180 01000 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
181 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
182 01000 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.Q.S |
183 01000 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.Q.D |
184 01000 | 11 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.Q.H**|
185 01000 | 11 | 00011 | rs1 | rm | rd | 1010011 | ???????? |
186 01000 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
187 """]]
188
189 ## funct5 = 01001 - unused
190
191 Brownfield encodings available.
192
193 ## funct5 = 01010 - unused
194
195 Brownfield encodings available.
196
197 ## funct5 = 01011 - 1-op Transcendentals <a name="transcendentals_1op"></a>
198
199 This table uses rs2 for encoding 1-operand FP operations, using
200 funct3 to specify the "rounding" mode
201
202 [[!table data="""
203 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
204 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
205 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
206 01011 | xx | 00000 | rs1 | rm | rd | 1010011 | FSQRT.xx |
207 01011 | xx | 00001 | rs1 | rm | rd | 1010011 | **FRSQRT.xx** |
208 01011 | xx | 00010 | rs1 | rm | rd | 1010011 | **FRCP.xx** |
209 01011 | xx | 00011 | rs1 | rm | rd | 1010011 | **FCBRT.xx** |
210 01011 | xx | 00100 | rs1 | rm | rd | 1010011 | ? |
211 01011 | xx | 00101 | rs1 | rm | rd | 1010011 | ? |
212 01011 | xx | 00110 | rs1 | rm | rd | 1010011 | ? |
213 01011 | xx | 00111 | rs1 | rm | rd | 1010011 | ? |
214 01011 | xx | 01000 | rs1 | rm | rd | 1010011 | **FEXP2.xx** |
215 01011 | xx | 01001 | rs1 | rm | rd | 1010011 | **FLOG2.xx** |
216 01011 | xx | 01010 | rs1 | rm | rd | 1010011 | **FEXPM1.xx** |
217 01011 | xx | 01011 | rs1 | rm | rd | 1010011 | **FLOGP1.xx** |
218 01011 | xx | 01100 | rs1 | rm | rd | 1010011 | **FEXP.xx** |
219 01011 | xx | 01101 | rs1 | rm | rd | 1010011 | **FLOG.xx** |
220 01011 | xx | 01110 | rs1 | rm | rd | 1010011 | **FEXP10.xx** |
221 01011 | xx | 01111 | rs1 | rm | rd | 1010011 | **FLOG10.xx** |
222 01011 | xx | 10000 | rs1 | rm | rd | 1010011 | **FSIN.xx** |
223 01011 | xx | 10001 | rs1 | rm | rd | 1010011 | **FCOS.xx** |
224 01011 | xx | 10010 | rs1 | rm | rd | 1010011 | **FTAN.xx** |
225 01011 | xx | 10011 | rs1 | rm | rd | 1010011 | ? |
226 01011 | xx | 10100 | rs1 | rm | rd | 1010011 | **FSINPI.xx** |
227 01011 | xx | 10101 | rs1 | rm | rd | 1010011 | **FCOSPI.xx** |
228 01011 | xx | 10110 | rs1 | rm | rd | 1010011 | **FTANPI.xx** |
229 01011 | xx | 10111 | rs1 | rm | rd | 1010011 | ? |
230 01011 | xx | 11000 | rs1 | rm | rd | 1010011 | **FSINH.xx** |
231 01011 | xx | 11001 | rs1 | rm | rd | 1010011 | **FCOSH.xx** |
232 01011 | xx | 11010 | rs1 | rm | rd | 1010011 | **FTANH.xx** |
233 01011 | xx | 11011 | rs1 | rm | rd | 1010011 | ? |
234 01011 | xx | 11100 | rs1 | rm | rd | 1010011 | **FASINH.xx** |
235 01011 | xx | 11101 | rs1 | rm | rd | 1010011 | **FACOSH.xx** |
236 01011 | xx | 11110 | rs1 | rm | rd | 1010011 | **FATANH.xx** |
237 01011 | xx | 11111 | rs1 | rm | rd | 1010011 | ? |
238 """]]
239
240 ## funct5 = 01100 - unused
241
242 Brownfield encodings available.
243
244 ## funct5 = 01101 - **FATAN2**
245
246 Proposed for Zftrans - FATAN: "atan(rs1, rs2)"
247
248 ## funct5 = 01110 - **FATAN2PI**
249
250 Proposed for ZftransExt - FATAN2PI: "atan2(rs1, rs2) * PI".
251 Rationale: Gives better accuracy than if using FMUL with the constant, PI.
252
253 ## funct5 = 01111 - **FPOW**
254
255 Proposed for Zftrans - FPOW: "FP rs2 to the power of rs1"
256
257 ## funct5 = 10000 - unused
258
259 Brownfield encodings available.
260
261 ## funct5 = 10001 - unused
262
263 Brownfield encodings available.
264
265 ## funct5 = 10010 - unused
266
267 Brownfield encodings available.
268
269 ## funct5 = 10011 - unused
270
271 Brownfield encodings available.
272
273 ## funct5 = 10100
274
275 This table uses funct3 for encoding 2-operand FP "comparison" operations
276 where the result register is an **integer**
277
278 Notes:
279
280 * FNE missing?
281
282 [[!table data="""
283 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
284 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
285 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
286 10100 | xx | rs2 | rs1 | 000 | rd | 1010011 | FLE.xx |
287 10100 | xx | rs2 | rs1 | 001 | rd | 1010011 | FLT.xx |
288 10100 | xx | rs2 | rs1 | 010 | rd | 1010011 | FEQ.xx |
289 10100 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
290 10100 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
291 10100 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
292 10100 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
293 10100 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
294 """]]
295
296 ## funct5 = 10101 - unused
297
298 Brownfield encodings available.
299
300 ## funct5 = 10110 - unused
301
302 Brownfield encodings available.
303
304 ## funct5 = 10111 - unused
305
306 Brownfield encodings available.
307
308 ## funct5 = 11000
309
310 This table uses rs2 for encoding 1-operand FP operations, using
311 funct3 to specify the "rounding" mode
312
313 Notes:
314
315 * FP16 logically deduced from fmt field (bits 25-26)
316
317 [[!table data="""
318 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
319 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
320 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
321 11000 | 00 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.S |
322 11000 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.S |
323 11000 | 00 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.S |
324 11000 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.S |
325 11000 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
326 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
327 11000 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.D |
328 11000 | 01 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.D |
329 11000 | 01 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.D |
330 11000 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.D |
331 11000 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
332 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
333 11000 | 10 | 00000 | rs1 | rm | rd | 1010011 |**FCVT.W.H** |
334 11000 | 10 | 00001 | rs1 | rm | rd | 1010011 |**FCVT.WU.H**|
335 11000 | 10 | 00010 | rs1 | rm | rd | 1010011 |**FCVT.L.H** |
336 11000 | 10 | 00011 | rs1 | rm | rd | 1010011 |**FCVT.LU.H**|
337 11000 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
338 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
339 11000 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.Q |
340 11000 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.Q |
341 11000 | 11 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.Q |
342 11000 | 11 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.Q |
343 11000 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
344 """]]
345
346 ## funct5 = 11001 - unused
347
348 Brownfield encodings available.
349
350 ## funct5 = 11010
351
352 This table uses rs2 for encoding 1-operand FP operations, using
353 funct3 to specify the "rounding" mode
354
355 * FP16 logically deduced from fmt field (bits 25-26)
356
357 [[!table data="""
358 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
359 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
360 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
361 11010 | 00 | 00000 | rs1 | rm | rd | 1010011 | FCVT.S.W |
362 11010 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.S.WU |
363 11010 | 00 | 00010 | rs1 | rm | rd | 1010011 | FCVT.S.L |
364 11010 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.S.LU |
365 11010 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
366 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
367 11010 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.D.W |
368 11010 | 01 | 00001 | rs1 | rm | rd | 1010011 | FCVT.D.WU |
369 11010 | 01 | 00010 | rs1 | rm | rd | 1010011 | FCVT.D.L |
370 11010 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.D.LU |
371 11010 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
372 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
373 11010 | 10 | 00000 | rs1 | rm | rd | 1010011 |**FCVT.H.W** |
374 11010 | 10 | 00001 | rs1 | rm | rd | 1010011 |**FCVT.H.WU**|
375 11010 | 10 | 00010 | rs1 | rm | rd | 1010011 |**FCVT.H.L** |
376 11010 | 10 | 00011 | rs1 | rm | rd | 1010011 |**FCVT.H.LU**|
377 11010 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
378 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
379 11010 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.Q.W |
380 11010 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.Q.WU |
381 11010 | 11 | 00010 | rs1 | rm | rd | 1010011 | FCVT.Q.L |
382 11010 | 11 | 00011 | rs1 | rm | rd | 1010011 | FCVT.Q.LU |
383 11010 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
384 """]]
385
386 ## funct5 = 11100
387
388 This table uses *both* rs2 *and* funct3 for encoding 1-operand FP operations.
389
390 Notes:
391
392 * FMV.X.Q is missing (alias of FMVH.X.D if it existed)
393 * FP16 logically deduced from fmt field (bits 25-26)
394 * FMVH.X.HW (half-word) missing?
395
396 [[!table data="""
397 31..27| 26..25| 24..20 |19..15|14...12| 11..7 | 6....0 | function |
398 funct5| SDHQ | rs2 | rs1 |funct3 | rd | opcode | name |
399 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
400 11100 | 00 | 00000 | rs1 | 000 | rd | 1010011 | FMV.X.W |
401 11100 | 00 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.S |
402 11100 | 00 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
403 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
404 11100 | 01 | 00000 | rs1 | 000 | rd | 1010011 | FMV.X.D **FMVH.X.W** |
405 11100 | 01 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.D |
406 11100 | 01 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
407 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
408 11100 | 10 | 00000 | rs1 | 000 | rd | 1010011 |**FMV.X.H** |
409 11100 | 10 | 00000 | rs1 | 001 | rd | 1010011 |**FCLASS.H** |
410 11100 | 10 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
411 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
412 11100 | 11 | 00000 | rs1 | 000 | rd | 1010011 | **FMVH.X.D** |
413 11100 | 11 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.Q |
414 11100 | xx | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
415 """]]
416
417 ## funct5 = 11101 - unused
418
419 Brownfield encodings available.
420
421 ## funct5 = 11110
422
423 This table uses *both* rs2 *and* funct3 for encoding 1-operand FP operations.
424
425 Notes:
426
427 * FMV.Q.X is missing (as is FMVH.D.X)
428 * FMVH.W.X is missing (alias of FMV.D.X)
429 * FP16 logically deduced from fmt field (bits 25-26)
430 * FMVH.HW.X (half-word) missing?
431
432 [[!table data="""
433 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
434 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
435 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
436 11110 | 00 | 00000 | rs1 | 000 | rd | 1010011 | FMV.W.X |
437 11110 | 00 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
438 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
439 11110 | 01 | 00000 | rs1 | 000 | rd | 1010011 | FMV.D.X |
440 11110 | 01 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
441 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
442 11110 | 10 | 00000 | rs1 | 000 | rd | 1010011 |**FMV.H.X** |
443 11110 | 10 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
444 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
445 11110 | 11 | 00000 | rs1 | 000 | rd | 1010011 | ? |
446 11110 | 11 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
447 """]]
448
449 ## funct5 = 11111 - unused
450
451 Brownfield encodings available.
452
453 ## funct5 = ????? (table template)
454
455 This table acts as a cut/paste template for creating brownfield encodings
456
457 [[!table data="""
458 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
459 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
460 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
461 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
462 """]]
463