Added English Language description for stdupx instruction
[openpower-isa.git] / openpower / isa / fixedload.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
30
31 D-Form
32
33 * lbz RT,D(RA)
34
35 Pseudo-code:
36
37 b <- (RA|0)
38 EA <- b + EXTS(D)
39 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
40
41 Description:
42
43 Let the effective address (EA) be the sum (RA|0)+ D.
44 The byte in storage addressed by EA is loaded into
45 RT[56:63]. RT[0:55] are set to 0.
46
47 Special Registers Altered:
48
49 None
50
51 # Load Byte and Zero Indexed
52
53 X-Form
54
55 * lbzx RT,RA,RB
56
57 Pseudo-code:
58
59 b <- (RA|0)
60 EA <- b + (RB)
61 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
62
63 Description:
64
65 Let the effective address (EA) be the sum
66 (RA|0)+ (RB). The byte in storage addressed by EA is
67 loaded into RT[56:63] . RT[0:55] are set to 0.
68
69 Special Registers Altered:
70
71 None
72
73 # Load Byte and Zero with Update
74
75 D-Form
76
77 * lbzu RT,D(RA)
78
79 Pseudo-code:
80
81 EA <- (RA) + EXTS(D)
82 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
83 RA <- EA
84
85 Description:
86
87 Let the effective address (EA) be the sum (RA)+ D. The
88 byte in storage addressed by EA is loaded into RT[56:63].
89 RT[0:55] are set to 0.
90
91 EA is placed into register RA.
92
93 If RA=0 or RA=RT, the instruction form is invalid.
94
95 Special Registers Altered:
96
97 None
98
99 # Load Byte and Zero with Update Indexed
100
101 X-Form
102
103 * lbzux RT,RA,RB
104
105 Pseudo-code:
106
107 EA <- (RA) + (RB)
108 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
109 RA <- EA
110
111 Description:
112
113 Let the effective address (EA) be the sum (RA)+ (RB).
114 The byte in storage addressed by EA is loaded into
115 RT[56:63]. RT[0:55] are set to 0.
116
117 EA is placed into register RA.
118
119 If RA=0 or RA=RT, the instruction form is invalid.
120
121 Special Registers Altered:
122
123 None
124
125 # Load Halfword and Zero
126
127 D-Form
128
129 * lhz RT,D(RA)
130
131 Pseudo-code:
132
133 b <- (RA|0)
134 EA <- b + EXTS(D)
135 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
136
137 Description:
138
139 Let the effective address (EA) be the sum (RA|0)+ D.
140 The halfword in storage addressed by EA is loaded into
141 RT[48:63]. RT[0:47] are set to 0.
142
143 Special Registers Altered:
144
145 None
146
147 # Load Halfword and Zero Indexed
148
149 X-Form
150
151 * lhzx RT,RA,RB
152
153 Pseudo-code:
154
155 b <- (RA|0)
156 EA <- b + (RB)
157 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
158
159 Description:
160
161 Let the effective address (EA) be the sum
162 (RA|0)+ (RB). The halfword in storage addressed by
163 EA is loaded into RT[48:63]. RT[0:47] are set to 0.
164
165 Special Registers Altered:
166
167 None
168
169 # Load Halfword and Zero with Update
170
171 D-Form
172
173 * lhzu RT,D(RA)
174
175 Pseudo-code:
176
177 EA <- (RA) + EXTS(D)
178 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
179 RA <- EA
180
181 Description:
182
183 Let the effective address (EA) be the sum (RA)+ D. The
184 halfword in storage addressed by EA is loaded into
185 RT[48:63]. RT[0:47] are set to 0.
186
187 EA is placed into register RA.
188
189 If RA=0 or RA=RT, the instruction form is invalid.
190
191 Special Registers Altered:
192
193 None
194
195 # Load Halfword and Zero with Update Indexed
196
197 X-Form
198
199 * lhzux RT,RA,RB
200
201 Pseudo-code:
202
203 EA <- (RA) + (RB)
204 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
205 RA <- EA
206
207 Description:
208
209 Let the effective address (EA) be the sum (RA)+ (RB).
210 The halfword in storage addressed by EA is loaded into
211 RT[48:63]. RT[0:47] are set to 0.
212
213 EA is placed into register RA.
214
215 If RA=0 or RA=RT, the instruction form is invalid.
216
217 Special Registers Altered:
218
219 None
220
221 # Load Halfword Algebraic
222
223 D-Form
224
225 * lha RT,D(RA)
226
227 Pseudo-code:
228
229 b <- (RA|0)
230 EA <- b + EXTS(D)
231 RT <- EXTS(MEM(EA, 2))
232
233 Description:
234
235 Let the effective address (EA) be the sum (RA|0)+ D.
236 The halfword in storage addressed by EA is loaded into
237 RT[48:63]. RT[0:47] are filled with a copy of bit 0 of the
238 loaded halfword.
239
240 Special Registers Altered:
241
242 None
243
244 # Load Halfword Algebraic Indexed
245
246 X-Form
247
248 * lhax RT,RA,RB
249
250 Pseudo-code:
251
252 b <- (RA|0)
253 EA <- b + (RB)
254 RT <- EXTS(MEM(EA, 2))
255
256 Description:
257
258 Let the effective address (EA) be the sum
259 (RA|0)+ (RB). The halfword in storage addressed by
260 EA is loaded into RT[48:63] . RT[0:47] are filled with a copy
261 of bit 0 of the loaded halfword.
262
263 Special Registers Altered:
264
265 None
266
267 # Load Halfword Algebraic with Update
268
269 D-Form
270
271 * lhau RT,D(RA)
272
273 Pseudo-code:
274
275 EA <- (RA) + EXTS(D)
276 RT <- EXTS(MEM(EA, 2))
277 RA <- EA
278
279 Description:
280
281 Let the effective address (EA) be the sum (RA)+ D. The
282 halfword in storage addressed by EA is loaded into
283 RT[48:63]. RT[0:47] are filled with a copy of bit 0 of the
284 loaded halfword.
285
286 EA is placed into register RA.
287
288 If RA=0 or RA=RT, the instruction form is invalid.
289
290 Special Registers Altered:
291
292 None
293
294 # Load Halfword Algebraic with Update Indexed
295
296 X-Form
297
298 * lhaux RT,RA,RB
299
300 Pseudo-code:
301
302 EA <- (RA) + (RB)
303 RT <- EXTS(MEM(EA, 2))
304 RA <- EA
305
306 Description:
307
308 Let the effective address (EA) be the sum (RA)+ (RB).
309 The halfword in storage addressed by EA is loaded into
310 RT[48:63]. RT[0:47] are filled with a copy of bit 0 of the
311 loaded halfword.
312
313 EA is placed into register RA.
314
315 If RA=0 or RA=RT, the instruction form is invalid.
316
317 Special Registers Altered:
318
319 None
320
321 # Load Word and Zero
322
323 D-Form
324
325 * lwz RT,D(RA)
326
327 Pseudo-code:
328
329 b <- (RA|0)
330 EA <- b + EXTS(D)
331 RT <- [0] * 32 || MEM(EA, 4)
332
333 Description:
334 Let the effective address (EA) be the sum (RA|0)+ D.
335 The word in storage addressed by EA is loaded into
336 RT[32:63]. RT[0:31] are set to 0.
337
338 Special Registers Altered:
339
340 None
341
342 # Load Word and Zero Indexed
343
344 X-Form
345
346 * lwzx RT,RA,RB
347
348 Pseudo-code:
349
350 b <- (RA|0)
351 EA <- b + (RB)
352 RT <- [0] * 32 || MEM(EA, 4)
353
354 Description:
355
356 Let the effective address (EA) be the sum
357 (RA|0)+ (RB). The word in storage addressed by EA is
358 loaded into RT[32:63] . RT[0:31] are set to 0.
359
360 Special Registers Altered:
361
362 None
363
364 # Load Word and Zero with Update
365
366 D-Form
367
368 * lwzu RT,D(RA)
369
370 Pseudo-code:
371
372 EA <- (RA) + EXTS(D)
373 RT <- [0]*32 || MEM(EA, 4)
374 RA <- EA
375
376 Description:
377
378 Let the effective address (EA) be the sum (RA)+ D. The
379 word in storage addressed by EA is loaded into
380 RT[32:63]. RT[0:31] are set to 0.
381
382 EA is placed into register RA.
383
384 If RA=0 or RA=RT, the instruction form is invalid.
385
386 Special Registers Altered:
387
388 None
389
390 # Load Word and Zero with Update Indexed
391
392 X-Form
393
394 * lwzux RT,RA,RB
395
396 Pseudo-code:
397
398 EA <- (RA) + (RB)
399 RT <- [0] * 32 || MEM(EA, 4)
400 RA <- EA
401
402 Description:
403
404 Let the effective address (EA) be the sum (RA)+ (RB).
405 The word in storage addressed by EA is loaded into
406 RT[32:63]. RT[0:31] are set to 0.
407
408 EA is placed into register RA.
409
410 If RA=0 or RA=RT, the instruction form is invalid.
411
412 Special Registers Altered:
413
414 None
415
416 # Load Word Algebraic
417
418 DS-Form
419
420 * lwa RT,DS(RA)
421
422 Pseudo-code:
423
424 b <- (RA|0)
425 EA <- b + EXTS(DS || 0b00)
426 RT <- EXTS(MEM(EA, 4))
427
428 Description:
429
430 Let the effective address (EA) be the sum
431 (RA|0)+ (DS||0b00). The word in storage addressed by
432 EA is loaded into RT[32:63] . RT[0:31] are filled with a copy
433 of bit 0 of the loaded word.
434
435 Special Registers Altered:
436
437 None
438
439 # Load Word Algebraic Indexed
440
441 X-Form
442
443 * lwax RT,RA,RB
444
445 Pseudo-code:
446
447 b <- (RA|0)
448 EA <- b + (RB)
449 RT <- EXTS(MEM(EA, 4))
450
451 Description:
452
453 Let the effective address (EA) be the sum
454 (RA|0)+ (RB). The word in storage addressed by EA is
455 loaded into RT[32:63] . RT[0:31] are filled with a copy of bit 0
456 of the loaded word.
457
458 Special Registers Altered:
459
460 None
461
462 # Load Word Algebraic with Update Indexed
463
464 X-Form
465
466 * lwaux RT,RA,RB
467
468 Pseudo-code:
469
470 EA <- (RA) + (RB)
471 RT <- EXTS(MEM(EA, 4))
472 RA <- EA
473
474 Description:
475
476 Let the effective address (EA) be the sum (RA)+ (RB).
477 The word in storage addressed by EA is loaded into
478 RT[32:63]. RT[0:31] are filled with a copy of bit 0 of the
479 loaded word.
480
481 EA is placed into register RA.
482
483 If RA=0 or RA=RT, the instruction form is invalid.
484
485 Special Registers Altered:
486
487 None
488
489 # Load Doubleword
490
491 DS-Form
492
493 * ld RT,DS(RA)
494
495 Pseudo-code:
496
497 b <- (RA|0)
498 EA <- b + EXTS(DS || 0b00)
499 RT <- MEM(EA, 8)
500
501 Description:
502
503 Let the effective address (EA) be the sum
504 (RA|0)+ (DS||0b00). The doubleword in storage
505 addressed by EA is loaded into RT.
506
507 Special Registers Altered:
508
509 None
510
511 # Load Doubleword Indexed
512
513 X-Form
514
515 * ldx RT,RA,RB
516
517 Pseudo-code:
518
519 b <- (RA|0)
520 EA <- b + (RB)
521 RT <- MEM(EA, 8)
522
523 Description:
524
525 Let the effective address (EA) be the sum
526 (RA|0)+ (RB). The doubleword in storage addressed by
527 EA is loaded into RT.
528
529 Special Registers Altered:
530
531 None
532
533 # Load Doubleword with Update Indexed
534
535 DS-Form
536
537 * ldu RT,DS(RA)
538
539 Pseudo-code:
540
541 EA <- (RA) + EXTS(DS || 0b00)
542 RT <- MEM(EA, 8)
543 RA <- EA
544
545 Description:
546
547 Let the effective address (EA) be the sum
548 (RA)+ (DS||0b00). The doubleword in storage
549 addressed by EA is loaded into RT.
550
551 EA is placed into register RA.
552
553 If RA=0 or RA=RT, the instruction form is invalid.
554
555 Special Registers Altered:
556
557 None
558
559 # Load Doubleword with Update Indexed
560
561 X-Form
562
563 * ldux RT,RA,RB
564
565 Pseudo-code:
566
567 EA <- (RA) + (RB)
568 RT <- MEM(EA, 8)
569 RA <- EA
570
571 Description:
572
573 Let the effective address (EA) be the sum (RA)+ (RB).
574 The doubleword in storage addressed by EA is loaded
575 into RT.
576
577 EA is placed into register RA.
578
579 If RA=0 or RA=RT, the instruction form is invalid.
580
581 Special Registers Altered:
582
583 None
584
585 <!-- Section 3.3.3 Fixed-Point Store Instructions pages 54 - 56 -->
586
587 <!-- The contents of register RS are stored into the byte, halfword, word, or -->
588 <!-- doubleword in storage addressed by EA. -->
589
590 <!-- Many of the Store instructions have an “update” form, in which register RA is -->
591 <!-- updated with the effective address. For these forms, the following rules apply. -->
592
593 <!-- If RA!=0, the effective address is placed into register RA. -->
594
595 <!-- If RS=RA, the contents of register RS are copied to the target storage element -->
596 <!-- and then EA is placed into RA (RS). -->
597
598 <!-- Section 3.3.3.1 64-bit Fixed-Point Store Instructions pages 57 -->
599
600 <!-- Section 3.3.4 Fixed Point Load and Store Quadword Instructions pages 58 - 59 -->
601
602 <!-- For lq, the quadword in storage addressed by EA is loaded into an even-odd pair -->
603 <!-- of GPRs as follows. In Big-Endian mode, the even-numbered GPR is loaded with -->
604 <!-- the doubleword from storage addressed by EA and the odd-numbered GPR is loaded -->
605 <!-- with the doubleword addressed by EA+8. In Little-Endian mode, the even-numbered -->
606 <!-- GPR is loaded with the byte-reversed doubleword from storage addressed by EA+8 -->
607 <!-- and the odd-numbered GPR is loaded with the byte-reversed doubleword addressed -->
608 <!-- by EA. -->
609
610 # Load Quadword
611
612 DQ-Form
613
614 * lq RTp,DQ(RA)
615
616 Pseudo-code:
617
618 b <- (RA|0)
619 EA <- b + EXTS(DQ || 0b0000)
620 RTp <- MEM(EA, 16)
621
622 Description
623
624 Let the effective address (EA) be the sum (RA|0)+
625 (DQ||0b0000). The quadword in storage addressed by
626 EA is loaded into register pair RTp.
627
628 If RTp is odd or RTp=RA, the instruction form is invalid.
629 If RTp=RA, an attempt to execute this instruction will
630 invoke the system illegal instruction error handler. (The
631 RTp=RA case includes the case of RTp=RA=0.)
632
633 The quadword in storage addressed by EA is loaded
634 into an even-odd pair of GPRs as follows. In
635 Big-Endian mode, the even-numbered GPR is loaded
636 with the doubleword from storage addressed by EA
637 and the odd-numbered GPR is loaded with the double-
638 word addressed by EA+8. In Little-Endian mode, the
639 even-numbered GPR is loaded with the byte-reversed
640 doubleword from storage addressed by EA+8 and the
641 odd-numbered GPR is loaded with the byte-reversed
642 doubleword addressed by EA.
643
644 Special Registers Altered:
645
646 None
647
648 <!-- Section 3.3.5 Fixed-Point Load and Store with Byte Reversal Instructions page 60 -->
649
650 # Load Halfword Byte-Reverse Indexed
651
652 X-Form
653
654 * lhbrx RT,RA,RB
655
656 Pseudo-code:
657
658 b <- (RA|0)
659 EA <- b + (RB)
660 load_data <- MEM(EA, 2)
661 RT <- [0]*48 || load_data[8:15] || load_data[0:7]
662
663 Description:
664
665 Let the effective address (EA) be the sum (RA|0)+(RB).
666 Bits 0:7 of the halfword in storage addressed by EA are
667 loaded into RT 56:63 . Bits 8:15 of the halfword in storage
668 addressed by EA are loaded into RT[48:55] . RT[0:47] are
669 set to 0.
670
671 Special Registers Altered:
672
673 None
674
675 # Load Word Byte-Reverse Indexed
676
677 X-Form
678
679 * lwbrx RT,RA,RB
680
681 Pseudo-code:
682
683 b <- (RA|0)
684 EA <- b + (RB)
685 load_data <- MEM(EA, 4)
686 RT <- ([0] * 32 || load_data[24:31] || load_data[16:23]
687 || load_data[8:15] || load_data[0:7])
688
689 Description:
690
691 Let the effective address (EA) be the sum
692 (RA|0)+ (RB). Bits 0:7 of the word in storage addressed
693 by EA are loaded into RT[56:63]. Bits 8:15 of the word in
694 storage addressed by EA are loaded into RT[48:55] . Bits
695 16:23 of the word in storage addressed by EA are
696 loaded into RT[40:47]. Bits 24:31 of the word in storage
697 addressed by EA are loaded into RT 32:39 . RT[0:31] are
698 set to 0.
699
700 Special Registers Altered:
701
702 None
703
704
705 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
706
707 # Load Doubleword Byte-Reverse Indexed
708
709 X-Form
710
711 * ldbrx RT,RA,RB
712
713 Pseudo-code:
714
715 b <- (RA|0)
716 EA <- b + (RB)
717 load_data <- MEM(EA, 8)
718 RT <- (load_data[56:63] || load_data[48:55]
719 || load_data[40:47] || load_data[32:39]
720 || load_data[24:31] || load_data[16:23]
721 || load_data[8:15] || load_data[0:7])
722
723 Description:
724
725 Let the effective address (EA) be the sum (RA|0)+(RB).
726 Bits 0:7 of the doubleword in storage addressed by EA
727 are loaded into RT[56:63] . Bits 8:15 of the doubleword in
728 storage addressed by EA are loaded into RT[48:55] . Bits
729 16:23 of the doubleword in storage addressed by EA
730 are loaded into RT[40:47]. Bits 24:31 of the doubleword in
731 storage addressed by EA are loaded into RT 32:39 . Bits
732 32:39 of the doubleword in storage addressed by EA
733 are loaded into RT[24:31]. Bits 40:47 of the doubleword in
734 storage addressed by EA are loaded into RT[16:23] . Bits
735 48:55 of the doubleword in storage addressed by EA
736 are loaded into RT[8:15] . Bits 56:63 of the doubleword in
737 storage addressed by EA are loaded into RT[0:7] .
738
739 Special Registers Altered:
740
741 None
742
743 <!-- Section 3.3.6 Fixed-Point Load and Store Multiple Instructions page 62 -->
744
745 # Load Multiple Word
746
747 D-Form
748
749 * lmw RT,D(RA)
750
751 Pseudo-code:
752
753 b <- (RA|0)
754 EA <- b + EXTS(D)
755 r <- RT[0:63]
756 do while r <= 31
757 GPR(r) <- [0]*32 || MEM(EA, 4)
758 r <- r + 1
759 EA <- EA + 4
760
761 Description:
762
763 Let n = (32-RT). Let the effective address (EA) be the
764 sum (RA|0)+ D.
765
766 n consecutive words starting at EA are loaded into the
767 low-order 32 bits of GPRs RT through 31. The
768 high-order 32 bits of these GPRs are set to zero.
769
770 If RA is in the range of registers to be loaded, including
771 the case in which RA=0, the instruction form is invalid.
772
773 This instruction is not supported in Little-Endian mode.
774 If it is executed in Little-Endian mode, the system align-
775 ment error handler is invoked.
776
777 Special Registers Altered:
778
779 None
780