1 <!-- This defines instructions described in PowerISA Version 3.0 B Book 1 -->
3 <!-- This defines instructions that load from RAM to a register -->
5 <!-- Note that these pages also define equivalent store instructions, -->
6 <!-- these are described in fixedstore.mdwn -->
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 -->
18 <!-- Section 3.3.2 This defines the Fixed-Point Load Instructions pages 47 - 53 -->
20 <!-- The byte, halfword, word, or doubleword in storage addressed by EA is loaded -->
21 <!-- into register RT. -->
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. -->
39 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
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.
47 Special Registers Altered:
51 # Load Byte and Zero Indexed
61 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
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.
69 Special Registers Altered:
73 # Load Byte and Zero with Update
82 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
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.
91 EA is placed into register RA.
93 If RA=0 or RA=RT, the instruction form is invalid.
95 Special Registers Altered:
99 # Load Byte and Zero with Update Indexed
108 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
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.
117 EA is placed into register RA.
119 If RA=0 or RA=RT, the instruction form is invalid.
121 Special Registers Altered:
125 # Load Halfword and Zero
135 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
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.
143 Special Registers Altered:
147 # Load Halfword and Zero Indexed
157 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
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.
165 Special Registers Altered:
169 # Load Halfword and Zero with Update
178 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
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.
187 EA is placed into register RA.
189 If RA=0 or RA=RT, the instruction form is invalid.
191 Special Registers Altered:
195 # Load Halfword and Zero with Update Indexed
204 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
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.
213 EA is placed into register RA.
215 If RA=0 or RA=RT, the instruction form is invalid.
217 Special Registers Altered:
221 # Load Halfword Algebraic
231 RT <- EXTS(MEM(EA, 2))
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
240 Special Registers Altered:
244 # Load Halfword Algebraic Indexed
254 RT <- EXTS(MEM(EA, 2))
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.
263 Special Registers Altered:
267 # Load Halfword Algebraic with Update
276 RT <- EXTS(MEM(EA, 2))
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
286 EA is placed into register RA.
288 If RA=0 or RA=RT, the instruction form is invalid.
290 Special Registers Altered:
294 # Load Halfword Algebraic with Update Indexed
303 RT <- EXTS(MEM(EA, 2))
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
313 EA is placed into register RA.
315 If RA=0 or RA=RT, the instruction form is invalid.
317 Special Registers Altered:
331 RT <- [0] * 32 || MEM(EA, 4)
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.
338 Special Registers Altered:
342 # Load Word and Zero Indexed
352 RT <- [0] * 32 || MEM(EA, 4)
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.
360 Special Registers Altered:
364 # Load Word and Zero with Update
373 RT <- [0]*32 || MEM(EA, 4)
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.
382 EA is placed into register RA.
384 If RA=0 or RA=RT, the instruction form is invalid.
386 Special Registers Altered:
390 # Load Word and Zero with Update Indexed
399 RT <- [0] * 32 || MEM(EA, 4)
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.
408 EA is placed into register RA.
410 If RA=0 or RA=RT, the instruction form is invalid.
412 Special Registers Altered:
416 # Load Word Algebraic
425 EA <- b + EXTS(DS || 0b00)
426 RT <- EXTS(MEM(EA, 4))
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.
435 Special Registers Altered:
439 # Load Word Algebraic Indexed
449 RT <- EXTS(MEM(EA, 4))
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
458 Special Registers Altered:
462 # Load Word Algebraic with Update Indexed
471 RT <- EXTS(MEM(EA, 4))
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
481 EA is placed into register RA.
483 If RA=0 or RA=RT, the instruction form is invalid.
485 Special Registers Altered:
498 EA <- b + EXTS(DS || 0b00)
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.
507 Special Registers Altered:
511 # Load Doubleword Indexed
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.
529 Special Registers Altered:
533 # Load Doubleword with Update Indexed
541 EA <- (RA) + EXTS(DS || 0b00)
545 Special Registers Altered:
549 # Load Doubleword with Update Indexed
561 Special Registers Altered:
565 <!-- Section 3.3.3 Fixed-Point Store Instructions pages 54 - 56 -->
567 <!-- The contents of register RS are stored into the byte, halfword, word, or -->
568 <!-- doubleword in storage addressed by EA. -->
570 <!-- Many of the Store instructions have an “update” form, in which register RA is -->
571 <!-- updated with the effective address. For these forms, the following rules apply. -->
573 <!-- If RA!=0, the effective address is placed into register RA. -->
575 <!-- If RS=RA, the contents of register RS are copied to the target storage element -->
576 <!-- and then EA is placed into RA (RS). -->
578 <!-- Section 3.3.3.1 64-bit Fixed-Point Store Instructions pages 57 -->
580 <!-- Section 3.3.4 Fixed Point Load and Store Quadword Instructions pages 58 - 59 -->
582 <!-- For lq, the quadword in storage addressed by EA is loaded into an even-odd pair -->
583 <!-- of GPRs as follows. In Big-Endian mode, the even-numbered GPR is loaded with -->
584 <!-- the doubleword from storage addressed by EA and the odd-numbered GPR is loaded -->
585 <!-- with the doubleword addressed by EA+8. In Little-Endian mode, the even-numbered -->
586 <!-- GPR is loaded with the byte-reversed doubleword from storage addressed by EA+8 -->
587 <!-- and the odd-numbered GPR is loaded with the byte-reversed doubleword addressed -->
599 EA <- b + EXTS(DQ || 0b0000)
602 Special Registers Altered:
606 <!-- Section 3.3.5 Fixed-Point Load and Store with Byte Reversal Instructions page 60 -->
608 # Load Halfword Byte-Reverse Indexed
618 load_data <- MEM(EA, 2)
619 RT <- [0]*48 || load_data[8:15] || load_data[0:7]
621 Special Registers Altered:
625 # Load Word Byte-Reverse Indexed
635 load_data <- MEM(EA, 4)
636 RT <- ([0] * 32 || load_data[24:31] || load_data[16:23]
637 || load_data[8:15] || load_data[0:7])
639 Special Registers Altered:
644 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
646 # Load Doubleword Byte-Reverse Indexed
656 load_data <- MEM(EA, 8)
657 RT <- (load_data[56:63] || load_data[48:55]
658 || load_data[40:47] || load_data[32:39]
659 || load_data[24:31] || load_data[16:23]
660 || load_data[8:15] || load_data[0:7])
662 Special Registers Altered:
666 <!-- Section 3.3.6 Fixed-Point Load and Store Multiple Instructions page 62 -->
680 GPR(r) <- [0]*32 || MEM(EA, 4)
684 Special Registers Altered: