pysvp64db: fix traversal
[openpower-isa.git] / openpower / isa / fixedtrap.mdwn
1 <!-- This defines instructions described in PowerISA Version 3.0 B Book 1 -->
2
3 <!-- Section 3.3.11 Fixed-Point Trap Instructions pages 89 - 91 -->
4
5 <!-- The Trap instructions are provided to test for a specified set of conditions. -->
6 <!-- If any of the conditions tested by a Trap instruction are met, the system trap -->
7 <!-- handler is invoked. If none of the tested conditions are met, instruction -->
8 <!-- execution continues normally. -->
9
10 # Trap Word Immediate
11
12 D-Form
13
14 * twi TO,RA,SI
15
16 Pseudo-code:
17
18 a <- EXTS((RA)[XLEN/2:XLEN-1])
19 if (a < EXTS(SI)) & TO[0] then TRAP
20 if (a > EXTS(SI)) & TO[1] then TRAP
21 if (a = EXTS(SI)) & TO[2] then TRAP
22 if (a <u EXTS(SI)) & TO[3] then TRAP
23 if (a >u EXTS(SI)) & TO[4] then TRAP
24
25 Special Registers Altered:
26
27 None
28
29 # Trap Word
30
31 X-Form
32
33 * tw TO,RA,RB
34
35 Pseudo-code:
36
37 a <- EXTS((RA)[XLEN/2:XLEN-1])
38 b <- EXTS((RB)[XLEN/2:XLEN-1])
39 if (a < b) & TO[0] then TRAP
40 if (a > b) & TO[1] then TRAP
41 if (a = b) & TO[2] then TRAP
42 if (a <u b) & TO[3] then TRAP
43 if (a >u b) & TO[4] then TRAP
44
45 Special Registers Altered:
46
47 None
48
49 # Trap Doubleword Immediate
50
51 D-Form
52
53 * tdi TO,RA,SI
54
55 Pseudo-code:
56
57 a <- (RA)
58 b <- EXTS(SI)
59 if (a < b) & TO[0] then TRAP
60 if (a > b) & TO[1] then TRAP
61 if (a = b) & TO[2] then TRAP
62 if (a <u b) & TO[3] then TRAP
63 if (a >u b) & TO[4] then TRAP
64
65 Special Registers Altered:
66
67 None
68
69 # Trap Doubleword
70
71 X-Form
72
73 * td TO,RA,RB
74
75 Pseudo-code:
76
77 a <- (RA)
78 b <- (RB)
79 if (a < b) & TO[0] then TRAP
80 if (a > b) & TO[1] then TRAP
81 if (a = b) & TO[2] then TRAP
82 if (a <u b) & TO[3] then TRAP
83 if (a >u b) & TO[4] then TRAP
84
85 Special Registers Altered:
86
87 None
88
89 # Integer Select
90
91 A-Form
92
93 * isel RT,RA,RB,BC
94
95 Pseudo-code:
96
97 if CR[BC+32]=1 then RT <- (RA|0)
98 else RT <- (RB)
99
100 Special Registers Altered:
101
102 None
103
104 <!-- Checked March 2021 -->