1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 2 /* SPU ELF support for BFD. 3 4 Copyright 2006 Free Software Foundation, In 5 6 This file is part of BFD, the Binary File D 7 8 */ 9 10 /* SPU Opcode Table 11 12 -=-=-= FORMAT =-=-=- 13 14 +----+-------+-------+-------+-------+ 15 RRR | op | RC | RB | RA | RT | 16 +----+-------+-------+-------+-------+ 17 0 3 1 1 2 3 18 0 7 4 1 19 20 +-----------+--------+-------+-------+ 21 RI8 | op | I8 | RA | RT | 22 +-----------+--------+-------+-------+ 23 0 9 1 2 3 24 7 4 1 25 26 +----------+-----------------+-------+ 27 RI16 | op | I16 | RT | 28 +----------+-----------------+-------+ 29 0 8 2 3 30 4 1 31 32 +------------+-------+-------+-------+ 33 RR | op | RB | RA | RT | 34 +------------+-------+-------+-------+ 35 0 1 1 2 3 36 0 7 4 1 37 38 39 40 41 42 43 44 -=-=-= OPCODE =-=-=- 45 46 OPCODE field specifies the most significant 11 47 case, bit field other than op are defined as 0 48 since 0x700 -> 11'b11100000000, this means opc 49 50 -=-=-= ASM_FORMAT =-=-=- 51 52 RRR category 53 ASM_RRR mnemonic RC, RA, RB, R 54 55 56 RI8 category 57 ASM_RUI8 mnemonic RT, RA, UI8 58 59 60 61 RI16 category 62 ASM_I16W mnemonic I16W 63 ASM_RI16 mnemonic RT, I16 64 ASM_RI16W mnemonic RT, I16W 65 66 RR category 67 ASM_MFSPR mnemonic RT, SA 68 ASM_MTSPR mnemonic SA, RT 69 ASM_NOOP mnemonic 70 ASM_RA mnemonic RA 71 ASM_RAB mnemonic RA, RB 72 ASM_RDCH mnemonic RT, CA 73 ASM_RR mnemonic RT, RA, RB 74 ASM_RT mnemonic RT 75 ASM_RTA mnemonic RT, RA 76 ASM_WRCH mnemonic CA, RT 77 78 Note that RRR instructions have the names for 79 what's in the ISA, in order to put RT in the s 80 for other formats. 81 82 -=-=-= DEPENDENCY =-=-=- 83 84 DEPENDENCY filed consists of 5 digits. This re 85 The first(most significant) digit is always 0. 86 If the digit is 0, this means the correspondin 87 If the digit is 1, this means the correspondin 88 If the digit is 2, this means the correspondin 89 If the digit is 3, this means the correspondin 90 For example, fms instruction has 00113 as the 91 used as sources and RT is the target. 92 93 -=-=-= PIPE =-=-=- 94 95 This field shows which execution pipe is used 96 97 pipe0 execution pipelines: 98 FP6 SP floating pipeline 99 FP7 integer operations executed in 100 FPD DP floating pipeline 101 FX2 FXU pipeline 102 FX3 Rotate/Shift pipeline 103 FXB Byte pipeline 104 NOP No pipeline 105 106 pipe1 execution pipelines: 107 BR Branch pipeline 108 LNOP No pipeline 109 LS Load/Store pipeline 110 SHUF Shuffle pipeline 111 SPR SPR/CH pipeline 112 113 */ 114 115 #define _A0() {0} 116 #define _A1(a) {1,a} 117 #define _A2(a,b) {2,a,b} 118 #define _A3(a,b,c) {3,a,b,c} 119 #define _A4(a,b,c,d) {4,a,b,c,d} 120 121 /* TAG FORMAT OPCODE MNEMON 122 /* 123 /* 124 125 APUOP(M_BR, RI16, 0x190, "br", 126 APUOP(M_BRSL, RI16, 0x198, "brsl" 127 APUOP(M_BRA, RI16, 0x180, "bra", 128 APUOP(M_BRASL, RI16, 0x188, "brasl 129 APUOP(M_FSMBI, RI16, 0x194, "fsmbi 130 APUOP(M_LQA, RI16, 0x184, "lqa", 131 APUOP(M_LQR, RI16, 0x19C, "lqr", 132 APUOP(M_STOP, RR, 0x000, "stop" 133 APUOP(M_STOP2, RR, 0x000, "stop" 134 APUOP(M_STOPD, RR, 0x140, "stopd 135 APUOP(M_LNOP, RR, 0x001, "lnop" 136 APUOP(M_SYNC, RR, 0x002, "sync" 137 APUOP(M_DSYNC, RR, 0x003, "dsync 138 APUOP(M_MFSPR, RR, 0x00c, "mfspr 139 APUOP(M_RDCH, RR, 0x00d, "rdch" 140 APUOP(M_RCHCNT, RR, 0x00f, "rchcn 141 APUOP(M_HBRA, LBT, 0x080, "hbra" 142 APUOP(M_HBRR, LBT, 0x090, "hbrr" 143 APUOP(M_BRZ, RI16, 0x100, "brz", 144 APUOP(M_BRNZ, RI16, 0x108, "brnz" 145 APUOP(M_BRHZ, RI16, 0x110, "brhz" 146 APUOP(M_BRHNZ, RI16, 0x118, "brhnz 147 APUOP(M_STQA, RI16, 0x104, "stqa" 148 APUOP(M_STQR, RI16, 0x11C, "stqr" 149 APUOP(M_MTSPR, RR, 0x10c, "mtspr 150 APUOP(M_WRCH, RR, 0x10d, "wrch" 151 APUOP(M_LQD, RI10, 0x1a0, "lqd", 152 APUOP(M_BI, RR, 0x1a8, "bi", 153 APUOP(M_BISL, RR, 0x1a9, "bisl" 154 APUOP(M_IRET, RR, 0x1aa, "iret" 155 APUOP(M_IRET2, RR, 0x1aa, "iret" 156 APUOP(M_BISLED, RR, 0x1ab, "bisle 157 APUOP(M_HBR, LBTI, 0x1ac, "hbr", 158 APUOP(M_FREST, RR, 0x1b8, "frest 159 APUOP(M_FRSQEST, RR, 0x1b9, "frsqe 160 APUOP(M_FSM, RR, 0x1b4, "fsm", 161 APUOP(M_FSMH, RR, 0x1b5, "fsmh" 162 APUOP(M_FSMB, RR, 0x1b6, "fsmb" 163 APUOP(M_GB, RR, 0x1b0, "gb", 164 APUOP(M_GBH, RR, 0x1b1, "gbh", 165 APUOP(M_GBB, RR, 0x1b2, "gbb", 166 APUOP(M_CBD, RI7, 0x1f4, "cbd", 167 APUOP(M_CHD, RI7, 0x1f5, "chd", 168 APUOP(M_CWD, RI7, 0x1f6, "cwd", 169 APUOP(M_CDD, RI7, 0x1f7, "cdd", 170 APUOP(M_ROTQBII, RI7, 0x1f8, "rotqb 171 APUOP(M_ROTQBYI, RI7, 0x1fc, "rotqb 172 APUOP(M_ROTQMBII, RI7, 0x1f9, "rotqm 173 APUOP(M_ROTQMBYI, RI7, 0x1fd, "rotqm 174 APUOP(M_SHLQBII, RI7, 0x1fb, "shlqb 175 APUOP(M_SHLQBYI, RI7, 0x1ff, "shlqb 176 APUOP(M_STQD, RI10, 0x120, "stqd" 177 APUOP(M_BIHNZ, RR, 0x12b, "bihnz 178 APUOP(M_BIHZ, RR, 0x12a, "bihz" 179 APUOP(M_BINZ, RR, 0x129, "binz" 180 APUOP(M_BIZ, RR, 0x128, "biz", 181 APUOP(M_CBX, RR, 0x1d4, "cbx", 182 APUOP(M_CHX, RR, 0x1d5, "chx", 183 APUOP(M_CWX, RR, 0x1d6, "cwx", 184 APUOP(M_CDX, RR, 0x1d7, "cdx", 185 APUOP(M_LQX, RR, 0x1c4, "lqx", 186 APUOP(M_ROTQBI, RR, 0x1d8, "rotqb 187 APUOP(M_ROTQMBI, RR, 0x1d9, "rotqm 188 APUOP(M_SHLQBI, RR, 0x1db, "shlqb 189 APUOP(M_ROTQBY, RR, 0x1dc, "rotqb 190 APUOP(M_ROTQMBY, RR, 0x1dd, "rotqm 191 APUOP(M_SHLQBY, RR, 0x1df, "shlqb 192 APUOP(M_ROTQBYBI, RR, 0x1cc, "rotqb 193 APUOP(M_ROTQMBYBI, RR, 0x1cd, "rotqm 194 APUOP(M_SHLQBYBI, RR, 0x1cf, "shlqb 195 APUOP(M_STQX, RR, 0x144, "stqx" 196 APUOP(M_SHUFB, RRR, 0x580, "shufb 197 APUOP(M_IL, RI16, 0x204, "il", 198 APUOP(M_ILH, RI16, 0x20c, "ilh", 199 APUOP(M_ILHU, RI16, 0x208, "ilhu" 200 APUOP(M_ILA, RI18, 0x210, "ila", 201 APUOP(M_NOP, RR, 0x201, "nop", 202 APUOP(M_NOP2, RR, 0x201, "nop", 203 APUOP(M_IOHL, RI16, 0x304, "iohl" 204 APUOP(M_ANDBI, RI10, 0x0b0, "andbi 205 APUOP(M_ANDHI, RI10, 0x0a8, "andhi 206 APUOP(M_ANDI, RI10, 0x0a0, "andi" 207 APUOP(M_ORBI, RI10, 0x030, "orbi" 208 APUOP(M_ORHI, RI10, 0x028, "orhi" 209 APUOP(M_ORI, RI10, 0x020, "ori", 210 APUOP(M_ORX, RR, 0x1f0, "orx", 211 APUOP(M_XORBI, RI10, 0x230, "xorbi 212 APUOP(M_XORHI, RI10, 0x228, "xorhi 213 APUOP(M_XORI, RI10, 0x220, "xori" 214 APUOP(M_AHI, RI10, 0x0e8, "ahi", 215 APUOP(M_AI, RI10, 0x0e0, "ai", 216 APUOP(M_SFHI, RI10, 0x068, "sfhi" 217 APUOP(M_SFI, RI10, 0x060, "sfi", 218 APUOP(M_CGTBI, RI10, 0x270, "cgtbi 219 APUOP(M_CGTHI, RI10, 0x268, "cgthi 220 APUOP(M_CGTI, RI10, 0x260, "cgti" 221 APUOP(M_CLGTBI, RI10, 0x2f0, "clgtb 222 APUOP(M_CLGTHI, RI10, 0x2e8, "clgth 223 APUOP(M_CLGTI, RI10, 0x2e0, "clgti 224 APUOP(M_CEQBI, RI10, 0x3f0, "ceqbi 225 APUOP(M_CEQHI, RI10, 0x3e8, "ceqhi 226 APUOP(M_CEQI, RI10, 0x3e0, "ceqi" 227 APUOP(M_HGTI, RI10, 0x278, "hgti" 228 APUOP(M_HGTI2, RI10, 0x278, "hgti" 229 APUOP(M_HLGTI, RI10, 0x2f8, "hlgti 230 APUOP(M_HLGTI2, RI10, 0x2f8, "hlgti 231 APUOP(M_HEQI, RI10, 0x3f8, "heqi" 232 APUOP(M_HEQI2, RI10, 0x3f8, "heqi" 233 APUOP(M_MPYI, RI10, 0x3a0, "mpyi" 234 APUOP(M_MPYUI, RI10, 0x3a8, "mpyui 235 APUOP(M_CFLTS, RI8, 0x3b0, "cflts 236 APUOP(M_CFLTU, RI8, 0x3b2, "cfltu 237 APUOP(M_CSFLT, RI8, 0x3b4, "csflt 238 APUOP(M_CUFLT, RI8, 0x3b6, "cuflt 239 APUOP(M_FESD, RR, 0x3b8, "fesd" 240 APUOP(M_FRDS, RR, 0x3b9, "frds" 241 APUOP(M_FSCRRD, RR, 0x398, "fscrr 242 APUOP(M_FSCRWR, RR, 0x3ba, "fscrw 243 APUOP(M_FSCRWR2, RR, 0x3ba, "fscrw 244 APUOP(M_CLZ, RR, 0x2a5, "clz", 245 APUOP(M_CNTB, RR, 0x2b4, "cntb" 246 APUOP(M_XSBH, RR, 0x2b6, "xsbh" 247 APUOP(M_XSHW, RR, 0x2ae, "xshw" 248 APUOP(M_XSWD, RR, 0x2a6, "xswd" 249 APUOP(M_ROTI, RI7, 0x078, "roti" 250 APUOP(M_ROTMI, RI7, 0x079, "rotmi 251 APUOP(M_ROTMAI, RI7, 0x07a, "rotma 252 APUOP(M_SHLI, RI7, 0x07b, "shli" 253 APUOP(M_ROTHI, RI7, 0x07c, "rothi 254 APUOP(M_ROTHMI, RI7, 0x07d, "rothm 255 APUOP(M_ROTMAHI, RI7, 0x07e, "rotma 256 APUOP(M_SHLHI, RI7, 0x07f, "shlhi 257 APUOP(M_A, RR, 0x0c0, "a", 258 APUOP(M_AH, RR, 0x0c8, "ah", 259 APUOP(M_SF, RR, 0x040, "sf", 260 APUOP(M_SFH, RR, 0x048, "sfh", 261 APUOP(M_CGT, RR, 0x240, "cgt", 262 APUOP(M_CGTB, RR, 0x250, "cgtb" 263 APUOP(M_CGTH, RR, 0x248, "cgth" 264 APUOP(M_CLGT, RR, 0x2c0, "clgt" 265 APUOP(M_CLGTB, RR, 0x2d0, "clgtb 266 APUOP(M_CLGTH, RR, 0x2c8, "clgth 267 APUOP(M_CEQ, RR, 0x3c0, "ceq", 268 APUOP(M_CEQB, RR, 0x3d0, "ceqb" 269 APUOP(M_CEQH, RR, 0x3c8, "ceqh" 270 APUOP(M_HGT, RR, 0x258, "hgt", 271 APUOP(M_HGT2, RR, 0x258, "hgt", 272 APUOP(M_HLGT, RR, 0x2d8, "hlgt" 273 APUOP(M_HLGT2, RR, 0x2d8, "hlgt" 274 APUOP(M_HEQ, RR, 0x3d8, "heq", 275 APUOP(M_HEQ2, RR, 0x3d8, "heq", 276 APUOP(M_FCEQ, RR, 0x3c2, "fceq" 277 APUOP(M_FCMEQ, RR, 0x3ca, "fcmeq 278 APUOP(M_FCGT, RR, 0x2c2, "fcgt" 279 APUOP(M_FCMGT, RR, 0x2ca, "fcmgt 280 APUOP(M_AND, RR, 0x0c1, "and", 281 APUOP(M_NAND, RR, 0x0c9, "nand" 282 APUOP(M_OR, RR, 0x041, "or", 283 APUOP(M_NOR, RR, 0x049, "nor", 284 APUOP(M_XOR, RR, 0x241, "xor", 285 APUOP(M_EQV, RR, 0x249, "eqv", 286 APUOP(M_ANDC, RR, 0x2c1, "andc" 287 APUOP(M_ORC, RR, 0x2c9, "orc", 288 APUOP(M_ABSDB, RR, 0x053, "absdb 289 APUOP(M_AVGB, RR, 0x0d3, "avgb" 290 APUOP(M_SUMB, RR, 0x253, "sumb" 291 APUOP(M_DFA, RR, 0x2cc, "dfa", 292 APUOP(M_DFM, RR, 0x2ce, "dfm", 293 APUOP(M_DFS, RR, 0x2cd, "dfs", 294 APUOP(M_FA, RR, 0x2c4, "fa", 295 APUOP(M_FM, RR, 0x2c6, "fm", 296 APUOP(M_FS, RR, 0x2c5, "fs", 297 APUOP(M_MPY, RR, 0x3c4, "mpy", 298 APUOP(M_MPYH, RR, 0x3c5, "mpyh" 299 APUOP(M_MPYHH, RR, 0x3c6, "mpyhh 300 APUOP(M_MPYHHU, RR, 0x3ce, "mpyhh 301 APUOP(M_MPYS, RR, 0x3c7, "mpys" 302 APUOP(M_MPYU, RR, 0x3cc, "mpyu" 303 APUOP(M_FI, RR, 0x3d4, "fi", 304 APUOP(M_ROT, RR, 0x058, "rot", 305 APUOP(M_ROTM, RR, 0x059, "rotm" 306 APUOP(M_ROTMA, RR, 0x05a, "rotma 307 APUOP(M_SHL, RR, 0x05b, "shl", 308 APUOP(M_ROTH, RR, 0x05c, "roth" 309 APUOP(M_ROTHM, RR, 0x05d, "rothm 310 APUOP(M_ROTMAH, RR, 0x05e, "rotma 311 APUOP(M_SHLH, RR, 0x05f, "shlh" 312 APUOP(M_MPYHHA, RR, 0x346, "mpyhh 313 APUOP(M_MPYHHAU, RR, 0x34e, "mpyhh 314 APUOP(M_DFMA, RR, 0x35c, "dfma" 315 APUOP(M_DFMS, RR, 0x35d, "dfms" 316 APUOP(M_DFNMS, RR, 0x35e, "dfnms 317 APUOP(M_DFNMA, RR, 0x35f, "dfnma 318 APUOP(M_FMA, RRR, 0x700, "fma", 319 APUOP(M_FMS, RRR, 0x780, "fms", 320 APUOP(M_FNMS, RRR, 0x680, "fnms" 321 APUOP(M_MPYA, RRR, 0x600, "mpya" 322 APUOP(M_SELB, RRR, 0x400, "selb" 323 /* for system function call, this uses op-code 324 APUOP(M_SYSCALL, RI7, 0x10c, "sysca 325 /* 326 pseudo instruction: 327 system call 328 value of I9 operation 329 0 halt 330 1 rt[0] = open(MEM[ra[0]], 331 2 rt[0] = close(ra[0]) 332 3 rt[0] = read(ra[0], MEM[ra 333 4 rt[0] = write(ra[0], MEM[ra 334 5 printf(MEM[ra[0]], ra[1], 335 42 rt[0] = clock() 336 52 rt[0] = lseek(ra0, ra1, 337 338 */ 339 340 341 /* new multiprecision add/sub */ 342 APUOP(M_ADDX, RR, 0x340, "addx" 343 APUOP(M_CG, RR, 0x0c2, "cg", 344 APUOP(M_CGX, RR, 0x342, "cgx", 345 APUOP(M_SFX, RR, 0x341, "sfx", 346 APUOP(M_BG, RR, 0x042, "bg", 347 APUOP(M_BGX, RR, 0x343, "bgx", 348 349 /* 350 351 The following ops are a subset of above except 352 Feature bits are bits 11-17 of the instruction 353 354 11 - C & P feature bit 355 12 - disable interrupts 356 13 - enable interrupts 357 358 */ 359 APUOPFB(M_BID, RR, 0x1a8, 0x20, 360 APUOPFB(M_BIE, RR, 0x1a8, 0x10, 361 APUOPFB(M_BISLD, RR, 0x1a9, 0x20, 362 APUOPFB(M_BISLE, RR, 0x1a9, 0x10, 363 APUOPFB(M_IRETD, RR, 0x1aa, 0x20, 364 APUOPFB(M_IRETD2, RR, 0x1aa, 0x20, 365 APUOPFB(M_IRETE, RR, 0x1aa, 0x10, 366 APUOPFB(M_IRETE2, RR, 0x1aa, 0x10, 367 APUOPFB(M_BISLEDD, RR, 0x1ab, 0x20, 368 APUOPFB(M_BISLEDE, RR, 0x1ab, 0x10, 369 APUOPFB(M_BIHNZD, RR, 0x12b, 0x20, 370 APUOPFB(M_BIHNZE, RR, 0x12b, 0x10, 371 APUOPFB(M_BIHZD, RR, 0x12a, 0x20, 372 APUOPFB(M_BIHZE, RR, 0x12a, 0x10, 373 APUOPFB(M_BINZD, RR, 0x129, 0x20, 374 APUOPFB(M_BINZE, RR, 0x129, 0x10, 375 APUOPFB(M_BIZD, RR, 0x128, 0x20, 376 APUOPFB(M_BIZE, RR, 0x128, 0x10, 377 APUOPFB(M_SYNCC, RR, 0x002, 0x40, 378 APUOPFB(M_HBRP, LBTI, 0x1ac, 0x40, 379 380 /* Synonyms required by the AS manual. */ 381 APUOP(M_LR, RI10, 0x020, "lr", 382 APUOP(M_BIHT, RR, 0x12b, "biht" 383 APUOP(M_BIHF, RR, 0x12a, "bihf" 384 APUOP(M_BIT, RR, 0x129, "bit", 385 APUOP(M_BIF, RR, 0x128, "bif", 386 APUOPFB(M_BIHTD, RR, 0x12b, 0x20, 387 APUOPFB(M_BIHTE, RR, 0x12b, 0x10, 388 APUOPFB(M_BIHFD, RR, 0x12a, 0x20, 389 APUOPFB(M_BIHFE, RR, 0x12a, 0x10, 390 APUOPFB(M_BITD, RR, 0x129, 0x20, 391 APUOPFB(M_BITE, RR, 0x129, 0x10, 392 APUOPFB(M_BIFD, RR, 0x128, 0x20, 393 APUOPFB(M_BIFE, RR, 0x128, 0x10, 394 395 #undef _A0 396 #undef _A1 397 #undef _A2 398 #undef _A3 399 #undef _A4 400
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.