remove immediate-versions of instructions for shifting
[openpower-isa.git] / openpower / isa / fixedstoreshift.mdwn
1 <!-- This defines instructions described in PowerISA Version 3.0 B Book 1 -->
2
3 <!-- This defines instructions that store from a register to RAM -->
4
5 <!-- Note that these pages also define equivalent load instructions, -->
6 <!-- these are described in fixedload.mdwn -->
7
8 <!-- Section 3.3.3 Fixed-Point Store Instructions pages 54 - 57 -->
9 <!-- Section 3.3.3.1 64-bit Fixed-Point Store Instructions page 57 -->
10 <!-- Section 3.3.4 Fixed Point Load and Store Quadword Instructions pages 58 - 59 -->
11 <!-- Section 3.3.5 Fixed-Point Load and Store with Byte Reversal Instructions page 60 -->
12 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
13 <!-- Section 3.3.6 Fixed-Point Load and Store Multiple Instructions page 62 -->
14
15 <!-- Section 3.3.3 Fixed-Point Store Instructions pages 54 - 57 -->
16
17 # Store Byte Shifted Indexed
18
19 X-Form
20
21 * stbsx RS,RA,RB,SH
22
23 Pseudo-code:
24
25 b <- (RA|0)
26 EA <- b + (RB) << (SH+1)
27 MEM(EA, 1) <- (RS)[XLEN-8:XLEN-1]
28
29 Description:
30
31 Let the effective address (EA) be the sum of the contents of
32 register RB shifted by (SH+1) and (RA|0).
33 RS [56:63] are stored into the byte in storage addressed by EA.
34
35 Special Registers Altered:
36
37 None
38
39 # Store Byte Shifted with Update Indexed
40
41 X-Form
42
43 * stbsux RS,RA,RB,SH
44
45 Pseudo-code:
46
47 EA <- (RA) + (RB) << (SH+1)
48 MEM(EA, 1) <- (RS)[XLEN-8:XLEN-1]
49 RA <- EA
50
51 Description:
52
53 Let the effective address (EA) be the sum of the contents of
54 register RB shifted by (SH+1) and (RA).
55 RS[56:63] are stored into the byte in storage addressed
56 by EA.
57
58 EA is placed into register RA.
59
60 If RA=0, the instruction form is invalid.
61
62 Special Registers Altered:
63
64 None
65
66 # Store Halfword Shifted Indexed
67
68 X-Form
69
70 * sthsx RS,RA,RB,SH
71
72 Pseudo-code:
73
74 b <- (RA|0)
75 EA <- b + (RB) << (SH+1)
76 MEM(EA, 2) <- (RS)[XLEN-16:XLEN-1]
77
78 Description:
79
80 Let the effective address (EA) be the sum of the contents of
81 register RB shifted by (SH+1) and (RA|0).
82 RS[48:63] are stored into the halfword in
83 storage addressed by EA.
84
85 Special Registers Altered:
86
87 None
88
89 # Store Halfword Shifted with Update Indexed
90
91 X-Form
92
93 * sthsux RS,RA,RB,SH
94
95 Pseudo-code:
96
97 EA <- (RA) + (RB) << (SH+1)
98 MEM(EA, 2) <- (RS)[XLEN-16:XLEN-1]
99 RA <- EA
100
101 Description:
102
103 Let the effective address (EA) be the sum of the contents of
104 register RB shifted by (SH+1) and (RB).
105 RS[48:63] are stored into the halfword in storage
106 addressed by EA.
107
108 EA is placed into register RA.
109
110 If RA=0, the instruction form is invalid.
111
112 Special Registers Altered:
113
114 None
115
116 # Store Word Shifted Indexed
117
118 X-Form
119
120 * stwsx RS,RA,RB,SH
121
122 Pseudo-code:
123
124 b <- (RA|0)
125 EA <- b + (RB) << (SH+1)
126 MEM(EA, 4) <- (RS)[XLEN-32:XLEN-1]
127
128 Description:
129
130 Let the effective address (EA) be the sum of the contents of
131 register RB shifted by (SH+1) and (RA|0).
132 RS[32:63] are stored into the word in stor-
133 age addressed by EA.
134
135 Special Registers Altered:
136
137 None
138
139 # Store Word Shifted with Update Indexed
140
141 X-Form
142
143 * stwsux RS,RA,RB,SH
144
145 Pseudo-code:
146
147 EA <- (RA) + (RB) << (SH+1)
148 MEM(EA, 4) <- (RS)[XLEN-32:XLEN-1]
149 RA <- EA
150
151 Description:
152
153 Let the effective address (EA) be the sum (RA)+ (RB).
154 RS[32:63] are stored into the word in storage addressed
155 by EA.
156
157 EA is placed into register RA.
158
159 If RA=0, the instruction form is invalid.
160
161 Special Registers Altered:
162
163 None
164
165
166
167 <!-- Section 3.3.3.1 64-bit Fixed-Point Store Instructions page 57 -->
168
169 # Store Doubleword Shifted Indexed
170
171 X-Form
172
173 * stdsx RS,RA,RB,SH
174
175 Pseudo-code:
176
177 b <- (RA|0)
178 EA <- b + (RB) << (SH+1)
179 MEM(EA, 8) <- (RS)
180
181 Description:
182
183 Let the effective address (EA) be the sum
184 (RA|0)+ (RB). (RS) is stored into the doubleword in
185 storage addressed by EA.
186
187 Special Registers Altered:
188
189 None
190
191 # Store Doubleword Shifted with Update Indexed
192
193 X-Form
194
195 * stdsux RS,RA,RB,SH
196
197 Pseudo-code:
198
199 EA <- (RA) + (RB) << (SH+1)
200 MEM(EA, 8) <- (RS)
201 RA <- EA
202
203 Description:
204
205 Let the effective address (EA) be the sum (RA)+ (RB).
206 (RS) is stored into the doubleword in storage
207 addressed by EA.
208
209 EA is placed into register RA.
210
211 If RA=0, the instruction form is invalid.
212
213 Special Registers Altered:
214
215 None
216
217
218 <!-- Section 3.3.5 Fixed-Point Load and Store with Byte Reversal Instructions page 60 -->
219
220 # Store Halfword Byte-Reverse Shifted Indexed
221
222 X-Form
223
224 * sthbrsx RS,RA,RB,SH
225
226 Pseudo-code:
227
228 b <- (RA|0)
229 EA <- b + (RB) << (SH+1)
230 MEM(EA, 2) <- (RS) [56:63] || (RS)[48:55]
231
232 Description:
233
234 Let the effective address (EA) be the sum
235 (RA|0)+ (RB). (RS)56:63 are stored into bits 0:7 of the
236 halfword in storage addressed by EA. (RS) 48:55 are
237 stored into bits 8:15 of the halfword in storage
238 addressed by EA.
239
240 Special Registers Altered:
241
242 None
243
244 # Store Word Byte-Reverse Shifted Indexed
245
246 X-Form
247
248 * stwbrsx RS,RA,RB,SH
249
250 Pseudo-code:
251
252 b <- (RA|0)
253 EA <- b + (RB) << (SH+1)
254 MEM(EA, 4) <- ((RS)[56:63] || (RS)[48:55] || (RS)[40:47]
255 ||(RS)[32:39])
256
257 Description:
258
259 Let the effective address (EA) be the sum
260 (RA|0)+ (RB). (RS)[56:63] are stored into bits 0:7 of the
261 word in storage addressed by EA. (RS) [48:55] are stored
262 into bits 8:15 of the word in storage addressed by EA.
263 (RS)[40:47] are stored into bits 16:23 of the word in stor-
264 age addressed by EA. (RS) [32:39] are stored into bits
265 24:31 of the word in storage addressed by EA.
266
267 Special Registers Altered:
268
269 None
270
271 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
272
273 # Store Doubleword Byte-Reverse Shifted Indexed
274
275 X-Form
276
277 * stdbrsx RS,RA,RB,SH
278
279 Pseudo-code:
280
281 b <- (RA|0)
282 EA <- b + (RB) << (SH+1)
283 MEM(EA, 8) <- ((RS) [56:63] || (RS)[48:55]
284 || (RS)[40:47] || (RS)[32:39]
285 || (RS)[24:31] || (RS)[16:23]
286 || (RS)[8:15] || (RS)[0:7])
287
288 Description:
289
290 Let the effective address (EA) be the sum
291 (RA|0)+ (RB). (RS)[56:63] are stored into bits 0:7 of the
292 doubleword in storage addressed by EA. (RS) [48:55] are
293 stored into bits 8:15 of the doubleword in storage
294 addressed by EA. (RS) [40:47] are stored into bits 16:23 of
295 the doubleword in storage addressed by EA. (RS) [32:39]
296 are stored into bits 23:31 of the doubleword in storage
297 addressed by EA. (RS) [24:31] are stored into bits 32:39 of
298 the doubleword in storage addressed by EA. (RS) [16:23]
299 are stored into bits 40:47 of the doubleword in storage
300 addressed by EA. (RS)[8:15] are stored into bits 48:55 of
301 the doubleword in storage addressed by EA. (RS) [0:7]
302 are stored into bits 56:63 of the doubleword in storage
303 addressed by EA.
304
305 Special Registers Altered:
306
307 None
308
309 <!-- Checked March 2021 -->