Back to index

cell-binutils  2.17cvs20070401
pn.h
Go to the documentation of this file.
00001 /* Print GOULD PN (PowerNode) instructions for GDB, the GNU debugger.
00002    Copyright 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
00003 
00004 This file is part of GDB.
00005 
00006 GDB is free software; you can redistribute it and/or modify
00007 it under the terms of the GNU General Public License as published by
00008 the Free Software Foundation; either version 1, or (at your option)
00009 any later version.
00010 
00011 GDB is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License
00017 along with GDB; see the file COPYING.  If not, write to
00018 the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 struct gld_opcode
00021 {
00022   char *name;
00023   unsigned long opcode;
00024   unsigned long mask;
00025   char *args;
00026   int length;
00027 };
00028 
00029 /* We store four bytes of opcode for all opcodes because that
00030    is the most any of them need.  The actual length of an instruction
00031    is always at least 2 bytes, and at most four.  The length of the
00032    instruction is based on the opcode.
00033 
00034    The mask component is a mask saying which bits must match
00035    particular opcode in order for an instruction to be an instance
00036    of that opcode.
00037 
00038    The args component is a string containing characters
00039    that are used to format the arguments to the instruction. */
00040 
00041 /* Kinds of operands:
00042    r  Register in first field
00043    R  Register in second field
00044    b  Base register in first field
00045    B  Base register in second field
00046    v  Vector register in first field
00047    V  Vector register in first field
00048    A  Optional address register (base register)
00049    X  Optional index register
00050    I  Immediate data (16bits signed)
00051    O  Offset field (16bits signed)
00052    h  Offset field (15bits signed)
00053    d  Offset field (14bits signed)
00054    S  Shift count field
00055 
00056    any other characters are printed as is...
00057 */
00058 
00059 /* The assembler requires that this array be sorted as follows:
00060    all instances of the same mnemonic must be consecutive.
00061    All instances of the same mnemonic with the same number of operands
00062    must be consecutive.
00063  */
00064 struct gld_opcode gld_opcodes[] =
00065 {
00066 { "abm",      0xa0080000,   0xfc080000,   "f,xOA,X",    4 },
00067 { "abr",      0x18080000,   0xfc0c0000,   "r,f",        2 },
00068 { "aci",      0xfc770000,   0xfc7f8000,   "r,I",        4 },
00069 { "adfd",     0xe0080002,   0xfc080002,   "r,xOA,X",    4 },
00070 { "adfw",     0xe0080000,   0xfc080000,   "r,xOA,X",    4 },
00071 { "adi",      0xc8010000,   0xfc7f0000,   "r,I",        4 },
00072 { "admb",     0xb8080000,   0xfc080000,   "r,xOA,X",    4 },
00073 { "admd",     0xb8000002,   0xfc080002,   "r,xOA,X",    4 },
00074 { "admh",     0xb8000001,   0xfc080001,   "r,xOA,X",    4 },
00075 { "admw",     0xb8000000,   0xfc080000,   "r,xOA,X",    4 },
00076 { "adr",      0x38000000,   0xfc0f0000,   "r,R",        2 },
00077 { "adrfd",    0x38090000,   0xfc0f0000,   "r,R",        2 },
00078 { "adrfw",    0x38010000,   0xfc0f0000,   "r,R",        2 },
00079 { "adrm",     0x38080000,   0xfc0f0000,   "r,R",        2 },
00080 { "ai",       0xfc030000,   0xfc07ffff,   "I",          4 },
00081 { "anmb",     0x84080000,   0xfc080000,   "r,xOA,X",    4 },
00082 { "anmd",     0x84000002,   0xfc080002,   "r,xOA,X",    4 },
00083 { "anmh",     0x84000001,   0xfc080001,   "r,xOA,X",    4 },
00084 { "anmw",     0x84000000,   0xfc080000,   "r,xOA,X",    4 },
00085 { "anr",      0x04000000,   0xfc0f0000,   "r,R",        2 },
00086 { "armb",     0xe8080000,   0xfc080000,   "r,xOA,X",    4 },
00087 { "armd",     0xe8000002,   0xfc080002,   "r,xOA,X",    4 },
00088 { "armh",     0xe8000001,   0xfc080001,   "r,xOA,X",    4 },
00089 { "armw",     0xe8000000,   0xfc080000,   "r,xOA,X",    4 },
00090 { "bcf",      0xf0000000,   0xfc080000,   "I,xOA,X",    4 },
00091 { "bct",      0xec000000,   0xfc080000,   "I,xOA,X",    4 },
00092 { "bei",      0x00060000,   0xffff0000,   "",           2 },
00093 { "bft",      0xf0000000,   0xff880000,   "xOA,X",      4 },
00094 { "bib",      0xf4000000,   0xfc780000,   "r,xOA",      4 },
00095 { "bid",      0xf4600000,   0xfc780000,   "r,xOA",      4 },
00096 { "bih",      0xf4200000,   0xfc780000,   "r,xOA",      4 },
00097 { "biw",      0xf4400000,   0xfc780000,   "r,xOA",      4 },
00098 { "bl",       0xf8800000,   0xff880000,   "xOA,X",      4 },
00099 { "bsub",     0x5c080000,   0xff8f0000,   "",           2 },
00100 { "bsubm",    0x28080000,   0xfc080000,   "",           4 },
00101 { "bu",       0xec000000,   0xff880000,   "xOA,X",      4 },
00102 { "call",     0x28080000,   0xfc0f0000,   "",           2 },
00103 { "callm",    0x5c080000,   0xff880000,   "",           4 },
00104 { "camb",     0x90080000,   0xfc080000,   "r,xOA,X",    4 },
00105 { "camd",     0x90000002,   0xfc080002,   "r,xOA,X",    4 },
00106 { "camh",     0x90000001,   0xfc080001,   "r,xOA,X",    4 },
00107 { "camw",     0x90000000,   0xfc080000,   "r.xOA,X",    4 },
00108 { "car",      0x10000000,   0xfc0f0000,   "r,R",        2 },
00109 { "cd",       0xfc060000,   0xfc070000,   "r,f",        4 },
00110 { "cea",      0x000f0000,   0xffff0000,   "",           2 },
00111 { "ci",       0xc8050000,   0xfc7f0000,   "r,I",        4 },
00112 { "cmc",      0x040a0000,   0xfc7f0000,   "r",          2 },
00113 { "cmmb",     0x94080000,   0xfc080000,   "r,xOA,X",    4 },
00114 { "cmmd",     0x94000002,   0xfc080002,   "r,xOA,X",    4 },
00115 { "cmmh",     0x94000001,   0xfc080001,   "r,xOA,X",    4 },
00116 { "cmmw",     0x94000000,   0xfc080000,   "r,xOA,X",    4 },
00117 { "cmr",      0x14000000,   0xfc0f0000,   "r,R",        2 },
00118 { "daci",     0xfc7f0000,   0xfc7f8000,   "r,I",        4 },
00119 { "dae",      0x000e0000,   0xffff0000,   "",           2 },
00120 { "dai",      0xfc040000,   0xfc07ffff,   "I",          4 },
00121 { "dci",      0xfc6f0000,   0xfc7f8000,   "r,I",        4 },
00122 { "di",       0xfc010000,   0xfc07ffff,   "I",          4 },
00123 { "dvfd",     0xe4000002,   0xfc080002,   "r,xOA,X",    4 },
00124 { "dvfw",     0xe4000000,   0xfc080000,   "r,xOA,X",    4 },
00125 { "dvi",      0xc8040000,   0xfc7f0000,   "r,I",        4 },
00126 { "dvmb",     0xc4080000,   0xfc080000,   "r,xOA,X",    4 },
00127 { "dvmh",     0xc4000001,   0xfc080001,   "r,xOA,X",    4 },
00128 { "dvmw",     0xc4000000,   0xfc080000,   "r,xOA,X",    4 },
00129 { "dvr",      0x380a0000,   0xfc0f0000,   "r,R",        2 },
00130 { "dvrfd",    0x380c0000,   0xfc0f0000,   "r,R",        4 },
00131 { "dvrfw",    0x38040000,   0xfc0f0000,   "r,xOA,X",    4 },
00132 { "eae",      0x00080000,   0xffff0000,   "",           2 },
00133 { "eci",      0xfc670000,   0xfc7f8080,   "r,I",        4 },
00134 { "ecwcs",    0xfc4f0000,   0xfc7f8000,   "",           4 },
00135 { "ei",       0xfc000000,   0xfc07ffff,   "I",          4 },
00136 { "eomb",     0x8c080000,   0xfc080000,   "r,xOA,X",    4 },
00137 { "eomd",     0x8c000002,   0xfc080002,   "r,xOA,X",    4 },
00138 { "eomh",     0x8c000001,   0xfc080001,   "r,xOA,X",    4 },
00139 { "eomw",     0x8c000000,   0xfc080000,   "r,xOA,X",    4 },
00140 { "eor",      0x0c000000,   0xfc0f0000,   "r,R",        2 },
00141 { "eorm",     0x0c080000,   0xfc0f0000,   "r,R",        2 },
00142 { "es",       0x00040000,   0xfc7f0000,   "r",          2 },
00143 { "exm",      0xa8000000,   0xff880000,   "xOA,X",      4 },
00144 { "exr",      0xc8070000,   0xfc7f0000,   "r",          2 },
00145 { "exrr",     0xc8070002,   0xfc7f0002,   "r",          2 },
00146 { "fixd",     0x380d0000,   0xfc0f0000,   "r,R",        2 },
00147 { "fixw",     0x38050000,   0xfc0f0000,   "r,R",        2 },
00148 { "fltd",     0x380f0000,   0xfc0f0000,   "r,R",        2 },
00149 { "fltw",     0x38070000,   0xfc0f0000,   "r,R",        2 },
00150 { "grio",     0xfc3f0000,   0xfc7f8000,   "r,I",        4 },
00151 { "halt",     0x00000000,   0xffff0000,   "",           2 },
00152 { "hio",      0xfc370000,   0xfc7f8000,   "r,I",        4 },
00153 { "jwcs",     0xfa080000,   0xff880000,   "xOA,X",      4 },
00154 { "la",       0x50000000,   0xfc000000,   "r,xOA,X",    4 },
00155 { "labr",     0x58080000,   0xfc080000,   "b,xOA,X",    4 },
00156 { "lb",       0xac080000,   0xfc080000,   "r,xOA,X",    4 },
00157 { "lcs",      0x00030000,   0xfc7f0000,   "r",          2 },
00158 { "ld",       0xac000002,   0xfc080002,   "r,xOA,X",    4 },
00159 { "lear",     0x80000000,   0xfc080000,   "r,xOA,X",    4 },
00160 { "lf",       0xcc000000,   0xfc080000,   "r,xOA,X",    4 },
00161 { "lfbr",     0xcc080000,   0xfc080000,   "b,xOA,X",    4 },
00162 { "lh",       0xac000001,   0xfc080001,   "r,xOA,X",    4 },
00163 { "li",       0xc8000000,   0xfc7f0000,   "r,I",        4 },
00164 { "lmap",     0x2c070000,   0xfc7f0000,   "r",          2 },
00165 { "lmb",      0xb0080000,   0xfc080000,   "r,xOA,X",    4 },
00166 { "lmd",      0xb0000002,   0xfc080002,   "r,xOA,X",    4 },
00167 { "lmh",      0xb0000001,   0xfc080001,   "r,xOA,X",    4 },
00168 { "lmw",      0xb0000000,   0xfc080000,   "r,xOA,X",    4 },
00169 { "lnb",      0xb4080000,   0xfc080000,   "r,xOA,X",    4 },
00170 { "lnd",      0xb4000002,   0xfc080002,   "r,xOA,X",    4 },
00171 { "lnh",      0xb4000001,   0xfc080001,   "r,xOA,X",    4 },
00172 { "lnw",      0xb4000000,   0xfc080000,   "r,xOA,X",    4 },
00173 { "lpsd",     0xf9800000,   0xff880000,   "r,xOA,X",    4 },
00174 { "lpsdcm",   0xfa800000,   0xff880000,   "r,xOA,X",    4 },
00175 { "lw",       0xac000000,   0xfc080000,   "r,xOA,X",    4 },
00176 { "lwbr",     0x5c000000,   0xfc080000,   "b,xOA,X",    4 },
00177 { "mpfd",     0xe4080002,   0xfc080002,   "r,xOA,X",    4 },
00178 { "mpfw",     0xe4080000,   0xfc080000,   "r,xOA,X",    4 },
00179 { "mpi",      0xc8030000,   0xfc7f0000,   "r,I",        4 },
00180 { "mpmb",     0xc0080000,   0xfc080000,   "r,xOA,X",    4 },
00181 { "mpmh",     0xc0000001,   0xfc080001,   "r,xOA,X",    4 },
00182 { "mpmw",     0xc0000000,   0xfc080000,   "r,xOA,X",    4 },
00183 { "mpr",      0x38020000,   0xfc0f0000,   "r,R",        2 },
00184 { "mprfd",    0x380e0000,   0xfc0f0000,   "r,R",        2 },
00185 { "mprfw",    0x38060000,   0xfc0f0000,   "r,R",        2 },
00186 { "nop",      0x00020000,   0xffff0000,   "",           2 },
00187 { "ormb",     0x88080000,   0xfc080000,   "r,xOA,X",    4 },
00188 { "ormd",     0x88000002,   0xfc080002,   "r,xOA,X",    4 },
00189 { "ormh",     0x88000001,   0xfc080001,   "r,xOA,X",    4 },
00190 { "ormw",     0x88000000,   0xfc080000,   "r,xOA,X",    4 },
00191 { "orr",      0x08000000,   0xfc0f0000,   "r,R",        2 },
00192 { "orrm",     0x08080000,   0xfc0f0000,   "r,R",        2 },
00193 { "rdsts",    0x00090000,   0xfc7f0000,   "r",          2 },
00194 { "return",   0x280e0000,   0xfc7f0000,   "",           2 },
00195 { "ri",       0xfc020000,   0xfc07ffff,   "I",          4 },
00196 { "rnd",      0x00050000,   0xfc7f0000,   "r",          2 },
00197 { "rpswt",    0x040b0000,   0xfc7f0000,   "r",          2 },
00198 { "rschnl",   0xfc2f0000,   0xfc7f8000,   "r,I",        4 },
00199 { "rsctl",    0xfc470000,   0xfc7f8000,   "r,I",        4 },
00200 { "rwcs",     0x000b0000,   0xfc0f0000,   "r,R",        2 },
00201 { "sacz",     0x10080000,   0xfc0f0000,   "r,R",        2 },
00202 { "sbm",      0x98080000,   0xfc080000,   "f,xOA,X",    4 },
00203 { "sbr",      0x18000000,   0xfc0c0000,   "r,f",        4 },
00204 { "sea",      0x000d0000,   0xffff0000,   "",           2 },
00205 { "setcpu",   0x2c090000,   0xfc7f0000,   "r",          2 },
00206 { "sio",      0xfc170000,   0xfc7f8000,   "r,I",        4 },
00207 { "sipu",     0x000a0000,   0xffff0000,   "",           2 },
00208 { "sla",      0x1c400000,   0xfc600000,   "r,S",        2 },
00209 { "slad",     0x20400000,   0xfc600000,   "r,S",        2 },
00210 { "slc",      0x24400000,   0xfc600000,   "r,S",        2 },
00211 { "sll",      0x1c600000,   0xfc600000,   "r,S",        2 },
00212 { "slld",     0x20600000,   0xfc600000,   "r,S",        2 },
00213 { "smc",      0x04070000,   0xfc070000,   "",           2 },
00214 { "sra",      0x1c000000,   0xfc600000,   "r,S",        2 },
00215 { "srad",     0x20000000,   0xfc600000,   "r,S",        2 },
00216 { "src",      0x24000000,   0xfc600000,   "r,S",        2 },
00217 { "srl",      0x1c200000,   0xfc600000,   "r,S",        2 },
00218 { "srld",     0x20200000,   0xfc600000,   "r,S",        2 },
00219 { "stb",      0xd4080000,   0xfc080000,   "r,xOA,X",    4 },
00220 { "std",      0xd4000002,   0xfc080002,   "r,xOA,X",    4 },
00221 { "stf",      0xdc000000,   0xfc080000,   "r,xOA,X",    4 },
00222 { "stfbr",    0x54000000,   0xfc080000,   "b,xOA,X",    4 },
00223 { "sth",      0xd4000001,   0xfc080001,   "r,xOA,X",    4 },
00224 { "stmb",     0xd8080000,   0xfc080000,   "r,xOA,X",    4 },
00225 { "stmd",     0xd8000002,   0xfc080002,   "r,xOA,X",    4 },
00226 { "stmh",     0xd8000001,   0xfc080001,   "r,xOA,X",    4 },
00227 { "stmw",     0xd8000000,   0xfc080000,   "r,xOA,X",    4 },
00228 { "stpio",    0xfc270000,   0xfc7f8000,   "r,I",        4 },
00229 { "stw",      0xd4000000,   0xfc080000,   "r,xOA,X",    4 },
00230 { "stwbr",    0x54000000,   0xfc080000,   "b,xOA,X",    4 },
00231 { "suabr",    0x58000000,   0xfc080000,   "b,xOA,X",    4 },
00232 { "sufd",     0xe0000002,   0xfc080002,   "r,xOA,X",    4 },
00233 { "sufw",     0xe0000000,   0xfc080000,   "r,xOA,X",    4 },
00234 { "sui",      0xc8020000,   0xfc7f0000,   "r,I",        4 },
00235 { "sumb",     0xbc080000,   0xfc080000,   "r,xOA,X",    4 },
00236 { "sumd",     0xbc000002,   0xfc080002,   "r,xOA,X",    4 },
00237 { "sumh",     0xbc000001,   0xfc080001,   "r,xOA,X",    4 },
00238 { "sumw",     0xbc000000,   0xfc080000,   "r,xOA,X",    4 },
00239 { "sur",      0x3c000000,   0xfc0f0000,   "r,R",        2 },
00240 { "surfd",    0x380b0000,   0xfc0f0000,   "r,xOA,X",    4 },
00241 { "surfw",    0x38030000,   0xfc0f0000,   "r,R",        2 },
00242 { "surm",     0x3c080000,   0xfc0f0000,   "r,R",        2 },
00243 { "svc",      0xc8060000,   0xffff0000,   "",           4 },
00244 { "tbm",      0xa4080000,   0xfc080000,   "f,xOA,X",    4 },
00245 { "tbr",      0x180c0000,   0xfc0c0000,   "r,f",        2 },
00246 { "tbrr",     0x2c020000,   0xfc0f0000,   "r,B",        2 },
00247 { "tccr",     0x28040000,   0xfc7f0000,   "",           2 },
00248 { "td",       0xfc050000,   0xfc070000,   "r,f",        4 },
00249 { "tio",      0xfc1f0000,   0xfc7f8000,   "r,I",        4 },
00250 { "tmapr",    0x2c0a0000,   0xfc0f0000,   "r,R",        2 },
00251 { "tpcbr",    0x280c0000,   0xfc7f0000,   "r",          2 },
00252 { "trbr",     0x2c010000,   0xfc0f0000,   "b,R",        2 },
00253 { "trc",      0x2c030000,   0xfc0f0000,   "r,R",        2 },
00254 { "trcc",     0x28050000,   0xfc7f0000,   "",           2 },
00255 { "trcm",     0x2c0b0000,   0xfc0f0000,   "r,R",        2 },
00256 { "trn",      0x2c040000,   0xfc0f0000,   "r,R",        2 },
00257 { "trnm",     0x2c0c0000,   0xfc0f0000,   "r,R",        2 },
00258 { "trr",      0x2c000000,   0xfc0f0000,   "r,R",        2 },
00259 { "trrm",     0x2c080000,   0xfc0f0000,   "r,R",        2 },
00260 { "trsc",     0x2c0e0000,   0xfc0f0000,   "r,R",        2 },
00261 { "trsw",     0x28000000,   0xfc7f0000,   "r",          2 },
00262 { "tscr",     0x2c0f0000,   0xfc0f0000,   "r,R",        2 },
00263 { "uei",      0x00070000,   0xffff0000,   "",           2 },
00264 { "wait",     0x00010000,   0xffff0000,   "",           2 },
00265 { "wcwcs",    0xfc5f0000,   0xfc7f8000,   "",           4 },
00266 { "wwcs",     0x000c0000,   0xfc0f0000,   "r,R",        2 },
00267 { "xcbr",     0x28020000,   0xfc0f0000,   "b,B",        2 },
00268 { "xcr",      0x2c050000,   0xfc0f0000,   "r,R",        2 },
00269 { "xcrm",     0x2c0d0000,   0xfc0f0000,   "r,R",        2 },
00270 { "zbm",      0x9c080000,   0xfc080000,   "f,xOA,X",    4 },
00271 { "zbr",      0x18040000,   0xfc0c0000,   "r,f",        2 },
00272 { "zmb",      0xf8080000,   0xfc080000,   "r,xOA,X",    4 },
00273 { "zmd",      0xf8000002,   0xfc080002,   "r,xOA,X",    4 },
00274 { "zmh",      0xf8000001,   0xfc080001,   "r,xOA,X",    4 },
00275 { "zmw",      0xf8000000,   0xfc080000,   "r,xOA,X",    4 },
00276 { "zr",       0x0c000000,   0xfc0f0000,   "r",          2 },
00277 };
00278 
00279 int numopcodes = sizeof(gld_opcodes) / sizeof(gld_opcodes[0]);
00280 
00281 struct gld_opcode *endop = gld_opcodes + sizeof(gld_opcodes) /
00282               sizeof(gld_opcodes[0]);