add hypotenuse opcode
[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 | **FHYPOT.xx** |
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 - FSGN
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 - FMIN/MAX
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 - FCVT
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 | ? |
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 | **FSINPI.xx** |
225 01011 | xx | 10010 | rs1 | rm | rd | 1010011 | **FASIN.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 | **FCOSPI.xx** |
229 01011 | xx | 10110 | rs1 | rm | rd | 1010011 | **FACOS.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 | **FTANPI.xx** |
233 01011 | xx | 11010 | rs1 | rm | rd | 1010011 | ? |
234 01011 | xx | 11011 | rs1 | rm | rd | 1010011 | ? |
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 ## funct5 = 01100 - **FHYPOT**
242
243 Proposed for Zftrans - FHYPOT: "sqrt(rs1 * rs1 + rs2 * rs2)"
244
245 ## funct5 = 01101 - **FATAN2**
246
247 Proposed for Zftrans - FATAN: "atan(rs1, rs2)"
248
249 ## funct5 = 01110 - **FATAN2PI**
250
251 Proposed for ZftransExt - FATAN2PI: "atan2(rs1, rs2) * PI".
252 Rationale: Gives better accuracy than if using FMUL with the constant, PI.
253
254 ## funct5 = 01111 - **FPOW**
255
256 Proposed for ZftransAdv - FPOW: "FP rs1 to the power of rs2"
257
258 ## funct5 = 10000 - **FROOT**
259
260 Proposed for ZftransAdv - FPROOT: "FP rs1 to the power of (1/rs2)"
261
262 ## funct5 = 10000 - unused
263
264 Brownfield encodings available.
265
266 ## funct5 = 10001 - unused
267
268 Brownfield encodings available.
269
270 ## funct5 = 10010 - unused
271
272 Brownfield encodings available.
273
274 ## funct5 = 10011 - unused
275
276 Brownfield encodings available.
277
278 ## funct5 = 10100 - FP comparisons
279
280 This table uses funct3 for encoding 2-operand FP "comparison" operations
281 where the result register is an **integer**
282
283 Notes:
284
285 * FNE missing?
286
287 [[!table data="""
288 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
289 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
290 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
291 10100 | xx | rs2 | rs1 | 000 | rd | 1010011 | FLE.xx |
292 10100 | xx | rs2 | rs1 | 001 | rd | 1010011 | FLT.xx |
293 10100 | xx | rs2 | rs1 | 010 | rd | 1010011 | FEQ.xx |
294 10100 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
295 10100 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
296 10100 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
297 10100 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
298 10100 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
299 """]]
300
301 ## funct5 = 10101 - unused
302
303 Brownfield encodings available.
304
305 ## funct5 = 10110 - unused
306
307 Brownfield encodings available.
308
309 ## funct5 = 10111 - unused
310
311 Brownfield encodings available.
312
313 ## funct5 = 11000 - FCVT
314
315 This table uses rs2 for encoding 1-operand FP operations, using
316 funct3 to specify the "rounding" mode
317
318 Notes:
319
320 * FP16 logically deduced from fmt field (bits 25-26)
321
322 [[!table data="""
323 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
324 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
325 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
326 11000 | 00 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.S |
327 11000 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.S |
328 11000 | 00 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.S |
329 11000 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.S |
330 11000 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
331 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
332 11000 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.D |
333 11000 | 01 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.D |
334 11000 | 01 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.D |
335 11000 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.D |
336 11000 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
337 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
338 11000 | 10 | 00000 | rs1 | rm | rd | 1010011 |**FCVT.W.H** |
339 11000 | 10 | 00001 | rs1 | rm | rd | 1010011 |**FCVT.WU.H**|
340 11000 | 10 | 00010 | rs1 | rm | rd | 1010011 |**FCVT.L.H** |
341 11000 | 10 | 00011 | rs1 | rm | rd | 1010011 |**FCVT.LU.H**|
342 11000 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
343 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
344 11000 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.W.Q |
345 11000 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.WU.Q |
346 11000 | 11 | 00010 | rs1 | rm | rd | 1010011 | FCVT.L.Q |
347 11000 | 11 | 00011 | rs1 | rm | rd | 1010011 | FCVT.LU.Q |
348 11000 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
349 """]]
350
351 ## funct5 = 11001 - unused
352
353 Brownfield encodings available.
354
355 ## funct5 = 11010 - FCVT
356
357 This table uses rs2 for encoding 1-operand FP operations, using
358 funct3 to specify the "rounding" mode
359
360 * FP16 logically deduced from fmt field (bits 25-26)
361
362 [[!table data="""
363 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
364 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
365 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
366 11010 | 00 | 00000 | rs1 | rm | rd | 1010011 | FCVT.S.W |
367 11010 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.S.WU |
368 11010 | 00 | 00010 | rs1 | rm | rd | 1010011 | FCVT.S.L |
369 11010 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.S.LU |
370 11010 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
371 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
372 11010 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.D.W |
373 11010 | 01 | 00001 | rs1 | rm | rd | 1010011 | FCVT.D.WU |
374 11010 | 01 | 00010 | rs1 | rm | rd | 1010011 | FCVT.D.L |
375 11010 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.D.LU |
376 11010 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
377 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
378 11010 | 10 | 00000 | rs1 | rm | rd | 1010011 |**FCVT.H.W** |
379 11010 | 10 | 00001 | rs1 | rm | rd | 1010011 |**FCVT.H.WU**|
380 11010 | 10 | 00010 | rs1 | rm | rd | 1010011 |**FCVT.H.L** |
381 11010 | 10 | 00011 | rs1 | rm | rd | 1010011 |**FCVT.H.LU**|
382 11010 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
383 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
384 11010 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.Q.W |
385 11010 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.Q.WU |
386 11010 | 11 | 00010 | rs1 | rm | rd | 1010011 | FCVT.Q.L |
387 11010 | 11 | 00011 | rs1 | rm | rd | 1010011 | FCVT.Q.LU |
388 11010 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
389 """]]
390
391 ## funct5 = 11100 - FMV, FCLASS
392
393 This table uses *both* rs2 *and* funct3 for encoding 1-operand FP operations.
394
395 Notes:
396
397 * FMV.X.Q is missing (alias of FMVH.X.D if it existed)
398 * FP16 logically deduced from fmt field (bits 25-26)
399 * FMVH.X.HW (half-word) missing?
400
401 [[!table data="""
402 31..27| 26..25| 24..20 |19..15|14...12| 11..7 | 6....0 | function |
403 funct5| SDHQ | rs2 | rs1 |funct3 | rd | opcode | name |
404 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
405 11100 | 00 | 00000 | rs1 | 000 | rd | 1010011 | FMV.X.W |
406 11100 | 00 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.S |
407 11100 | 00 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
408 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
409 11100 | 01 | 00000 | rs1 | 000 | rd | 1010011 | FMV.X.D **FMVH.X.W** |
410 11100 | 01 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.D |
411 11100 | 01 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
412 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
413 11100 | 10 | 00000 | rs1 | 000 | rd | 1010011 |**FMV.X.H** |
414 11100 | 10 | 00000 | rs1 | 001 | rd | 1010011 |**FCLASS.H** |
415 11100 | 10 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
416 ------| ----- | ----- | -----| ----- | ----- | ------- | -------- |
417 11100 | 11 | 00000 | rs1 | 000 | rd | 1010011 | **FMVH.X.D** |
418 11100 | 11 | 00000 | rs1 | 001 | rd | 1010011 | FCLASS.Q |
419 11100 | xx | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
420 """]]
421
422 ## funct5 = 11101 - unused
423
424 Brownfield encodings available.
425
426 ## funct5 = 11110 - FMV
427
428 This table uses *both* rs2 *and* funct3 for encoding 1-operand FP operations.
429
430 Notes:
431
432 * FMV.Q.X is missing (as is FMVH.D.X)
433 * FMVH.W.X is missing (alias of FMV.D.X)
434 * FP16 logically deduced from fmt field (bits 25-26)
435 * FMVH.HW.X (half-word) missing?
436
437 [[!table data="""
438 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
439 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
440 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
441 11110 | 00 | 00000 | rs1 | 000 | rd | 1010011 | FMV.W.X |
442 11110 | 00 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
443 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
444 11110 | 01 | 00000 | rs1 | 000 | rd | 1010011 | FMV.D.X |
445 11110 | 01 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
446 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
447 11110 | 10 | 00000 | rs1 | 000 | rd | 1010011 |**FMV.H.X** |
448 11110 | 10 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
449 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
450 11110 | 11 | 00000 | rs1 | 000 | rd | 1010011 | ? |
451 11110 | 11 | xxxxx | rs1 | yyy | rd | 1010011 | rs2? f3? |
452 """]]
453
454 ## funct5 = 11111 - unused
455
456 Brownfield encodings available.
457
458 ## funct5 = ????? (table template)
459
460 This table acts as a cut/paste template for creating brownfield encodings
461
462 [[!table data="""
463 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
464 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
465 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
466 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
467 """]]
468