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