remove fcvttgs since it's redundant
[libreriscv.git] / openpower / sv / rfc / ls006.fpintmv.mdwn
1 # RFC ls006 FPR <-> GPR Move/Conversion
2
3 **URLs**:
4
5 * <https://libre-soc.org/openpower/sv/int_fp_mv/>
6 * <https://libre-soc.org/openpower/sv/rfc/ls006.fpintmv/>
7 * <https://bugs.libre-soc.org/show_bug.cgi?id=1015>
8 * <https://git.openpower.foundation/isa/PowerISA/issues/todo>
9
10 **Severity**: Major
11
12 **Status**: New
13
14 **Date**: 20 Oct 2022
15
16 **Target**: v3.2B
17
18 **Source**: v3.1B
19
20 **Books and Section affected**: **UPDATE**
21
22 * Book I 4.6.5 Floating-Point Move Instructions
23 * Book I 4.6.7.2 Floating-Point Convert To/From Integer Instructions
24 * Appendix E Power ISA sorted by opcode
25 * Appendix F Power ISA sorted by version
26 * Appendix G Power ISA sorted by Compliancy Subset
27 * Appendix H Power ISA sorted by mnemonic
28
29 **Summary**
30
31 Single-precision Instructions added:
32
33 * `fmvtgs` -- Single-Precision Floating Move To GPR
34 * `fmvfgs` -- Single-Precision Floating Move From GPR
35 * `fcvtfgs` -- Single-Precision Floating Convert From Integer In GPR
36
37 Identical (except Double-precision) Instructions added:
38
39 * `fmvtg` -- Double-Precision Floating Move To GPR
40 * `fmvfg` -- Double-Precision Floating Move From GPR
41 * `fcvttg` -- Double-Precision Floating Convert To Integer In GPR
42 * `fcvtfg` -- Double-Precision Floating Convert From Integer In GPR
43
44 **Submitter**: Luke Leighton (Libre-SOC)
45
46 **Requester**: Libre-SOC
47
48 **Impact on processor**:
49
50 * Addition of three new Single-Precision GPR-FPR-based instructions
51 * Addition of four new Double-Precision GPR-FPR-based instructions
52
53 **Impact on software**:
54
55 * Requires support for new instructions in assembler, debuggers,
56 and related tools.
57
58 **Keywords**:
59
60 ```
61 GPR, FPR, Move, Conversion, JavaScript
62 ```
63
64 **Motivation**
65
66 CPUs without VSX/VMX lack a way to efficiently transfer data between
67 FPRs and GPRs, they need to go through memory, this proposal adds more
68 efficient data transfer (both bitwise copy and Integer <-> FP conversion)
69 instructions that transfer directly between FPRs and GPRs without needing
70 to go through memory.
71
72 IEEE 754 doesn't specify what results are obtained when converting a NaN
73 or out-of-range floating-point value to integer, so different programming
74 languages and ISAs have made different choices. Below is an overview
75 of the different variants, listing the languages and hardware that
76 implements each variant.
77
78 **Notes and Observations**:
79
80 * These instructions are present in many other ISAs.
81 * JavaScript rounding as one instruction saves 32 scalar instructions
82 including seven branch instructions.
83 * Both sets are orthogonal (no difference except being Single/Double).
84 This allows IBM to follow the pre-existing precedent of allocating
85 separate Major Opcodes (PO) for Double-precision and Single-precision
86 respectively.
87
88 **Changes**
89
90 Add the following entries to:
91
92 * Book I 4.6.5 Floating-Point Move Instructions
93 * Book I 4.6.7.2 Floating-Point Convert To/From Integer Instructions
94 * Book I 1.6.1 and 1.6.2
95
96 ----------------
97
98 \newpage{}
99
100 [[!inline pages="openpower/sv/int_fp_mv/moves_and_conversions" raw=yes ]]
101
102 ----------
103
104 \newpage{}
105
106 ----------
107
108 # Instruction Formats
109
110 Add the following entries to Book I 1.6.1.19 XO-FORM:
111
112 ```
113 |0 |6 |11 |13 |16 |21 |22 |31 |
114 | PO | RT | IT | CVM | FRB | OE | XO | Rc |
115 ```
116
117 Add the following entries to Book I 1.6.1.15 X-FORM:
118
119 ```
120 |0 |6 |11 |13 |16 |21 |31 |
121 | PO | FRT | IT | // | RB | XO | Rc |
122 | PO | FRT | // | RB | XO | Rc |
123 | PO | RT | // | FRB | XO | Rc |
124 ```
125
126 # Instruction Fields
127
128 Add XO to FRB's Formats list in Book I 1.6.2 Word Instruction Fields.
129
130 Add XO to FRT's Formats list in Book I 1.6.2 Word Instruction Fields.
131
132 Add new fields:
133
134 ```
135 IT (11:12)
136 Field used to specify integer type for FPR <-> GPR conversions.
137
138 Formats: X, XO
139
140 CVM (13:15)
141 Field used to specify conversion mode for
142 integer -> floating-point conversion.
143
144 Formats: XO
145 ```
146
147 ----------
148
149 \newpage{}
150
151 ----------
152
153 # Appendices
154
155 Appendix E Power ISA sorted by opcode
156 Appendix F Power ISA sorted by version
157 Appendix G Power ISA sorted by Compliancy Subset
158 Appendix H Power ISA sorted by mnemonic
159
160 |Form| Book | Page | Version | mnemonic | Description |
161 |----|------|------|---------|----------|-------------|
162 |VA | I | # | 3.2B |todo | |
163
164 ----------------
165
166 [[!tag opf_rfc]]