added english language description for lwasux instruction
[openpower-isa.git] / openpower / isa / fixedloadshift.mdwn
1 <!-- This defines instructions described in PowerISA Version 3.0 B Book 1 -->
2
3 <!-- This defines instructions that load from RAM to a register -->
4
5 <!-- Note that these pages also define equivalent store instructions, -->
6 <!-- these are described in fixedstore.mdwn -->
7
8 <!-- Section 3.3.2 This defines the Fixed-Point Load Instructions pages 47 - 53 -->
9 <!-- Section 3.3.3 Fixed-Point Store Instructions pages 54 - 56 -->
10 <!-- Section 3.3.3.1 64-bit Fixed-Point Store Instructions pages 57 -->
11 <!-- Section 3.3.4 Fixed Point Load and Store Quadword Instructions pages 58 - 59 -->
12 <!-- Section 3.3.5 Fixed-Point Load and Store with Byte Reversal Instructions page 60 -->
13 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
14 <!-- Section 3.3.6 Fixed-Point Load and Store Multiple Instructions page 62 -->
15
16
17
18 <!-- Section 3.3.2 This defines the Fixed-Point Load Instructions pages 47 - 53 -->
19
20 <!-- The byte, halfword, word, or doubleword in storage addressed by EA is loaded -->
21 <!-- into register RT. -->
22
23 <!-- Many of the Load instructions have an “update” form, in which register RA is -->
24 <!-- updated with the effective address. For these forms, if RA!=0 and RA!=RT, the -->
25 <!-- effective address is placed into register RA and the storage element (byte, -->
26 <!-- halfword, word, or doubleword) addressed by EA is loaded into RT. -->
27
28
29 # Load Byte and Zero Shifted Indexed
30
31 X-Form
32
33 * lbzsx RT,RA,RB,SH
34
35 Pseudo-code:
36
37 b <- (RA|0)
38 EA <- b + (RB) << (SH+1)
39 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
40
41 Description:
42
43 Let the effective address (EA) be the sum of the contents of
44 register RB shifted by (SH+1), and (RA|0).
45
46 The byte in storage addressed by EA is loaded into RT[56:63].
47 RT[0:55] are set to 0.
48
49 Special Registers Altered:
50
51 None
52
53 # Load Byte and Zero Shifted with Update Indexed
54
55 X-Form
56
57 * lbzsux RT,RA,RB,SH
58
59 Pseudo-code:
60
61 EA <- (RA) + (RB) << (SH+1)
62 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
63 RA <- EA
64
65 Description:
66
67 Let the effective address (EA) be the sum of the contents of
68 register RB shifted by (SH+1), and the contents of register RA.
69
70 The byte in storage addressed by EA is loaded into RT[56:63].
71 RT[0:55] are set to 0.
72
73 EA is placed into register RA.
74
75 If RA=0, the instruction form is invalid.
76
77 Special Registers Altered:
78
79 None
80
81 # Load Halfword and Zero Shifted Indexed
82
83 X-Form
84
85 * lhzsx RT,RA,RB,SH
86
87 Pseudo-code:
88
89 b <- (RA|0)
90 EA <- b + (RB) << (SH+1)
91 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
92
93 Description:
94
95 Let the effective address (EA) be the sum of the contents of
96 register RB shifted by (SH+1), and (RA|0).
97
98 The halfword in storage addressed by EA is loaded into RT[48:63].
99 RT[0:47] are set to 0.
100
101 Special Registers Altered:
102
103 None
104
105 # Load Halfword and Zero Shifted with Update Indexed
106
107 X-Form
108
109 * lhzsux RT,RA,RB,SH
110
111 Pseudo-code:
112
113 EA <- (RA) + (RB) << (SH+1)
114 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
115 RA <- EA
116
117 Description:
118
119 Let the effective address (EA) be the sum of the contents of
120 register RB shifted by (SH+1), and the contents of register RA.
121
122 The halfword in storage addressed by EA is loaded into RT[48:63].
123 RT[0:47] are set to 0.
124
125 EA is placed into register RA.
126
127 If RA=0, the instruction form is invalid.
128
129 Special Registers Altered:
130
131 None
132
133 # Load Halfword Algebraic Shifted Indexed
134
135 X-Form
136
137 * lhasx RT,RA,RB,SH
138
139 Pseudo-code:
140
141 b <- (RA|0)
142 EA <- b + (RB) << (SH+1)
143 RT <- EXTS(MEM(EA, 2))
144
145 Description:
146
147 Let the effective address (EA) be the sum of the contents of
148 register RB shifted by (SH+1), and (RA|0).
149
150 The halfword in storage addressed by EA is loaded into RT[48:63].
151 RT[0:47] are filled with a copy of bit 0 of the loaded halfword.
152
153 Special Registers Altered:
154
155 None
156
157 # Load Halfword Algebraic Shifted with Update Indexed
158
159 X-Form
160
161 * lhasux RT,RA,RB,SH
162
163 Pseudo-code:
164
165 EA <- (RA) + (RB) << (SH+1)
166 RT <- EXTS(MEM(EA, 2))
167 RA <- EA
168
169 Description:
170
171 Let the effective address (EA) be the sum of the contents of
172 register RB shifted by (SH+1), and the contents of register RA.
173
174 The halfword in storage addressed by EA is loaded into RT[48:63].
175 RT[0:47] are filled with a copy of bit 0 of the loaded halfword.
176
177 EA is placed into register RA.
178
179 If RA=0 or RA=RT, the instruction form is invalid.
180
181 Special Registers Altered:
182
183 None
184
185 # Load Word and Zero Shifted Indexed
186
187 X-Form
188
189 * lwzsx RT,RA,RB,SH
190
191 Pseudo-code:
192
193 b <- (RA|0)
194 EA <- b + (RB) << (SH+1)
195 RT <- [0] * 32 || MEM(EA, 4)
196
197 Description:
198
199 Let the effective address (EA) be the sum of the contents of
200 register RB shifted by (SH+1), and (RA|0).
201
202 The word in storage addressed by EA is loaded into RT[32:63].
203 RT[0:31] are set to 0.
204
205 Special Registers Altered:
206
207 None
208
209 # Load Word and Zero Shifted with Update Indexed
210
211 X-Form
212
213 * lwzsux RT,RA,RB,SH
214
215 Pseudo-code:
216
217 EA <- (RA) + (RB) << (SH+1)
218 RT <- [0] * 32 || MEM(EA, 4)
219 RA <- EA
220
221 Description:
222
223 Let the effective address (EA) be the sum of the contents of
224 register RB shifted by (SH+1), and the contents of register RA.
225
226 The word in storage addressed by EA is loaded into RT[32:63].
227 RT[0:31] are set to 0.
228
229 EA is placed into register RA.
230
231 If RA=0 or RA=RT, the instruction form is invalid.
232
233 Special Registers Altered:
234
235 None
236
237 # Load Word Algebraic Shifted Indexed
238
239 X-Form
240
241 * lwasx RT,RA,RB,SH
242
243 Pseudo-code:
244
245 b <- (RA|0)
246 EA <- b + (RB) << (SH+1)
247 RT <- EXTS(MEM(EA, 4))
248
249 Description:
250
251 Let the effective address (EA) be the sum of the contents of
252 register RB shifted by (SH+1), and (RA|0).
253
254 The word in storage addressed by EA is loaded into RT[32:63].
255 RT[0:31] are filled with a copy of bit 0 of the loaded word.
256
257 Special Registers Altered:
258
259 None
260
261 # Load Word Algebraic Shifted with Update Indexed
262
263 X-Form
264
265 * lwasux RT,RA,RB,SH
266
267 Pseudo-code:
268
269 EA <- (RA) + (RB) << (SH+1)
270 RT <- EXTS(MEM(EA, 4))
271 RA <- EA
272
273 Description:
274
275 Let the effective address (EA) be the sum of the contents of
276 register RB shifted by (SH+1), and (RA).
277
278 The word in storage addressed by EA is loaded into RT[32:63].
279 RT[0:31] are filled with a copy of bit 0 of the loaded word.
280
281 EA is placed into register RA.
282
283 If RA=0 or RA=RT, the instruction form is invalid.
284
285 Special Registers Altered:
286
287 None
288
289 # Load Doubleword Shifted Indexed
290
291 X-Form
292
293 * ldsx RT,RA,RB,SH
294
295 Pseudo-code:
296
297 b <- (RA|0)
298 EA <- b + (RB) << (SH+1)
299 RT <- MEM(EA, 8)
300
301 Special Registers Altered:
302
303 None
304
305 # Load Doubleword Shifted with Update Indexed
306
307 X-Form
308
309 * ldsux RT,RA,RB,SH
310
311 Pseudo-code:
312
313 EA <- (RA) + (RB) << (SH+1)
314 RT <- MEM(EA, 8)
315 RA <- EA
316
317 Special Registers Altered:
318
319 None
320
321 <!-- byte-reverse shifted -->
322
323 # Load Halfword Byte-Reverse Shifted Indexed
324
325 X-Form
326
327 * lhbrsx RT,RA,RB,SH
328
329 Pseudo-code:
330
331 b <- (RA|0)
332 EA <- b + (RB) << (SH+1)
333 load_data <- MEM(EA, 2)
334 RT <- [0]*48 || load_data[8:15] || load_data[0:7]
335
336 Special Registers Altered:
337
338 None
339
340 # Load Word Byte-Reverse Shifted Indexed
341
342 X-Form
343
344 * lwbrsx RT,RA,RB,SH
345
346 Pseudo-code:
347
348 b <- (RA|0)
349 EA <- b + (RB) << (SH+1)
350 load_data <- MEM(EA, 4)
351 RT <- ([0] * 32 || load_data[24:31] || load_data[16:23]
352 || load_data[8:15] || load_data[0:7])
353
354 Special Registers Altered:
355
356 None
357
358
359 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
360
361 # Load Doubleword Byte-Reverse Shifted Indexed
362
363 X-Form
364
365 * ldbrsx RT,RA,RB,SH
366
367 Pseudo-code:
368
369 b <- (RA|0)
370 EA <- b + (RB) << (SH+1)
371 load_data <- MEM(EA, 8)
372 RT <- (load_data[56:63] || load_data[48:55]
373 || load_data[40:47] || load_data[32:39]
374 || load_data[24:31] || load_data[16:23]
375 || load_data[8:15] || load_data[0:7])
376
377 Special Registers Altered:
378
379 None
380