[PDF] Synergistic Processor Unit Instruction Set Architecture v1.0

The purpose of this document is to provide a description of the Synergistic Processor Unit (SPU) Instruction
Set Architecture (ISA) as it relates to the Cell Broadband Engine Architecture (CBEA).
This document is intended for designers who plan to develop products using the SPU ISA

Contents
List of Figures ………………………………………………………………………………………………….. 9
List of Tables ………………………………………………………………………………………………….. 11
Preface ………………………………………………………………………………………………………….. 13
1. Introduction ………………………………………………………………………………………………… 21
1.1 Rationale for SPU Architecture …………………………………………………………………………………………. 21
2. SPU Architectural Overview ………………………………………………………………………… 23
2.1 Data Representation ……………………………………………………………………………………………………….. 23
2.1.1 Byte Ordering ………………………………………………………………………………………………………… 23
2.2 Data Layout in Registers ………………………………………………………………………………………………….. 26
2.3 Instruction Formats …………………………………………………………………………………………………………. 26
3. Memory – Load/Store Instructions ………………………………………………………………… 28
3.1 Local Store …………………………………………………………………………………………………………………….. 28
Load Quadword (d-form) ……………………………………………………………………………………………… 29
Load Quadword (x-form) ……………………………………………………………………………………………… 30
Load Quadword (a-form) ……………………………………………………………………………………………… 31
Load Quadword Instruction Relative (a-form) …………………………………………………………………. 32
Store Quadword (d-form) …………………………………………………………………………………………….. 33
Store Quadword (x-form) ……………………………………………………………………………………………… 34
Store Quadword (a-form) …………………………………………………………………………………………….. 35
Store Quadword Instruction Relative (a-form) …………………………………………………………………. 36
Generate Controls for Byte Insertion (d-form) …………………………………………………………………. 37
Generate Controls for Byte Insertion (x-form) …………………………………………………………………. 38
Generate Controls for Halfword Insertion (d-form) …………………………………………………………… 39
Generate Controls for Halfword Insertion (x-form) …………………………………………………………… 40
Generate Controls for Word Insertion (d-form) ………………………………………………………………… 41
Generate Controls for Word Insertion (x-form) ………………………………………………………………… 42
Generate Controls for Doubleword Insertion (d-form) ………………………………………………………. 43
Generate Controls for Doubleword Insertion (x-form) ………………………………………………………. 44
4. Constant-Formation Instructions …………………………………………………………………. 45
Immediate Load Halfword ……………………………………………………………………………………………. 46
Immediate Load Halfword Upper …………………………………………………………………………………… 47
Immediate Load Word …………………………………………………………………………………………………. 48
Immediate Load Address …………………………………………………………………………………………….. 49
Immediate Or Halfword Lower ………………………………………………………………………………………. 50
Form Select Mask for Bytes Immediate …………………………………………………………………………. 51
5. Integer and Logical Instructions ………………………………………………………………….. 52
Add Halfword ……………………………………………………………………………………………………………… 53
Add Halfword Immediate ……………………………………………………………………………………………… 54
Instruction Set Architecture
Synergistic Processor Unit
Contents
Page 4 of 257
Version 1.0
August 1, 2005
Add Word …………………………………………………………………………………………………………………… 55
Add Word Immediate …………………………………………………………………………………………………… 56
Subtract From Halfword ……………………………………………………………………………………………….. 57
Subtract From Halfword Immediate ……………………………………………………………………………….. 58
Subtract From Word ……………………………………………………………………………………………………. 59
Subtract From Word Immediate ……………………………………………………………………………………. 60
Add Extended …………………………………………………………………………………………………………….. 61
Carry Generate …………………………………………………………………………………………………………… 62
Carry Generate Extended …………………………………………………………………………………………….. 63
Subtract From Extended ………………………………………………………………………………………………. 64
Borrow Generate ………………………………………………………………………………………………………… 65
Borrow Generate Extended ………………………………………………………………………………………….. 66
Multiply ……………………………………………………………………………………………………………………… 67
Multiply Unsigned ……………………………………………………………………………………………………….. 68
Multiply Immediate ………………………………………………………………………………………………………. 69
Multiply Unsigned Immediate ……………………………………………………………………………………….. 70
Multiply and Add …………………………………………………………………………………………………………. 71
Multiply High ………………………………………………………………………………………………………………. 72
Multiply and Shift Right ………………………………………………………………………………………………… 73
Multiply High High ……………………………………………………………………………………………………….. 74
Multiply High High and Add ………………………………………………………………………………………….. 75
Multiply High High Unsigned ………………………………………………………………………………………… 76
Multiply High High Unsigned and Add ……………………………………………………………………………. 77
Count Leading Zeros …………………………………………………………………………………………………… 78
Count Ones in Bytes ……………………………………………………………………………………………………. 79
Form Select Mask for Bytes …………………………………………………………………………………………. 80
Form Select Mask for Halfwords …………………………………………………………………………………… 81
Form Select Mask for Words ………………………………………………………………………………………… 82
Gather Bits from Bytes ………………………………………………………………………………………………… 83
Gather Bits from Halfwords ………………………………………………………………………………………….. 84
Gather Bits from Words ……………………………………………………………………………………………….. 85
Average Bytes ……………………………………………………………………………………………………………. 86
Absolute Differences of Bytes ………………………………………………………………………………………. 87
Sum Bytes into Halfwords ……………………………………………………………………………………………. 88
Extend Sign Byte to Halfword ……………………………………………………………………………………….. 89
Extend Sign Halfword to Word ……………………………………………………………………………………… 90
Extend Sign Word to Doubleword …………………………………………………………………………………. 91
And …………………………………………………………………………………………………………………………… 92
And with Complement …………………………………………………………………………………………………. 93
And Byte Immediate ……………………………………………………………………………………………………. 94
And Halfword Immediate ……………………………………………………………………………………………… 95
And Word Immediate …………………………………………………………………………………………………… 96
Or ……………………………………………………………………………………………………………………………… 97
Or with Complement ……………………………………………………………………………………………………. 98
Or Byte Immediate ………………………………………………………………………………………………………. 99
Or Halfword Immediate ………………………………………………………………………………………………. 100
Or Word Immediate …………………………………………………………………………………………………… 101
Or Across …………………………………………………………………………………………………………………. 102
Exclusive Or …………………………………………………………………………………………………………….. 103
Exclusive Or Byte Immediate ……………………………………………………………………………………… 104
Instruction Set Architecture
Synergistic Processor Unit
Version 1.0
August 1, 2005
Contents
Page 5 of 257
Exclusive Or Halfword Immediate ……………………………………………………………………………….. 105
Exclusive Or Word Immediate …………………………………………………………………………………….. 106
Nand ……………………………………………………………………………………………………………………….. 107
Nor ………………………………………………………………………………………………………………………….. 108
Equivalent ………………………………………………………………………………………………………………… 109
Select Bits ……………………………………………………………………………………………………………….. 110
Shuffle Bytes ……………………………………………………………………………………………………………. 111
6. Shift and Rotate Instructions ……………………………………………………………………… 112
Shift Left Halfword …………………………………………………………………………………………………….. 113
Shift Left Halfword Immediate …………………………………………………………………………………….. 114
Shift Left Word ………………………………………………………………………………………………………….. 115
Shift Left Word Immediate ………………………………………………………………………………………….. 116
Shift Left Quadword by Bits ………………………………………………………………………………………… 117
Shift Left Quadword by Bits Immediate ………………………………………………………………………… 118
Shift Left Quadword by Bytes ……………………………………………………………………………………… 119
Shift Left Quadword by Bytes Immediate ……………………………………………………………………… 120
Shift Left Quadword by Bytes from Bit Shift Count …………………………………………………………. 121
Rotate Halfword ………………………………………………………………………………………………………… 122
Rotate Halfword Immediate ………………………………………………………………………………………… 123
Rotate Word …………………………………………………………………………………………………………….. 124
Rotate Word Immediate …………………………………………………………………………………………….. 125
Rotate Quadword by Bytes ………………………………………………………………………………………… 126
Rotate Quadword by Bytes Immediate …………………………………………………………………………. 127
Rotate Quadword by Bytes from Bit Shift Count ……………………………………………………………. 128
Rotate Quadword by Bits …………………………………………………………………………………………… 129
Rotate Quadword by Bits Immediate ……………………………………………………………………………. 130
Rotate and Mask Halfword …………………………………………………………………………………………. 131
Rotate and Mask Halfword Immediate …………………………………………………………………………. 132
Rotate and Mask Word ………………………………………………………………………………………………. 133
Rotate and Mask Word Immediate ………………………………………………………………………………. 134
Rotate and Mask Quadword by Bytes ………………………………………………………………………….. 135
Rotate and Mask Quadword by Bytes Immediate ………………………………………………………….. 136
Rotate and Mask Quadword Bytes from Bit Shift Count …………………………………………………. 137
Rotate and Mask Quadword by Bits …………………………………………………………………………….. 138
Rotate and Mask Quadword by Bits Immediate …………………………………………………………….. 139
Rotate and Mask Algebraic Halfword …………………………………………………………………………… 140
Rotate and Mask Algebraic Halfword Immediate …………………………………………………………… 141
Rotate and Mask Algebraic Word ………………………………………………………………………………… 142
Rotate and Mask Algebraic Word Immediate ………………………………………………………………… 143
7. Compare, Branch, and Halt Instructions …………………………………………………….. 144
Halt If Equal ……………………………………………………………………………………………………………… 145
Halt If Equal Immediate ……………………………………………………………………………………………… 146
Halt If Greater Than …………………………………………………………………………………………………… 147
Halt If Greater Than Immediate …………………………………………………………………………………… 148
Halt If Logically Greater Than ……………………………………………………………………………………… 149
Halt If Logically Greater Than Immediate ……………………………………………………………………… 150
Compare Equal Byte …………………………………………………………………………………………………. 151
Compare Equal Byte Immediate …………………………………………………………………………………. 152
Instruction Set Architecture
Synergistic Processor Unit
Contents
Page 6 of 257
Version 1.0
August 1, 2005
Compare Equal Halfword …………………………………………………………………………………………… 153
Compare Equal Halfword Immediate ……………………………………………………………………………. 154
Compare Equal Word ………………………………………………………………………………………………… 155
Compare Equal Word Immediate ………………………………………………………………………………… 156
Compare Greater Than Byte ………………………………………………………………………………………. 157
Compare Greater Than Byte Immediate ………………………………………………………………………. 158
Compare Greater Than Halfword ………………………………………………………………………………… 159
Compare Greater Than Halfword Immediate ………………………………………………………………… 160
Compare Greater Than Word ……………………………………………………………………………………… 161
Compare Greater Than Word Immediate ……………………………………………………………………… 162
Compare Logical Greater Than Byte ……………………………………………………………………………. 163
Compare Logical Greater Than Byte Immediate ……………………………………………………………. 164
Compare Logical Greater Than Halfword ……………………………………………………………………… 165
Compare Logical Greater Than Halfword Immediate ……………………………………………………… 166
Compare Logical Greater Than Word ………………………………………………………………………….. 167
Compare Logical Greater Than Word Immediate …………………………………………………………… 168
Branch Relative ………………………………………………………………………………………………………… 169
Branch Absolute ……………………………………………………………………………………………………….. 170
Branch Relative and Set Link ……………………………………………………………………………………… 171
Branch Absolute and Set Link …………………………………………………………………………………….. 172
Branch Indirect …………………………………………………………………………………………………………. 173
Interrupt Return ………………………………………………………………………………………………………… 174
Branch Indirect and Set Link if External Data ………………………………………………………………… 175
Branch Indirect and Set Link ………………………………………………………………………………………. 176
Branch If Not Zero Word …………………………………………………………………………………………….. 177
Branch If Zero Word ………………………………………………………………………………………………….. 178
Branch If Not Zero Halfword ……………………………………………………………………………………….. 179
Branch If Zero Halfword ……………………………………………………………………………………………… 180
Branch Indirect If Zero ……………………………………………………………………………………………….. 181
Branch Indirect If Not Zero …………………………………………………………………………………………. 182
Branch Indirect If Zero Halfword ………………………………………………………………………………….. 183
Branch Indirect If Not Zero Halfword ……………………………………………………………………………. 184
8. Hint-for-Branch Instructions ………………………………………………………………………. 185
Hint for Branch (r-form) ………………………………………………………………………………………………. 186
Hint for Branch (a-form) ……………………………………………………………………………………………… 187
Hint for Branch Relative ……………………………………………………………………………………………… 188
9. Floating-Point Instructions …………………………………………………………………………. 189
9.1 Single Precision (Extended-Range Mode) ………………………………………………………………………… 189
9.2 Double Precision …………………………………………………………………………………………………………… 190
9.2.1 Conversions Between Single and Double-Precision Format ……………………………………….. 191
9.2.2 Exception Conditions …………………………………………………………………………………………….. 191
9.3 Floating-Point Status and Control Register (FPSCR) …………………………………………………………. 193
Floating Add …………………………………………………………………………………………………………….. 195
Double Floating Add ………………………………………………………………………………………………….. 196
Floating Subtract ………………………………………………………………………………………………………. 197
Double Floating Subtract ……………………………………………………………………………………………. 198
Floating Multiply ………………………………………………………………………………………………………… 199
Double Floating Multiply …………………………………………………………………………………………….. 200
Instruction Set Architecture
Synergistic Processor Unit
Version 1.0
August 1, 2005
Contents
Page 7 of 257
Floating Multiply and Add …………………………………………………………………………………………… 201
Double Floating Multiply and Add ………………………………………………………………………………… 202
Floating Negative Multiply and Subtract ……………………………………………………………………….. 203
Double Floating Negative Multiply and Subtract ……………………………………………………………. 204
Floating Multiply and Subtract …………………………………………………………………………………….. 205
Double Floating Multiply and Subtract ………………………………………………………………………….. 206
Double Floating Negative Multiply and Add ………………………………………………………………….. 207
Floating Reciprocal Estimate ………………………………………………………………………………………. 208
Floating Reciprocal Absolute Square Root Estimate ……………………………………………………… 210
Floating Interpolate ……………………………………………………………………………………………………. 212
Convert Signed Integer to Floating ………………………………………………………………………………. 213
Convert Floating to Signed Integer ………………………………………………………………………………. 214
Convert Unsigned Integer to Floating …………………………………………………………………………… 215
Convert Floating to Unsigned Integer …………………………………………………………………………… 216
Floating Round Double to Single …………………………………………………………………………………. 217
Floating Extend Single to Double ………………………………………………………………………………… 218
Floating Compare Equal …………………………………………………………………………………………….. 219
Floating Compare Magnitude Equal …………………………………………………………………………….. 220
Floating Compare Greater Than …………………………………………………………………………………. 221
Floating Compare Magnitude Greater Than ………………………………………………………………….. 222
Floating-Point Status and Control Register Write …………………………………………………………… 223
Floating-Point Status and Control Register Read ………………………………………………………….. 224
10. Control Instructions …………………………………………………………………………………. 225
Stop and Signal ………………………………………………………………………………………………………… 226
Stop and Signal with Dependencies …………………………………………………………………………….. 227
No Operation (Load) ………………………………………………………………………………………………….. 228
No Operation (Execute) ……………………………………………………………………………………………… 229
Synchronize ……………………………………………………………………………………………………………… 230
Synchronize Data ……………………………………………………………………………………………………… 231
Move from Special-Purpose Register …………………………………………………………………………… 232
Move to Special-Purpose Register ………………………………………………………………………………. 233
11. Channel Instructions ……………………………………………………………………………….. 234
Read Channel ………………………………………………………………………………………………………….. 235
Read Channel Count …………………………………………………………………………………………………. 236
Write Channel …………………………………………………………………………………………………………… 237
12. SPU Interrupt Facility ………………………………………………………………………………. 238
12.1 SPU Interrupt Handler ………………………………………………………………………………………………….. 238
12.2 SPU Interrupt Facility Channels …………………………………………………………………………………….. 239
13. Synchronization and Ordering …………………………………………………………………. 240
13.1 Speculation, Reordering, and Caching SPU Local Store Access ……………………………………….. 241
13.2 Internal Execution State ……………………………………………………………………………………………….. 241
13.3 Synchronization Primitives ……………………………………………………………………………………………. 241
13.4 Caching SPU Local Store Access ………………………………………………………………………………….. 242
13.5 Self-Modifying Code …………………………………………………………………………………………………….. 243
13.6 External Local Store Access …………………………………………………………………………………………. 243
Instruction Set Architecture
Synergistic Processor Unit
Contents
Page 8 of 257
Version 1.0
August 1, 2005
13.7 Speculation and Reordering of Channel Reads and Channel Writes ………………………………….. 244
13.8 Channel Interface with External Device ………………………………………………………………………….. 244
13.9 Execution State Set by an SPU Program through the Channel Interface …………………………….. 244
13.10 Execution State Set by an External Device ……………………………………………………………………. 245
Appendix A. Programming Examples …………………………………………………………….. 247
A.1 Conversion from Single Precision to Double Precision ……………………………………………………….. 247
A.2 Conversion from Double Precision to Single Precision ……………………………………………………….. 248
Appendix B. Instruction Table Sorted by Instruction Mnemonic ………………………. 249
Appendix C. Details of the Compute-Mask Instructions …………………………………… 255
Revision Log …………………………………………………………………………………………………. 257

Grátis – DOWNLOAD
SIGMA Co. 🇧🇷

SIGMA Co. 🇧🇷