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)
63 Special Registers Altered:
67 # Load Byte and Zero with Update
76 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
81 Let the effective address (EA) be the sum (RA)+ D. The
82 byte in storage addressed by EA is loaded into RT[56:63].
83 RT[0:55] are set to 0.
85 EA is placed into register RA.
87 If RA=0 or RA=RT, the instruction form is invalid.
89 Special Registers Altered:
93 # Load Byte and Zero with Update Indexed
102 RT <- ([0] * (XLEN-8)) || MEM(EA, 1)
107 Let the effective address (EA) be the sum (RA)+ (RB).
108 The byte in storage addressed by EA is loaded into
109 RT[56:63]. RT[0:55] are set to 0.
111 EA is placed into register RA.
113 If RA=0 or RA=RT, the instruction form is invalid.
115 Special Registers Altered:
119 # Load Halfword and Zero
129 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
131 Special Registers Altered:
135 # Load Halfword and Zero Indexed
145 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
147 Special Registers Altered:
151 # Load Halfword and Zero with Update
160 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
165 Let the effective address (EA) be the sum (RA)+ D. The
166 halfword in storage addressed by EA is loaded into
167 RT[48:63]. RT[0:47] are set to 0.
169 EA is placed into register RA.
171 If RA=0 or RA=RT, the instruction form is invalid.
173 Special Registers Altered:
177 # Load Halfword and Zero with Update Indexed
186 RT <- ([0] * (XLEN-16)) || MEM(EA, 2)
191 Let the effective address (EA) be the sum (RA)+ (RB).
192 The halfword in storage addressed by EA is loaded into
193 RT[48:63]. RT[0:47] are set to 0.
195 EA is placed into register RA.
197 If RA=0 or RA=RT, the instruction form is invalid.
199 Special Registers Altered:
203 # Load Halfword Algebraic
213 RT <- EXTS(MEM(EA, 2))
215 Special Registers Altered:
219 # Load Halfword Algebraic Indexed
229 RT <- EXTS(MEM(EA, 2))
231 Special Registers Altered:
235 # Load Halfword Algebraic with Update
244 RT <- EXTS(MEM(EA, 2))
247 Special Registers Altered:
251 # Load Halfword Algebraic with Update Indexed
260 RT <- EXTS(MEM(EA, 2))
263 Special Registers Altered:
277 RT <- [0] * 32 || MEM(EA, 4)
279 Special Registers Altered:
283 # Load Word and Zero Indexed
293 RT <- [0] * 32 || MEM(EA, 4)
295 Special Registers Altered:
299 # Load Word and Zero with Update
308 RT <- [0]*32 || MEM(EA, 4)
311 Special Registers Altered:
315 # Load Word and Zero with Update Indexed
324 RT <- [0] * 32 || MEM(EA, 4)
327 Special Registers Altered:
331 # Load Word Algebraic
340 EA <- b + EXTS(DS || 0b00)
341 RT <- EXTS(MEM(EA, 4))
343 Special Registers Altered:
347 # Load Word Algebraic Indexed
357 RT <- EXTS(MEM(EA, 4))
359 Special Registers Altered:
363 # Load Word Algebraic with Update Indexed
372 RT <- EXTS(MEM(EA, 4))
375 Special Registers Altered:
388 EA <- b + EXTS(DS || 0b00)
391 Special Registers Altered:
395 # Load Doubleword Indexed
407 Special Registers Altered:
411 # Load Doubleword with Update Indexed
419 EA <- (RA) + EXTS(DS || 0b00)
423 Special Registers Altered:
427 # Load Doubleword with Update Indexed
439 Special Registers Altered:
443 <!-- Section 3.3.3 Fixed-Point Store Instructions pages 54 - 56 -->
445 <!-- The contents of register RS are stored into the byte, halfword, word, or -->
446 <!-- doubleword in storage addressed by EA. -->
448 <!-- Many of the Store instructions have an “update” form, in which register RA is -->
449 <!-- updated with the effective address. For these forms, the following rules apply. -->
451 <!-- If RA!=0, the effective address is placed into register RA. -->
453 <!-- If RS=RA, the contents of register RS are copied to the target storage element -->
454 <!-- and then EA is placed into RA (RS). -->
456 <!-- Section 3.3.3.1 64-bit Fixed-Point Store Instructions pages 57 -->
458 <!-- Section 3.3.4 Fixed Point Load and Store Quadword Instructions pages 58 - 59 -->
460 <!-- For lq, the quadword in storage addressed by EA is loaded into an even-odd pair -->
461 <!-- of GPRs as follows. In Big-Endian mode, the even-numbered GPR is loaded with -->
462 <!-- the doubleword from storage addressed by EA and the odd-numbered GPR is loaded -->
463 <!-- with the doubleword addressed by EA+8. In Little-Endian mode, the even-numbered -->
464 <!-- GPR is loaded with the byte-reversed doubleword from storage addressed by EA+8 -->
465 <!-- and the odd-numbered GPR is loaded with the byte-reversed doubleword addressed -->
477 EA <- b + EXTS(DQ || 0b0000)
480 Special Registers Altered:
484 <!-- Section 3.3.5 Fixed-Point Load and Store with Byte Reversal Instructions page 60 -->
486 # Load Halfword Byte-Reverse Indexed
496 load_data <- MEM(EA, 2)
497 RT <- [0]*48 || load_data[8:15] || load_data[0:7]
499 Special Registers Altered:
503 # Load Word Byte-Reverse Indexed
513 load_data <- MEM(EA, 4)
514 RT <- ([0] * 32 || load_data[24:31] || load_data[16:23]
515 || load_data[8:15] || load_data[0:7])
517 Special Registers Altered:
522 <!-- Section 3.3.5.1 64-Bit Load and Store with Byte Reversal Instructions page 61 -->
524 # Load Doubleword Byte-Reverse Indexed
534 load_data <- MEM(EA, 8)
535 RT <- (load_data[56:63] || load_data[48:55]
536 || load_data[40:47] || load_data[32:39]
537 || load_data[24:31] || load_data[16:23]
538 || load_data[8:15] || load_data[0:7])
540 Special Registers Altered:
544 <!-- Section 3.3.6 Fixed-Point Load and Store Multiple Instructions page 62 -->
558 GPR(r) <- [0]*32 || MEM(EA, 4)
562 Special Registers Altered: