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