(no commit message)
[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 (FPOW, FEXP, FLOG, FCBRT)
15 <http://bugs.libre-riscv.org/show_bug.cgi?id=127>
16 * Ztrig\* - see [[ztrans_proposal]]: Trigonometriics
17 (FSIN, FCOS, FTAN, arc-variants, hypotenuse-variants)
18 * Extension of formats to cover FP16 (RISC-V ISA Manual Table 11.3 "fmt field")
19 <https://groups.google.com/a/groups.riscv.org/d/msg/isa-dev/8knne5BtlvM>
20 * HI-half FP MV - <https://github.com/riscv/riscv-isa-manual/pull/301>
21 <https://groups.google.com/a/groups.riscv.org/forum/m/#!topic/isa-dev/kXgfFqgBv-c>
22 * (Add new entries here: Zextname - Description and URL)
23
24 [[!toc levels=2]]
25
26 # Main FP opcode 1010011 table
27
28 Notes:
29
30 * Proposed new encodings in **bold**.
31 * *Use funct5 sparingly!* - 2-operand functions only.
32 * Single-argument FP operations should go under one of the funct5 tables
33 * Both dual and single argument FP operations that do not require
34 "rounding mode" should go in one of the funct5 tables that already use
35 "funct3".
36 * The rs2 field can be best used to sub-select a considerable number
37 of 1-op operations, with "rounding" in funct3
38 * The funct3 field can be best used to sub-select a considerable number
39 of 2-op operations
40 * 1-op operations that do not need "rounding" have the best brownfield
41 availability: 8 bit sub-selection (rs2=5 + funct3=3). This however is
42 rare as most FP operations need "rounding" selection.
43 * Be careful not to use encoding space for which FP16 has already been
44 reserved (mostly FP conversion opcodes)
45
46 [[!table data="""
47 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
48 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
49 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
50 00000 | xx | rs2 | rs1 | rm | rd | 1010011 | FADD.xx |
51 00001 | xx | rs2 | rs1 | rm | rd | 1010011 | FSUB.xx |
52 00010 | xx | rs2 | rs1 | rm | rd | 1010011 | FMUL.xx |
53 00011 | xx | rs2 | rs1 | rm | rd | 1010011 | FDIV.xx |
54 00100 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
55 00101 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=00101 |
56 00110 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
57 00111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
58 01000 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=01000 |
59 01001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
60 01010 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
61 01011 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=01011 |
62 01100 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FHYPOT.xx** |
63 01101 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2.xx** |
64 01110 | xx | rs2 | rs1 | rm | rd | 1010011 | **FATAN2PI.xx**|
65 01111 | xx | rs2 | rs1 | rm | rd | 1010011 | **FPOW.xx** |
66 10000 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FROOTN.xx** |
67 10001 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FPOWN.xx** |
68 10010 | xx | rs2 | rs1 | yyy | rd | 1010011 | **FPOWR.xx** |
69 10011 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
70 10100 | xx | rs2 | rs1 | yyy | rd | 1010011 | tb=10100 |
71 10101 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
72 10110 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
73 10111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
74 11000 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11000 |
75 11001 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
76 11010 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11010 |
77 11100 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11100 |
78 11101 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
79 11110 | xx | xxxxx | rs1 | yyy | rd | 1010011 | tb=11110 |
80 11111 | xx | rs2 | rs1 | yyy | rd | 1010011 | ? |
81 """]]
82
83 Code:
84
85 * xx: Opcode format field "fmt" - Table 11.3
86 * xxxxx: 5-bit selection field (usually 1-op selection)
87 * yyy: funct3 selection field (usually 2-op selection)
88 * rm: "rounding mode"
89
90 ## funct5 = 00000 - FADD
91
92 No brownfield encodings available.
93
94 ## funct5 = 00001 - FSUB
95
96 No brownfield encodings available.
97
98 ## funct5 = 00010 - FMUL
99
100 No brownfield encodings available.
101
102 ## funct5 = 00011 - FDIV
103
104 No brownfield encodings available.
105
106 ## funct5 = 00100 - unused
107
108 Brownfield encodings available.
109
110 ## funct5 = 00100 - FSGN
111
112 This table uses funct3 for encoding 2-operand FP operations
113
114 [[!table data="""
115 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
116 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
117 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
118 00100 | xx | rs2 | rs1 | 000 | rd | 1010011 | FSGNJ.xx |
119 00100 | xx | rs2 | rs1 | 001 | rd | 1010011 | FSGNJN.xx |
120 00100 | xx | rs2 | rs1 | 010 | rd | 1010011 | FSGNJX.xx |
121 00100 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
122 00100 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
123 00100 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
124 00100 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
125 00100 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
126 """]]
127
128 ## funct5 = 00101 - FMIN/MAX
129
130 This table uses funct3 for encoding 2-operand FP operations where the result
131 register is a **floating-point** value.
132
133 [[!table data="""
134 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
135 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
136 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
137 00101 | xx | rs2 | rs1 | 000 | rd | 1010011 | FMIN.S |
138 00101 | xx | rs2 | rs1 | 001 | rd | 1010011 | FMAX.S |
139 00101 | xx | rs2 | rs1 | 010 | rd | 1010011 | ?f3=010 |
140 00101 | xx | rs2 | rs1 | 011 | rd | 1010011 | ?f3=011 |
141 00101 | xx | rs2 | rs1 | 100 | rd | 1010011 | ?f3=100 |
142 00101 | xx | rs2 | rs1 | 101 | rd | 1010011 | ?f3=101 |
143 00101 | xx | rs2 | rs1 | 110 | rd | 1010011 | ?f3=110 |
144 00101 | xx | rs2 | rs1 | 111 | rd | 1010011 | ?f3=111 |
145 """]]
146
147 ## funct5 = 00110 - unused
148
149 Brownfield encodings available.
150
151 ## funct5 = 00111 - unused
152
153 Brownfield encodings available.
154
155 ## funct5 = 01000 - FCVT
156
157 This table uses rs2 for encoding 1-operand FP operations, using
158 funct3 to specify the "rounding" mode
159
160 Notes:
161
162 * FP16 logically deduced from fmt field encoding (bits 25-26)
163
164 [[!table data="""
165 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
166 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
167 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
168 01000 | 00 | 00000 | rs1 | rm | rd | 1010011 | ???????? |
169 01000 | 00 | 00001 | rs1 | rm | rd | 1010011 | FCVT.S.D |
170 01000 | 00 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.S.H**|
171 01000 | 00 | 00011 | rs1 | rm | rd | 1010011 | FCVT.S.Q |
172 01000 | 00 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
173 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
174 01000 | 01 | 00000 | rs1 | rm | rd | 1010011 | FCVT.D.S |
175 01000 | 01 | 00001 | rs1 | rm | rd | 1010011 | ???????? |
176 01000 | 01 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.D.H**|
177 01000 | 01 | 00011 | rs1 | rm | rd | 1010011 | FCVT.D.Q |
178 01000 | 01 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
179 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
180 01000 | 10 | 00000 | rs1 | rm | rd | 1010011 | FCVT.H.S |
181 01000 | 10 | 00001 | rs1 | rm | rd | 1010011 | **FCVT.H.D**|
182 01000 | 10 | 00010 | rs1 | rm | rd | 1010011 | ???????? |
183 01000 | 10 | 00011 | rs1 | rm | rd | 1010011 | FCVT.H.Q |
184 01000 | 10 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
185 ------ | ----- | ----- | -----| ----- | ----- | ------- | -------- |
186 01000 | 11 | 00000 | rs1 | rm | rd | 1010011 | FCVT.Q.S |
187 01000 | 11 | 00001 | rs1 | rm | rd | 1010011 | FCVT.Q.D |
188 01000 | 11 | 00010 | rs1 | rm | rd | 1010011 | **FCVT.Q.H**|
189 01000 | 11 | 00011 | rs1 | rm | rd | 1010011 | ???????? |
190 01000 | 11 | xxxxx | rs1 | rm | rd | 1010011 | rs2? |
191 """]]
192
193 ## funct5 = 01001 - unused
194
195 Brownfield encodings available.
196
197 ## funct5 = 01010 - unused
198
199 Brownfield encodings available.
200
201 ## funct5 = 01011 - 1-op Transcendentals <a name="transcendentals_1op"></a>
202
203 This table uses rs2 for encoding 1-operand FP operations, using
204 funct3 to specify the "rounding" mode
205
206 [[!table data="""
207 31..27 | 26..25 | 24..20 |19..15| 14...12| 11..7 | 6....0 | function |
208 funct5 | SDHQ | rs2 | rs1 | funct3 | rd | opcode | name |
209 5 | 2 | 5 | 5 | 3 | 5 | 7 | |
210 01011 | xx | 00000 | rs1 | rm | rd | 1010011 | FSQRT.xx |
211 01011 | xx | 00001 | rs1 | rm | rd | 1010011 | **FRSQRT.xx** |
212 01011 | xx | 00010 | rs1 | rm | rd | 1010011 | **FRECIP.xx** |
213 01011 | xx | 00011 | rs1 | rm | rd | 1010011 | **FCBRT.xx** |
214 01011 | xx | 00100 | rs1 | rm | rd | 1010011 | **FEXP2.xx** |
215 01011 | xx | 00101 | rs1 | rm | rd | 1010011 | **FLOG2.xx** |
216 01011 | xx | 00110 | rs1 | rm | rd | 1010011 | **FEXPM1.xx** |
217 01011 | xx | 00111 | rs1 | rm | rd | 1010011 | **FLOGP1.xx** |
218 01011 | xx | 01000 | rs1 | rm | rd | 1010011 | **FEXP.xx** |
219 01011 | xx | 01001 | rs1 | rm | rd | 1010011 | **FLOG.xx** |
220 01011 | xx | 01010 | rs1 | rm | rd | 1010011 | **FEXP10.xx** |
221 01011 | xx | 01011 | rs1 | rm | rd | 1010011 | **FLOG10.xx** |
222 01011 | xx | 01100 | rs1 | rm | rd | 1010011 | **FASINH.xx** |
223 01011 | xx | 01101 | rs1 | rm | rd | 1010011 | **FACOSH.xx** |
224 01011 | xx | 01110 | rs1 | rm | rd | 1010011 | **FATANH.xx** |
225 01011 | xx | 01111 | rs1 | rm | rd | 1010011 | ? |
226 01011 | xx | 10000 | rs1 | rm | rd | 1010011 | **FSIN.xx** |
227 01011 | xx | 10001 | rs1 | rm | rd | 1010011 | **FSINPI.xx** |
228 01011 | xx | 10010 | rs1 | rm | rd | 1010011 | **FASIN.xx** |
229 01011 | xx | 10011 | rs1 | rm | rd | 1010011 | **FASINPI.xx**|
230 01011 | xx | 10100 | rs1 | rm | rd | 1010011 | **FCOS.xx** |
231 01011 | xx | 10101 | rs1 | rm | rd | 1010011 | **FCOSPI.xx** |
232 01011 | xx | 10110 | rs1 | rm | rd | 1010011 | **FACOS.xx** |
233 01011 | xx | 10111 | rs1 | rm | rd | 1010011 | **FACOSPI.xx**|
234 01011 | xx | 11000 | rs1 | rm | rd | 1010011 | **FTAN.xx** |
235 01011 | xx | 11001 | rs1 | rm | rd | 1010011 | **FTANPI.xx** |
236 01011 | xx | 11010 | rs1 | rm | rd | 1010011 | **FATAN.xx** |
237 01011 | xx | 11011 | rs1 | rm | rd | 1010011 | **FATANPI.xx**|
238 01011 | xx | 11100 | rs1 | rm | rd | 1010011 | **FSINH.xx** |
239 01011 | xx | 11101 | rs1 | rm | rd | 1010011 | **FCOSH.xx** |
240 01011 | xx | 11110 | rs1 | rm | rd | 1010011 | **FTANH.xx** |
241 01011 | xx | 11111 | rs1 | rm | rd | 1010011 | ? |
242 """]]
243
244 ## funct5 = 01100 - **FHYPOT**
245
246 Proposed for Zftrans - FHYPOT: "sqrt(rs1 * rs1 + rs2 * rs2)"
247
248 ## funct5 = 01101 - **FATAN2**
249
250 Proposed for Zftrans - FATAN: "atan(rs1, rs2)"
251
252 ## funct5 = 01110 - **FATAN2PI**
253
254 Proposed for ZftransExt - FATAN2PI: "atan2(rs1, rs2) * PI".
255 Rationale: Gives better accuracy than if using FMUL with the constant, PI.
256
257 ## funct5 = 01111 - **FPOW**
258
259 Proposed for ZftransAdv - FPOW: "FP rs1 to the power of rs2"
260
261 ## funct5 = 10000 - **FROOTN**
262
263 Proposed for ZftransAdv - FPROOTN: "FP rs1 to the power of (1/rs2)".
264 rs1 is FP, rs2 is **integer**.
265
266 ## funct5 = 10000 - **FPOWN**
267
268 Proposed for ZftransAdv - FPOW: "FP rs1 to the power of rs2"
269 rs1 is FP, rs2 is **integer**.
270
271 ## funct5 = 10001 - **FPOW**
272
273 Proposed for ZftransAdv - FPOWN: "FP rs1 to the power of rs2, rs1 +ve"
274 rs1 and rs2 are FP, rs1 must be +ve. Equivalent to "exp(rs2 * log(rs1))"
275
276 ## funct5 = 10010 - unused
277
278 Brownfield encodings available.
279
280 ## funct5 = 10011 - unused
281
282 Brownfield encodings available.
283
284 ## funct5 = 10100 - FP comparisons
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 - FCVT
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 - FCVT
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 - FMV, FCLASS
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 - FMV
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