1 1.1 skrll /* Assemble V850 instructions. 2 1.1.1.11 christos Copyright (C) 1996-2026 Free Software Foundation, Inc. 3 1.1 skrll 4 1.1 skrll This file is part of the GNU opcodes library. 5 1.1 skrll 6 1.1 skrll This library is free software; you can redistribute it and/or modify 7 1.1 skrll it under the terms of the GNU General Public License as published by 8 1.1 skrll the Free Software Foundation; either version 3, or (at your option) 9 1.1 skrll any later version. 10 1.1 skrll 11 1.1 skrll It is distributed in the hope that it will be useful, but WITHOUT 12 1.1 skrll ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 13 1.1 skrll or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 14 1.1 skrll License for more details. 15 1.1 skrll 16 1.1 skrll You should have received a copy of the GNU General Public License 17 1.1 skrll along with this program; if not, write to the Free Software 18 1.1 skrll Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 19 1.1 skrll MA 02110-1301, USA. */ 20 1.1 skrll 21 1.1 skrll #include "sysdep.h" 22 1.1.1.3 christos #include <stdio.h> 23 1.1 skrll #include "opcode/v850.h" 24 1.1.1.2 christos #include "bfd.h" 25 1.1 skrll #include "opintl.h" 26 1.1 skrll 27 1.1 skrll /* Regular opcodes. */ 28 1.1 skrll #define OP(x) ((x & 0x3f) << 5) 29 1.1 skrll #define OP_MASK OP (0x3f) 30 1.1 skrll 31 1.1.1.2 christos /* Conditional branch opcodes (Format III). */ 32 1.1.1.2 christos #define BOP(x) ((0x58 << 4) | (x & 0x0f)) 33 1.1.1.2 christos #define BOP_MASK ((0x78 << 4) | 0x0f) 34 1.1.1.2 christos 35 1.1.1.2 christos /* Conditional branch opcodes (Format VII). */ 36 1.1.1.2 christos #define BOP7(x) (0x107e0 | (x & 0xf)) 37 1.1.1.2 christos #define BOP7_MASK (0x1ffe0 | 0xf) 38 1.1 skrll 39 1.1 skrll /* One-word opcodes. */ 40 1.1 skrll #define one(x) ((unsigned int) (x)) 41 1.1 skrll 42 1.1 skrll /* Two-word opcodes. */ 43 1.1 skrll #define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16)) 44 1.1.1.2 christos 45 1.1 skrll 46 1.1 skrll /* The functions used to insert and extract complicated operands. */ 48 1.1 skrll 49 1.1 skrll /* Note: There is a conspiracy between these functions and 50 1.1 skrll v850_insert_operand() in gas/config/tc-v850.c. Error messages 51 1.1 skrll containing the string 'out of range' will be ignored unless a 52 1.1 skrll specific command line option is given to GAS. */ 53 1.1 skrll 54 1.1 skrll static const char * not_valid = N_ ("displacement value is not in range and is not aligned"); 55 1.1 skrll static const char * out_of_range = N_ ("displacement value is out of range"); 56 1.1 skrll static const char * not_aligned = N_ ("displacement value is not aligned"); 57 1.1 skrll 58 1.1.1.2 christos static const char * immediate_out_of_range = N_ ("immediate value is out of range"); 59 1.1.1.2 christos static const char * branch_out_of_range = N_ ("branch value out of range"); 60 1.1.1.2 christos static const char * branch_out_of_range_and_odd_offset = N_ ("branch value not in range and to odd offset"); 61 1.1.1.4 christos static const char * branch_to_odd_offset = N_ ("branch to odd offset"); 62 1.1.1.4 christos static const char * pos_out_of_range = N_ ("position value is out of range"); 63 1.1.1.4 christos static const char * width_out_of_range = N_ ("width value is out of range"); 64 1.1.1.4 christos static const char * selid_out_of_range = N_ ("SelID is out of range"); 65 1.1.1.4 christos static const char * vector8_out_of_range = N_ ("vector8 is out of range"); 66 1.1.1.4 christos static const char * vector5_out_of_range = N_ ("vector5 is out of range"); 67 1.1.1.4 christos static const char * imm10_out_of_range = N_ ("imm10 is out of range"); 68 1.1.1.2 christos static const char * sr_selid_out_of_range = N_ ("SR/SelID is out of range"); 69 1.1.1.2 christos 70 1.1.1.2 christos int 71 1.1.1.2 christos v850_msg_is_out_of_range (const char* msg) 72 1.1.1.2 christos { 73 1.1.1.2 christos return msg == out_of_range 74 1.1.1.2 christos || msg == immediate_out_of_range 75 1.1.1.2 christos || msg == branch_out_of_range; 76 1.1 skrll } 77 1.1 skrll 78 1.1.1.8 christos static unsigned long 79 1.1 skrll insert_i5div1 (unsigned long insn, unsigned long value, const char ** errmsg) 80 1.1.1.2 christos { 81 1.1 skrll if (value > 30 || value < 2) 82 1.1.1.2 christos { 83 1.1.1.2 christos if (value & 1) 84 1.1 skrll * errmsg = _(not_valid); 85 1.1.1.2 christos else 86 1.1 skrll * errmsg = _(out_of_range); 87 1.1.1.2 christos } 88 1.1.1.2 christos else if (value & 1) 89 1.1 skrll * errmsg = _(not_aligned); 90 1.1.1.2 christos 91 1.1.1.2 christos value = (32 - value)/2; 92 1.1.1.2 christos 93 1.1 skrll return (insn | ((value << (2+16)) & 0x3c0000)); 94 1.1 skrll } 95 1.1 skrll 96 1.1.1.2 christos static unsigned long 97 1.1 skrll extract_i5div1 (unsigned long insn, int * invalid) 98 1.1.1.2 christos { 99 1.1.1.2 christos unsigned long ret = (insn & 0x003c0000) >> (16+2); 100 1.1 skrll ret = 32 - (ret * 2); 101 1.1.1.2 christos 102 1.1.1.2 christos if (invalid != 0) 103 1.1 skrll *invalid = (ret > 30 || ret < 2) ? 1 : 0; 104 1.1 skrll return ret; 105 1.1 skrll } 106 1.1 skrll 107 1.1.1.8 christos static unsigned long 108 1.1 skrll insert_i5div2 (unsigned long insn, unsigned long value, const char ** errmsg) 109 1.1.1.2 christos { 110 1.1 skrll if (value > 30 || value < 4) 111 1.1.1.2 christos { 112 1.1.1.2 christos if (value & 1) 113 1.1 skrll * errmsg = _(not_valid); 114 1.1.1.2 christos else 115 1.1 skrll * errmsg = _(out_of_range); 116 1.1.1.2 christos } 117 1.1.1.2 christos else if (value & 1) 118 1.1 skrll * errmsg = _(not_aligned); 119 1.1.1.2 christos 120 1.1.1.2 christos value = (32 - value)/2; 121 1.1.1.4 christos 122 1.1 skrll return insn | ((value << (2 + 16)) & 0x3c0000); 123 1.1 skrll } 124 1.1 skrll 125 1.1.1.2 christos static unsigned long 126 1.1 skrll extract_i5div2 (unsigned long insn, int * invalid) 127 1.1.1.2 christos { 128 1.1.1.2 christos unsigned long ret = (insn & 0x003c0000) >> (16+2); 129 1.1 skrll ret = 32 - (ret * 2); 130 1.1.1.2 christos 131 1.1.1.2 christos if (invalid != 0) 132 1.1.1.2 christos *invalid = (ret > 30 || ret < 4) ? 1 : 0; 133 1.1 skrll return ret; 134 1.1 skrll } 135 1.1 skrll 136 1.1.1.8 christos static unsigned long 137 1.1 skrll insert_i5div3 (unsigned long insn, unsigned long value, const char ** errmsg) 138 1.1.1.2 christos { 139 1.1 skrll if (value > 32 || value < 2) 140 1.1.1.2 christos { 141 1.1 skrll if (value & 1) 142 1.1 skrll * errmsg = _(not_valid); 143 1.1 skrll else 144 1.1 skrll * errmsg = _(out_of_range); 145 1.1.1.2 christos } 146 1.1 skrll else if (value & 1) 147 1.1 skrll * errmsg = _(not_aligned); 148 1.1.1.2 christos 149 1.1.1.2 christos value = (32 - value)/2; 150 1.1.1.4 christos 151 1.1 skrll return insn | ((value << (2+16)) & 0x3c0000); 152 1.1 skrll } 153 1.1 skrll 154 1.1.1.2 christos static unsigned long 155 1.1 skrll extract_i5div3 (unsigned long insn, int * invalid) 156 1.1.1.2 christos { 157 1.1.1.2 christos unsigned long ret = (insn & 0x003c0000) >> (16+2); 158 1.1 skrll ret = 32 - (ret * 2); 159 1.1.1.2 christos 160 1.1.1.2 christos if (invalid != 0) 161 1.1.1.2 christos *invalid = (ret > 32 || ret < 2) ? 1 : 0; 162 1.1 skrll return ret; 163 1.1 skrll } 164 1.1 skrll 165 1.1.1.8 christos static unsigned long 166 1.1 skrll insert_d5_4 (unsigned long insn, unsigned long value, const char ** errmsg) 167 1.1.1.8 christos { 168 1.1 skrll if (value > 0x1f) 169 1.1.1.2 christos { 170 1.1 skrll if (value & 1) 171 1.1 skrll * errmsg = _(not_valid); 172 1.1 skrll else 173 1.1 skrll * errmsg = _(out_of_range); 174 1.1.1.2 christos } 175 1.1 skrll else if (value & 1) 176 1.1 skrll * errmsg = _(not_aligned); 177 1.1 skrll 178 1.1 skrll value >>= 1; 179 1.1.1.2 christos 180 1.1 skrll return insn | (value & 0x0f); 181 1.1 skrll } 182 1.1 skrll 183 1.1.1.2 christos static unsigned long 184 1.1 skrll extract_d5_4 (unsigned long insn, int * invalid) 185 1.1.1.2 christos { 186 1.1 skrll unsigned long ret = (insn & 0x0f); 187 1.1.1.2 christos 188 1.1.1.2 christos ret <<= 1; 189 1.1.1.2 christos 190 1.1.1.2 christos if (invalid != 0) 191 1.1.1.2 christos *invalid = 0; 192 1.1 skrll return ret; 193 1.1 skrll } 194 1.1 skrll 195 1.1.1.8 christos static unsigned long 196 1.1 skrll insert_d8_6 (unsigned long insn, unsigned long value, const char ** errmsg) 197 1.1.1.8 christos { 198 1.1 skrll if (value > 0xff) 199 1.1 skrll { 200 1.1.1.2 christos if ((value % 4) != 0) 201 1.1 skrll * errmsg = _(not_valid); 202 1.1 skrll else 203 1.1 skrll * errmsg = _(out_of_range); 204 1.1 skrll } 205 1.1 skrll else if ((value % 4) != 0) 206 1.1 skrll * errmsg = _(not_aligned); 207 1.1 skrll 208 1.1 skrll value >>= 1; 209 1.1 skrll 210 1.1 skrll return insn | (value & 0x7e); 211 1.1 skrll } 212 1.1 skrll 213 1.1.1.2 christos static unsigned long 214 1.1 skrll extract_d8_6 (unsigned long insn, int * invalid) 215 1.1 skrll { 216 1.1 skrll unsigned long ret = (insn & 0x7e); 217 1.1.1.2 christos 218 1.1.1.2 christos ret <<= 1; 219 1.1.1.2 christos 220 1.1.1.2 christos if (invalid != 0) 221 1.1.1.2 christos *invalid = 0; 222 1.1 skrll return ret; 223 1.1 skrll } 224 1.1 skrll 225 1.1.1.8 christos static unsigned long 226 1.1 skrll insert_d8_7 (unsigned long insn, unsigned long value, const char ** errmsg) 227 1.1.1.8 christos { 228 1.1 skrll if (value > 0xff) 229 1.1.1.2 christos { 230 1.1 skrll if ((value % 2) != 0) 231 1.1 skrll * errmsg = _(not_valid); 232 1.1.1.2 christos else 233 1.1 skrll * errmsg = _(out_of_range); 234 1.1.1.2 christos } 235 1.1 skrll else if ((value % 2) != 0) 236 1.1 skrll * errmsg = _(not_aligned); 237 1.1 skrll 238 1.1 skrll value >>= 1; 239 1.1.1.2 christos 240 1.1 skrll return insn | (value & 0x7f); 241 1.1 skrll } 242 1.1 skrll 243 1.1.1.2 christos static unsigned long 244 1.1 skrll extract_d8_7 (unsigned long insn, int * invalid) 245 1.1.1.2 christos { 246 1.1.1.2 christos unsigned long ret = (insn & 0x7f); 247 1.1.1.2 christos 248 1.1.1.2 christos ret <<= 1; 249 1.1.1.2 christos 250 1.1.1.2 christos if (invalid != 0) 251 1.1.1.2 christos *invalid = 0; 252 1.1.1.2 christos return ret; 253 1.1.1.2 christos } 254 1.1.1.2 christos 255 1.1.1.8 christos static unsigned long 256 1.1.1.2 christos insert_v8 (unsigned long insn, unsigned long value, const char ** errmsg) 257 1.1.1.8 christos { 258 1.1.1.2 christos if (value > 0xff) 259 1.1.1.2 christos * errmsg = _(immediate_out_of_range); 260 1.1.1.2 christos 261 1.1.1.2 christos return insn | (value & 0x1f) | ((value & 0xe0) << (27-5)); 262 1.1.1.2 christos } 263 1.1.1.2 christos 264 1.1.1.2 christos static unsigned long 265 1.1.1.2 christos extract_v8 (unsigned long insn, int * invalid) 266 1.1.1.3 christos { 267 1.1.1.2 christos unsigned long ret = (insn & 0x1f) | ((insn >> (27-5)) & 0xe0); 268 1.1.1.2 christos 269 1.1.1.2 christos if (invalid != 0) 270 1.1.1.2 christos *invalid = 0; 271 1.1.1.2 christos return ret; 272 1.1.1.2 christos } 273 1.1.1.2 christos 274 1.1.1.8 christos static unsigned long 275 1.1.1.2 christos insert_d9 (unsigned long insn, unsigned long value, const char ** errmsg) 276 1.1.1.8 christos { 277 1.1.1.2 christos if (value + 0x100 > 0x1ff) 278 1.1.1.2 christos { 279 1.1.1.2 christos if ((value % 2) != 0) 280 1.1.1.2 christos * errmsg = branch_out_of_range_and_odd_offset; 281 1.1.1.2 christos else 282 1.1.1.2 christos * errmsg = branch_out_of_range; 283 1.1.1.2 christos } 284 1.1.1.2 christos else if ((value % 2) != 0) 285 1.1.1.2 christos * errmsg = branch_to_odd_offset; 286 1.1.1.2 christos 287 1.1.1.2 christos return insn | ((value & 0x1f0) << 7) | ((value & 0x0e) << 3); 288 1.1.1.2 christos } 289 1.1.1.2 christos 290 1.1.1.2 christos static unsigned long 291 1.1.1.2 christos extract_d9 (unsigned long insn, int * invalid) 292 1.1.1.8 christos { 293 1.1.1.2 christos unsigned long ret = ((insn >> 7) & 0x1f0) | ((insn >> 3) & 0x0e); 294 1.1.1.3 christos 295 1.1.1.2 christos ret = (ret ^ 0x100) - 0x100; 296 1.1.1.2 christos 297 1.1.1.2 christos if (invalid != 0) 298 1.1.1.2 christos *invalid = 0; 299 1.1.1.2 christos return ret; 300 1.1.1.2 christos } 301 1.1.1.2 christos 302 1.1.1.8 christos static unsigned long 303 1.1.1.2 christos insert_u16_loop (unsigned long insn, unsigned long value, const char ** errmsg) 304 1.1.1.4 christos { 305 1.1.1.4 christos /* Loop displacement is encoded as a positive value, 306 1.1.1.8 christos even though the instruction branches backwards. */ 307 1.1.1.2 christos if (value > 0xffff) 308 1.1.1.2 christos { 309 1.1.1.2 christos if ((value % 2) != 0) 310 1.1.1.2 christos * errmsg = branch_out_of_range_and_odd_offset; 311 1.1.1.2 christos else 312 1.1.1.2 christos * errmsg = branch_out_of_range; 313 1.1.1.2 christos } 314 1.1.1.2 christos else if ((value % 2) != 0) 315 1.1.1.2 christos * errmsg = branch_to_odd_offset; 316 1.1.1.4 christos 317 1.1.1.2 christos return insn | ((value & 0xfffe) << 16); 318 1.1 skrll } 319 1.1.1.2 christos 320 1.1.1.2 christos static unsigned long 321 1.1.1.2 christos extract_u16_loop (unsigned long insn, int * invalid) 322 1.1.1.2 christos { 323 1.1.1.2 christos long ret = (insn >> 16) & 0xfffe; 324 1.1.1.2 christos 325 1.1.1.2 christos if (invalid != 0) 326 1.1.1.2 christos *invalid = 0; 327 1.1.1.2 christos return ret; 328 1.1.1.2 christos } 329 1.1.1.2 christos 330 1.1.1.8 christos static unsigned long 331 1.1.1.2 christos insert_d16_15 (unsigned long insn, unsigned long value, const char ** errmsg) 332 1.1.1.8 christos { 333 1.1.1.2 christos if (value + 0x8000 > 0xffff) 334 1.1.1.2 christos { 335 1.1.1.2 christos if ((value % 2) != 0) 336 1.1.1.2 christos * errmsg = _(not_valid); 337 1.1.1.2 christos else 338 1.1.1.2 christos * errmsg = _(out_of_range); 339 1.1.1.2 christos } 340 1.1.1.2 christos else if ((value % 2) != 0) 341 1.1.1.2 christos * errmsg = _(not_aligned); 342 1.1.1.2 christos 343 1.1.1.2 christos return insn | ((value & 0xfffe) << 16); 344 1.1.1.2 christos } 345 1.1.1.2 christos 346 1.1.1.2 christos static unsigned long 347 1.1.1.2 christos extract_d16_15 (unsigned long insn, int * invalid) 348 1.1.1.8 christos { 349 1.1.1.3 christos unsigned long ret = (insn >> 16) & 0xfffe; 350 1.1.1.3 christos 351 1.1.1.2 christos ret = (ret ^ 0x8000) - 0x8000; 352 1.1.1.2 christos 353 1.1.1.2 christos if (invalid != 0) 354 1.1.1.2 christos *invalid = 0; 355 1.1 skrll return ret; 356 1.1 skrll } 357 1.1 skrll 358 1.1.1.8 christos static unsigned long 359 1.1 skrll insert_d16_16 (unsigned long insn, unsigned long value, const char ** errmsg) 360 1.1.1.8 christos { 361 1.1 skrll if (value + 0x8000 > 0xffff) 362 1.1 skrll * errmsg = _(out_of_range); 363 1.1 skrll 364 1.1 skrll return insn | ((value & 0xfffe) << 16) | ((value & 1) << 5); 365 1.1 skrll } 366 1.1 skrll 367 1.1.1.2 christos static unsigned long 368 1.1 skrll extract_d16_16 (unsigned long insn, int * invalid) 369 1.1.1.8 christos { 370 1.1.1.3 christos unsigned long ret = ((insn >> 16) & 0xfffe) | ((insn >> 5) & 1); 371 1.1.1.3 christos 372 1.1 skrll ret = (ret ^ 0x8000) - 0x8000; 373 1.1.1.2 christos 374 1.1.1.2 christos if (invalid != 0) 375 1.1 skrll *invalid = 0; 376 1.1 skrll return ret; 377 1.1 skrll } 378 1.1 skrll 379 1.1.1.8 christos static unsigned long 380 1.1.1.2 christos insert_d17_16 (unsigned long insn, unsigned long value, const char ** errmsg) 381 1.1.1.8 christos { 382 1.1.1.2 christos if (value + 0x10000 > 0x1ffff) 383 1.1.1.2 christos * errmsg = _(out_of_range); 384 1.1.1.2 christos 385 1.1.1.2 christos return insn | ((value & 0xfffe) << 16) | ((value & 0x10000) >> (16 - 4)); 386 1.1.1.2 christos } 387 1.1.1.2 christos 388 1.1.1.2 christos static unsigned long 389 1.1.1.2 christos extract_d17_16 (unsigned long insn, int * invalid) 390 1.1.1.8 christos { 391 1.1.1.3 christos unsigned long ret = ((insn >> 16) & 0xfffe) | ((insn << (16 - 4)) & 0x10000); 392 1.1.1.3 christos 393 1.1.1.2 christos ret = (ret ^ 0x10000) - 0x10000; 394 1.1.1.2 christos 395 1.1.1.2 christos if (invalid != 0) 396 1.1.1.8 christos *invalid = 0; 397 1.1.1.2 christos return ret; 398 1.1.1.2 christos } 399 1.1.1.2 christos 400 1.1.1.8 christos static unsigned long 401 1.1.1.2 christos insert_d22 (unsigned long insn, unsigned long value, const char ** errmsg) 402 1.1.1.8 christos { 403 1.1.1.2 christos if (value + 0x200000 > 0x3fffff) 404 1.1.1.2 christos { 405 1.1.1.2 christos if ((value % 2) != 0) 406 1.1.1.2 christos * errmsg = branch_out_of_range_and_odd_offset; 407 1.1.1.2 christos else 408 1.1.1.2 christos * errmsg = branch_out_of_range; 409 1.1.1.2 christos } 410 1.1.1.2 christos else if ((value % 2) != 0) 411 1.1.1.2 christos * errmsg = branch_to_odd_offset; 412 1.1.1.2 christos 413 1.1.1.2 christos return insn | ((value & 0xfffe) << 16) | ((value & 0x3f0000) >> 16); 414 1.1.1.2 christos } 415 1.1.1.2 christos 416 1.1.1.2 christos static unsigned long 417 1.1.1.2 christos extract_d22 (unsigned long insn, int * invalid) 418 1.1.1.8 christos { 419 1.1.1.2 christos unsigned long ret = ((insn >> 16) & 0xfffe) | ((insn << 16) & 0x3f0000); 420 1.1.1.3 christos 421 1.1.1.2 christos ret = (ret ^ 0x200000) - 0x200000; 422 1.1.1.2 christos 423 1.1.1.2 christos if (invalid != 0) 424 1.1.1.8 christos *invalid = 0; 425 1.1.1.2 christos return ret; 426 1.1.1.2 christos } 427 1.1.1.2 christos 428 1.1.1.8 christos static unsigned long 429 1.1.1.2 christos insert_d23 (unsigned long insn, unsigned long value, const char ** errmsg) 430 1.1.1.8 christos { 431 1.1.1.3 christos if (value + 0x400000 > 0x7fffff) 432 1.1.1.2 christos * errmsg = out_of_range; 433 1.1.1.2 christos 434 1.1.1.2 christos return insn | ((value & 0x7f) << 4) | ((value & 0x7fff80) << (16-7)); 435 1.1.1.2 christos } 436 1.1.1.2 christos 437 1.1.1.8 christos static unsigned long 438 1.1.1.4 christos insert_d23_align1 (unsigned long insn, unsigned long value, const char ** errmsg) 439 1.1.1.8 christos { 440 1.1.1.4 christos if (value + 0x400000 > 0x7fffff) 441 1.1.1.4 christos { 442 1.1.1.4 christos if (value & 0x1) 443 1.1.1.4 christos * errmsg = _(not_valid); 444 1.1.1.4 christos else 445 1.1.1.4 christos * errmsg = _(out_of_range); 446 1.1.1.4 christos } 447 1.1.1.4 christos else if (value & 0x1) 448 1.1.1.4 christos * errmsg = _(not_aligned); 449 1.1.1.4 christos 450 1.1.1.4 christos return insn | ((value & 0x7e) << 4) | ((value & 0x7fff80) << (16 - 7)); 451 1.1.1.4 christos } 452 1.1.1.4 christos 453 1.1.1.2 christos static unsigned long 454 1.1.1.2 christos extract_d23 (unsigned long insn, int * invalid) 455 1.1.1.8 christos { 456 1.1.1.2 christos unsigned long ret = ((insn >> 4) & 0x7f) | ((insn >> (16-7)) & 0x7fff80); 457 1.1.1.3 christos 458 1.1.1.2 christos ret = (ret ^ 0x400000) - 0x400000; 459 1.1.1.2 christos 460 1.1.1.2 christos if (invalid != 0) 461 1.1.1.8 christos *invalid = 0; 462 1.1.1.2 christos return ret; 463 1.1.1.2 christos } 464 1.1.1.2 christos 465 1.1.1.8 christos static unsigned long 466 1.1 skrll insert_i9 (unsigned long insn, unsigned long value, const char ** errmsg) 467 1.1.1.8 christos { 468 1.1 skrll if (value + 0x100 > 0x1ff) 469 1.1 skrll * errmsg = _(immediate_out_of_range); 470 1.1 skrll 471 1.1 skrll return insn | ((value & 0x1e0) << 13) | (value & 0x1f); 472 1.1 skrll } 473 1.1 skrll 474 1.1.1.2 christos static unsigned long 475 1.1 skrll extract_i9 (unsigned long insn, int * invalid) 476 1.1.1.8 christos { 477 1.1 skrll unsigned long ret = ((insn >> 13) & 0x1e0) | (insn & 0x1f); 478 1.1.1.3 christos 479 1.1 skrll ret = (ret ^ 0x100) - 0x100; 480 1.1.1.2 christos 481 1.1.1.2 christos if (invalid != 0) 482 1.1 skrll *invalid = 0; 483 1.1 skrll return ret; 484 1.1 skrll } 485 1.1 skrll 486 1.1.1.8 christos static unsigned long 487 1.1 skrll insert_u9 (unsigned long insn, unsigned long value, const char ** errmsg) 488 1.1 skrll { 489 1.1 skrll if (value > 0x1ff) 490 1.1 skrll * errmsg = _(immediate_out_of_range); 491 1.1 skrll 492 1.1 skrll return insn | ((value & 0x1e0) << 13) | (value & 0x1f); 493 1.1 skrll } 494 1.1 skrll 495 1.1.1.2 christos static unsigned long 496 1.1 skrll extract_u9 (unsigned long insn, int * invalid) 497 1.1.1.3 christos { 498 1.1 skrll unsigned long ret = ((insn >> 13) & 0x1e0) | (insn & 0x1f); 499 1.1.1.2 christos 500 1.1.1.2 christos if (invalid != 0) 501 1.1 skrll *invalid = 0; 502 1.1 skrll return ret; 503 1.1 skrll } 504 1.1 skrll 505 1.1.1.8 christos static unsigned long 506 1.1 skrll insert_spe (unsigned long insn, unsigned long value, const char ** errmsg) 507 1.1 skrll { 508 1.1 skrll if (value != 3) 509 1.1 skrll * errmsg = _("invalid register for stack adjustment"); 510 1.1.1.3 christos 511 1.1 skrll return insn & ~0x180000; 512 1.1 skrll } 513 1.1 skrll 514 1.1.1.2 christos static unsigned long 515 1.1 skrll extract_spe (unsigned long insn ATTRIBUTE_UNUSED, int * invalid) 516 1.1.1.2 christos { 517 1.1.1.2 christos if (invalid != 0) 518 1.1.1.2 christos *invalid = 0; 519 1.1 skrll 520 1.1 skrll return 3; 521 1.1 skrll } 522 1.1 skrll 523 1.1.1.8 christos static unsigned long 524 1.1 skrll insert_r4 (unsigned long insn, unsigned long value, const char ** errmsg) 525 1.1.1.2 christos { 526 1.1.1.4 christos if (value >= 32) 527 1.1 skrll * errmsg = _("invalid register name"); 528 1.1.1.4 christos 529 1.1 skrll return insn | ((value & 0x01) << 23) | ((value & 0x1e) << 16); 530 1.1 skrll } 531 1.1 skrll 532 1.1.1.2 christos static unsigned long 533 1.1 skrll extract_r4 (unsigned long insn, int * invalid) 534 1.1.1.4 christos { 535 1.1.1.4 christos unsigned long r4; 536 1.1.1.4 christos unsigned long insn2; 537 1.1.1.4 christos 538 1.1.1.4 christos insn2 = insn >> 16; 539 1.1.1.4 christos r4 = (((insn2 & 0x0080) >> 7) | (insn2 & 0x001e)); 540 1.1.1.4 christos 541 1.1.1.4 christos if (invalid != 0) 542 1.1.1.4 christos *invalid = 0; 543 1.1.1.4 christos 544 1.1.1.4 christos return r4; 545 1.1.1.4 christos } 546 1.1.1.4 christos 547 1.1.1.4 christos static unsigned long G_pos; 548 1.1.1.4 christos 549 1.1.1.8 christos static unsigned long 550 1.1.1.4 christos insert_POS (unsigned long insn, unsigned long pos, const char ** errmsg) 551 1.1.1.8 christos { 552 1.1.1.4 christos if (pos > 0x1f) 553 1.1.1.4 christos * errmsg = _(pos_out_of_range); 554 1.1.1.8 christos 555 1.1.1.4 christos G_pos = pos; 556 1.1.1.4 christos 557 1.1.1.4 christos return insn; /* Not an oparaton until WIDTH. */ 558 1.1.1.4 christos } 559 1.1.1.4 christos 560 1.1.1.4 christos static unsigned long 561 1.1.1.4 christos extract_POS_U (unsigned long insn, int * invalid) 562 1.1.1.4 christos { 563 1.1.1.4 christos unsigned long pos,lsb; 564 1.1.1.4 christos unsigned long insn2; 565 1.1.1.4 christos insn2 = insn >> 16; 566 1.1.1.4 christos 567 1.1.1.4 christos lsb = ((insn2 & 0x0800) >> 8) 568 1.1.1.4 christos | ((insn2 & 0x000e) >> 1); 569 1.1.1.4 christos lsb += 16; 570 1.1.1.4 christos pos = lsb; 571 1.1.1.4 christos 572 1.1.1.4 christos if (invalid != 0) 573 1.1.1.4 christos *invalid = 0; 574 1.1.1.4 christos 575 1.1.1.4 christos return pos; 576 1.1.1.4 christos } 577 1.1.1.4 christos 578 1.1.1.4 christos static unsigned long 579 1.1.1.4 christos extract_POS_L (unsigned long insn, int * invalid) 580 1.1.1.4 christos { 581 1.1.1.4 christos unsigned long pos,lsb; 582 1.1.1.4 christos unsigned long insn2; 583 1.1.1.4 christos insn2 = insn >> 16; 584 1.1.1.4 christos 585 1.1.1.4 christos lsb = ((insn2 & 0x0800) >> 8) 586 1.1.1.4 christos | ((insn2 & 0x000e) >> 1); 587 1.1.1.4 christos pos = lsb; 588 1.1.1.4 christos 589 1.1.1.4 christos if (invalid != 0) 590 1.1.1.4 christos *invalid = 0; 591 1.1.1.4 christos 592 1.1.1.4 christos return pos; 593 1.1.1.4 christos } 594 1.1.1.4 christos 595 1.1.1.8 christos static unsigned long 596 1.1.1.4 christos insert_WIDTH (unsigned long insn, unsigned long width, const char ** errmsg) 597 1.1.1.4 christos { 598 1.1.1.4 christos unsigned long msb, lsb, opc, ret; 599 1.1.1.4 christos unsigned long msb_expand, lsb_expand; 600 1.1.1.8 christos 601 1.1.1.4 christos msb = width + G_pos - 1; 602 1.1.1.4 christos lsb = G_pos; 603 1.1.1.4 christos opc = 0; 604 1.1.1.4 christos G_pos = 0; 605 1.1.1.8 christos 606 1.1.1.4 christos if (width > 0x20) 607 1.1.1.4 christos * errmsg = _(width_out_of_range); 608 1.1.1.4 christos 609 1.1.1.4 christos if ((msb >= 16) && (lsb >= 16)) 610 1.1.1.4 christos opc = 0x0090; 611 1.1.1.4 christos else if ((msb >= 16) && (lsb < 16)) 612 1.1.1.4 christos opc = 0x00b0; 613 1.1.1.4 christos else if ((msb < 16) && (lsb < 16)) 614 1.1.1.4 christos opc = 0x00d0; 615 1.1.1.4 christos else 616 1.1.1.4 christos * errmsg = _(width_out_of_range); 617 1.1.1.4 christos 618 1.1.1.4 christos msb &= 0x0f; 619 1.1.1.4 christos msb_expand = msb << 12; 620 1.1.1.4 christos lsb &= 0x0f; 621 1.1.1.4 christos lsb_expand = ((lsb & 0x8) << 8)|((lsb & 0x7) << 1); 622 1.1.1.4 christos 623 1.1.1.4 christos ret = (insn & 0x0000ffff) | ((opc | msb_expand | lsb_expand) << 16); 624 1.1.1.4 christos 625 1.1.1.4 christos return ret; 626 1.1.1.4 christos } 627 1.1.1.4 christos 628 1.1.1.4 christos static unsigned long 629 1.1.1.4 christos extract_WIDTH_U (unsigned long insn, int * invalid) 630 1.1.1.4 christos { 631 1.1.1.4 christos unsigned long width, msb, lsb; 632 1.1.1.4 christos unsigned long insn2; 633 1.1.1.4 christos insn2 = insn >> 16; 634 1.1.1.4 christos 635 1.1.1.4 christos msb = ((insn2 & 0xf000) >> 12); 636 1.1.1.4 christos msb += 16; 637 1.1.1.4 christos lsb = ((insn2 & 0x0800) >> 8) 638 1.1.1.4 christos | ((insn2 & 0x000e) >> 1); 639 1.1.1.4 christos lsb += 16; 640 1.1.1.4 christos 641 1.1.1.4 christos if (invalid != 0) 642 1.1.1.4 christos *invalid = 0; 643 1.1.1.4 christos 644 1.1.1.4 christos width = msb - lsb + 1; 645 1.1.1.4 christos 646 1.1.1.4 christos return width; 647 1.1.1.4 christos } 648 1.1.1.4 christos 649 1.1.1.4 christos static unsigned long 650 1.1.1.4 christos extract_WIDTH_M (unsigned long insn, int * invalid) 651 1.1.1.4 christos { 652 1.1.1.4 christos unsigned long width, msb, lsb; 653 1.1.1.4 christos unsigned long insn2; 654 1.1.1.4 christos insn2 = insn >> 16; 655 1.1.1.4 christos 656 1.1.1.4 christos msb = ((insn2 & 0xf000) >> 12) ; 657 1.1.1.4 christos msb += 16; 658 1.1.1.4 christos lsb = ((insn2 & 0x0800) >> 8) 659 1.1 skrll | ((insn2 & 0x000e) >> 1); 660 1.1.1.2 christos 661 1.1.1.2 christos if (invalid != 0) 662 1.1.1.4 christos *invalid = 0; 663 1.1.1.4 christos 664 1.1.1.4 christos width = msb - lsb + 1; 665 1.1.1.4 christos 666 1.1.1.4 christos return width; 667 1.1.1.4 christos } 668 1.1.1.4 christos 669 1.1.1.4 christos static unsigned long 670 1.1.1.4 christos extract_WIDTH_L (unsigned long insn, int * invalid) 671 1.1.1.4 christos { 672 1.1.1.4 christos unsigned long width, msb, lsb; 673 1.1.1.4 christos unsigned long insn2; 674 1.1.1.4 christos insn2 = insn >> 16; 675 1.1.1.4 christos 676 1.1.1.4 christos msb = ((insn2 & 0xf000) >> 12) ; 677 1.1.1.4 christos lsb = ((insn2 & 0x0800) >> 8) 678 1.1.1.4 christos | ((insn2 & 0x000e) >> 1); 679 1.1.1.4 christos 680 1.1.1.4 christos if (invalid != 0) 681 1.1.1.4 christos *invalid = 0; 682 1.1.1.4 christos 683 1.1.1.4 christos width = msb - lsb + 1; 684 1.1.1.4 christos 685 1.1.1.4 christos return width; 686 1.1.1.4 christos } 687 1.1.1.4 christos 688 1.1.1.8 christos static unsigned long 689 1.1.1.4 christos insert_SELID (unsigned long insn, unsigned long selid, const char ** errmsg) 690 1.1.1.8 christos { 691 1.1.1.4 christos if (selid > 0x1f) 692 1.1.1.4 christos * errmsg = _(selid_out_of_range); 693 1.1.1.7 christos 694 1.1.1.4 christos return insn | ((selid & 0x1fUL) << 27); 695 1.1.1.4 christos } 696 1.1.1.4 christos 697 1.1.1.4 christos static unsigned long 698 1.1.1.4 christos extract_SELID (unsigned long insn, int * invalid) 699 1.1.1.4 christos { 700 1.1.1.4 christos unsigned long selid; 701 1.1.1.4 christos unsigned long insn2; 702 1.1.1.4 christos 703 1.1.1.4 christos insn2 = insn >> 16; 704 1.1.1.4 christos 705 1.1.1.4 christos selid = ((insn2 & 0xf800) >> 11); 706 1.1.1.4 christos 707 1.1.1.4 christos if (invalid != 0) 708 1.1.1.4 christos *invalid = 0; 709 1.1.1.4 christos 710 1.1.1.4 christos return selid; 711 1.1.1.4 christos } 712 1.1.1.4 christos 713 1.1.1.8 christos static unsigned long 714 1.1.1.4 christos insert_VECTOR8 (unsigned long insn, unsigned long vector8, const char ** errmsg) 715 1.1.1.4 christos { 716 1.1.1.8 christos unsigned long ret; 717 1.1.1.4 christos unsigned long VVV, vvvvv; 718 1.1.1.8 christos 719 1.1.1.4 christos if (vector8 > 0xff) 720 1.1.1.4 christos * errmsg = _(vector8_out_of_range); 721 1.1.1.4 christos 722 1.1.1.4 christos VVV = (vector8 & 0xe0) >> 5; 723 1.1.1.4 christos vvvvv = (vector8 & 0x1f); 724 1.1.1.4 christos 725 1.1.1.4 christos ret = (insn | (VVV << 27) | vvvvv); 726 1.1.1.4 christos 727 1.1.1.4 christos return ret; 728 1.1.1.4 christos } 729 1.1.1.4 christos 730 1.1.1.4 christos static unsigned long 731 1.1.1.4 christos extract_VECTOR8 (unsigned long insn, int * invalid) 732 1.1.1.4 christos { 733 1.1.1.4 christos unsigned long vector8; 734 1.1.1.4 christos unsigned long VVV,vvvvv; 735 1.1.1.4 christos unsigned long insn2; 736 1.1.1.4 christos 737 1.1.1.4 christos insn2 = insn >> 16; 738 1.1.1.4 christos VVV = ((insn2 & 0x3800) >> 11); 739 1.1.1.4 christos vvvvv = (insn & 0x001f); 740 1.1.1.4 christos vector8 = VVV << 5 | vvvvv; 741 1.1.1.4 christos 742 1.1.1.4 christos if (invalid != 0) 743 1.1.1.4 christos *invalid = 0; 744 1.1.1.4 christos 745 1.1.1.4 christos return vector8; 746 1.1.1.4 christos } 747 1.1.1.4 christos 748 1.1.1.8 christos static unsigned long 749 1.1.1.4 christos insert_VECTOR5 (unsigned long insn, unsigned long vector5, const char ** errmsg) 750 1.1.1.4 christos { 751 1.1.1.4 christos unsigned long ret; 752 1.1.1.4 christos unsigned long vvvvv; 753 1.1.1.8 christos 754 1.1.1.4 christos if (vector5 > 0x1f) 755 1.1.1.4 christos * errmsg = _(vector5_out_of_range); 756 1.1.1.4 christos 757 1.1.1.4 christos vvvvv = (vector5 & 0x1f); 758 1.1.1.4 christos 759 1.1.1.4 christos ret = (insn | vvvvv); 760 1.1.1.4 christos 761 1.1.1.4 christos return ret; 762 1.1.1.4 christos } 763 1.1.1.4 christos 764 1.1.1.4 christos static unsigned long 765 1.1.1.4 christos extract_VECTOR5 (unsigned long insn, int * invalid) 766 1.1.1.4 christos { 767 1.1.1.4 christos unsigned long vector5; 768 1.1.1.4 christos 769 1.1.1.4 christos vector5 = (insn & 0x001f); 770 1.1.1.4 christos 771 1.1.1.4 christos if (invalid != 0) 772 1.1.1.4 christos *invalid = 0; 773 1.1.1.4 christos 774 1.1.1.4 christos return vector5; 775 1.1.1.4 christos } 776 1.1.1.4 christos 777 1.1.1.8 christos static unsigned long 778 1.1.1.4 christos insert_CACHEOP (unsigned long insn, unsigned long cacheop, const char ** errmsg ATTRIBUTE_UNUSED) 779 1.1.1.4 christos { 780 1.1.1.8 christos unsigned long ret; 781 1.1.1.4 christos unsigned long pp, PPPPP; 782 1.1.1.4 christos 783 1.1.1.4 christos pp = (cacheop & 0x60) >> 5; 784 1.1.1.4 christos PPPPP = (cacheop & 0x1f); 785 1.1.1.4 christos 786 1.1.1.4 christos ret = insn | (pp << 11) | (PPPPP << 27); 787 1.1.1.4 christos 788 1.1.1.4 christos return ret; 789 1.1.1.4 christos } 790 1.1.1.4 christos 791 1.1.1.4 christos static unsigned long 792 1.1.1.4 christos extract_CACHEOP (unsigned long insn, int * invalid) 793 1.1.1.4 christos { 794 1.1.1.8 christos unsigned long ret; 795 1.1.1.4 christos unsigned long pp, PPPPP; 796 1.1.1.4 christos unsigned long insn2; 797 1.1.1.4 christos 798 1.1.1.4 christos insn2 = insn >> 16; 799 1.1.1.4 christos 800 1.1.1.4 christos PPPPP = ((insn2 & 0xf800) >> 11); 801 1.1.1.4 christos pp = ((insn & 0x1800) >> 11); 802 1.1.1.4 christos 803 1.1.1.4 christos ret = (pp << 5) | PPPPP; 804 1.1.1.4 christos 805 1.1.1.4 christos if (invalid != 0) 806 1.1.1.4 christos *invalid = 0; 807 1.1.1.4 christos 808 1.1.1.4 christos return ret; 809 1.1.1.4 christos } 810 1.1.1.4 christos 811 1.1.1.8 christos static unsigned long 812 1.1.1.4 christos insert_PREFOP (unsigned long insn, unsigned long prefop, const char ** errmsg ATTRIBUTE_UNUSED) 813 1.1.1.4 christos { 814 1.1.1.4 christos unsigned long ret; 815 1.1.1.4 christos unsigned long PPPPP; 816 1.1.1.4 christos 817 1.1.1.4 christos PPPPP = (prefop & 0x1f); 818 1.1.1.4 christos 819 1.1.1.4 christos ret = insn | (PPPPP << 27); 820 1.1.1.4 christos 821 1.1.1.4 christos return ret; 822 1.1.1.4 christos } 823 1.1.1.4 christos 824 1.1.1.4 christos static unsigned long 825 1.1.1.4 christos extract_PREFOP (unsigned long insn, int * invalid) 826 1.1.1.4 christos { 827 1.1.1.4 christos unsigned long ret; 828 1.1.1.4 christos unsigned long PPPPP; 829 1.1.1.4 christos unsigned long insn2; 830 1.1.1.4 christos 831 1.1.1.4 christos insn2 = insn >> 16; 832 1.1.1.4 christos 833 1.1.1.4 christos PPPPP = (insn2 & 0xf800) >> 11; 834 1.1.1.4 christos 835 1.1.1.4 christos ret = PPPPP; 836 1.1.1.4 christos 837 1.1.1.4 christos if (invalid != 0) 838 1.1.1.4 christos *invalid = 0; 839 1.1.1.4 christos 840 1.1.1.4 christos return ret; 841 1.1.1.4 christos } 842 1.1.1.4 christos 843 1.1.1.8 christos static unsigned long 844 1.1.1.4 christos insert_IMM10U (unsigned long insn, unsigned long value, const char ** errmsg) 845 1.1.1.4 christos { 846 1.1.1.4 christos unsigned long imm10, ret; 847 1.1.1.4 christos unsigned long iiiii,IIIII; 848 1.1.1.8 christos 849 1.1.1.4 christos if (value > 0x3ff) 850 1.1.1.4 christos * errmsg = _(imm10_out_of_range); 851 1.1.1.8 christos 852 1.1.1.4 christos imm10 = value & 0x3ff; 853 1.1.1.4 christos IIIII = (imm10 >> 5) & 0x1f; 854 1.1.1.4 christos iiiii = imm10 & 0x1f; 855 1.1.1.4 christos 856 1.1.1.4 christos ret = insn | IIIII << 27 | iiiii; 857 1.1.1.4 christos 858 1.1.1.4 christos return ret; 859 1.1.1.4 christos } 860 1.1.1.4 christos 861 1.1.1.4 christos static unsigned long 862 1.1.1.4 christos extract_IMM10U (unsigned long insn, int * invalid) 863 1.1.1.4 christos { 864 1.1.1.4 christos unsigned long ret; 865 1.1.1.4 christos unsigned long iiiii,IIIII; 866 1.1.1.4 christos unsigned long insn2; 867 1.1.1.4 christos insn2 = insn >> 16; 868 1.1.1.4 christos 869 1.1.1.4 christos IIIII = ((insn2 & 0xf800) >> 11); 870 1.1.1.4 christos iiiii = (insn & 0x001f); 871 1.1.1.4 christos 872 1.1.1.4 christos ret = (IIIII << 5) | iiiii; 873 1.1.1.4 christos 874 1.1.1.4 christos if (invalid != 0) 875 1.1.1.4 christos *invalid = 0; 876 1.1.1.4 christos 877 1.1.1.4 christos return ret; 878 1.1.1.4 christos } 879 1.1.1.4 christos 880 1.1.1.8 christos static unsigned long 881 1.1.1.4 christos insert_SRSEL1 (unsigned long insn, unsigned long value, const char ** errmsg) 882 1.1.1.4 christos { 883 1.1.1.4 christos unsigned long imm10, ret; 884 1.1.1.4 christos unsigned long sr,selid; 885 1.1.1.8 christos 886 1.1.1.4 christos if (value > 0x3ff) 887 1.1.1.4 christos * errmsg = _(sr_selid_out_of_range); 888 1.1.1.8 christos 889 1.1.1.4 christos imm10 = value; 890 1.1.1.4 christos selid = (imm10 & 0x3e0) >> 5; 891 1.1.1.4 christos sr = imm10 & 0x1f; 892 1.1.1.4 christos 893 1.1.1.4 christos ret = insn | selid << 27 | sr; 894 1.1.1.4 christos 895 1.1.1.4 christos return ret; 896 1.1.1.4 christos } 897 1.1.1.4 christos 898 1.1.1.4 christos static unsigned long 899 1.1.1.4 christos extract_SRSEL1 (unsigned long insn, int * invalid) 900 1.1.1.4 christos { 901 1.1.1.4 christos unsigned long ret; 902 1.1.1.4 christos unsigned long sr, selid; 903 1.1.1.4 christos unsigned long insn2; 904 1.1.1.4 christos 905 1.1.1.4 christos insn2 = insn >> 16; 906 1.1.1.4 christos 907 1.1.1.4 christos selid = ((insn2 & 0xf800) >> 11); 908 1.1.1.4 christos sr = (insn & 0x001f); 909 1.1.1.4 christos 910 1.1.1.4 christos ret = (selid << 5) | sr; 911 1.1.1.4 christos 912 1.1.1.4 christos if (invalid != 0) 913 1.1.1.4 christos *invalid = 0; 914 1.1.1.4 christos 915 1.1.1.4 christos return ret; 916 1.1.1.4 christos } 917 1.1.1.4 christos 918 1.1.1.8 christos static unsigned long 919 1.1.1.4 christos insert_SRSEL2 (unsigned long insn, unsigned long value, const char ** errmsg) 920 1.1.1.4 christos { 921 1.1.1.4 christos unsigned long imm10, ret; 922 1.1.1.4 christos unsigned long sr, selid; 923 1.1.1.8 christos 924 1.1.1.4 christos if (value > 0x3ff) 925 1.1.1.4 christos * errmsg = _(sr_selid_out_of_range); 926 1.1.1.8 christos 927 1.1.1.4 christos imm10 = value; 928 1.1.1.4 christos selid = (imm10 & 0x3e0) >> 5; 929 1.1.1.4 christos sr = imm10 & 0x1f; 930 1.1.1.4 christos 931 1.1.1.4 christos ret = insn | selid << 27 | sr << 11; 932 1.1.1.4 christos 933 1.1.1.4 christos return ret; 934 1.1.1.4 christos } 935 1.1.1.4 christos 936 1.1.1.4 christos static unsigned long 937 1.1.1.4 christos extract_SRSEL2 (unsigned long insn, int * invalid) 938 1.1.1.4 christos { 939 1.1.1.4 christos unsigned long ret; 940 1.1.1.4 christos unsigned long sr, selid; 941 1.1.1.4 christos unsigned long insn2; 942 1.1.1.4 christos 943 1.1.1.4 christos insn2 = insn >> 16; 944 1.1.1.4 christos 945 1.1.1.4 christos selid = ((insn2 & 0xf800) >> 11); 946 1.1.1.4 christos sr = ((insn & 0xf800) >> 11); 947 1.1.1.4 christos 948 1.1.1.4 christos ret = (selid << 5) | sr; 949 1.1.1.4 christos 950 1.1.1.4 christos if (invalid != 0) 951 1.1.1.4 christos *invalid = 0; 952 1.1 skrll 953 1.1 skrll return ret; 954 1.1 skrll } 955 1.1 skrll 956 1.1 skrll /* Warning: code in gas/config/tc-v850.c examines the contents of this array. 958 1.1 skrll If you change any of the values here, be sure to look for side effects in 959 1.1 skrll that code. */ 960 1.1 skrll const struct v850_operand v850_operands[] = 961 1.1.1.2 christos { 962 1.1 skrll #define UNUSED 0 963 1.1.1.2 christos { 0, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 964 1.1 skrll 965 1.1.1.2 christos /* The R1 field in a format 1, 6, 7, 9, C insn. */ 966 1.1 skrll #define R1 (UNUSED + 1) 967 1.1 skrll { 5, 0, NULL, NULL, V850_OPERAND_REG, BFD_RELOC_NONE }, 968 1.1 skrll 969 1.1.1.2 christos /* As above, but register 0 is not allowed. */ 970 1.1 skrll #define R1_NOTR0 (R1 + 1) 971 1.1.1.2 christos { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE }, 972 1.1.1.2 christos 973 1.1.1.2 christos /* Even register is allowed. */ 974 1.1.1.2 christos #define R1_EVEN (R1_NOTR0 + 1) 975 1.1.1.2 christos { 4, 1, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE }, 976 1.1.1.2 christos 977 1.1.1.2 christos /* Bang (bit reverse). */ 978 1.1.1.2 christos #define R1_BANG (R1_EVEN + 1) 979 1.1.1.2 christos { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_OPERAND_BANG, BFD_RELOC_NONE }, 980 1.1.1.2 christos 981 1.1.1.2 christos /* Percent (modulo). */ 982 1.1.1.2 christos #define R1_PERCENT (R1_BANG + 1) 983 1.1.1.2 christos { 5, 0, NULL, NULL, V850_OPERAND_REG | V850_OPERAND_PERCENT, BFD_RELOC_NONE }, 984 1.1.1.2 christos 985 1.1.1.2 christos /* The R2 field in a format 1, 2, 4, 5, 6, 7, 9, C insn. */ 986 1.1 skrll #define R2 (R1_PERCENT + 1) 987 1.1 skrll { 5, 11, NULL, NULL, V850_OPERAND_REG, BFD_RELOC_NONE }, 988 1.1 skrll 989 1.1.1.2 christos /* As above, but register 0 is not allowed. */ 990 1.1 skrll #define R2_NOTR0 (R2 + 1) 991 1.1.1.2 christos { 5, 11, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE }, 992 1.1.1.2 christos 993 1.1.1.2 christos /* Even register is allowed. */ 994 1.1 skrll #define R2_EVEN (R2_NOTR0 + 1) 995 1.1.1.2 christos { 4, 12, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE }, 996 1.1.1.2 christos 997 1.1.1.2 christos /* Reg2 in dispose instruction. */ 998 1.1 skrll #define R2_DISPOSE (R2_EVEN + 1) 999 1.1.1.2 christos { 5, 16, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE }, 1000 1.1.1.2 christos 1001 1.1.1.2 christos /* The R3 field in a format 11, 12, C insn. */ 1002 1.1 skrll #define R3 (R2_DISPOSE + 1) 1003 1.1.1.2 christos { 5, 27, NULL, NULL, V850_OPERAND_REG, BFD_RELOC_NONE }, 1004 1.1.1.2 christos 1005 1.1.1.2 christos /* As above, but register 0 is not allowed. */ 1006 1.1 skrll #define R3_NOTR0 (R3 + 1) 1007 1.1.1.2 christos { 5, 27, NULL, NULL, V850_OPERAND_REG | V850_NOT_R0, BFD_RELOC_NONE }, 1008 1.1.1.2 christos 1009 1.1.1.2 christos /* As above, but odd number registers are not allowed. */ 1010 1.1 skrll #define R3_EVEN (R3_NOTR0 + 1) 1011 1.1.1.2 christos { 4, 28, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE }, 1012 1.1.1.2 christos 1013 1.1.1.2 christos /* As above, but register 0 is not allowed. */ 1014 1.1 skrll #define R3_EVEN_NOTR0 (R3_EVEN + 1) 1015 1.1.1.2 christos { 4, 28, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN | V850_NOT_R0, BFD_RELOC_NONE }, 1016 1.1.1.2 christos 1017 1.1.1.2 christos /* Forth register in FPU Instruction. */ 1018 1.1.1.2 christos #define R4 (R3_EVEN_NOTR0 + 1) 1019 1.1.1.2 christos { 5, 0, insert_r4, extract_r4, V850_OPERAND_REG, BFD_RELOC_NONE }, 1020 1.1.1.2 christos 1021 1.1.1.2 christos /* As above, but odd number registers are not allowed. */ 1022 1.1 skrll #define R4_EVEN (R4 + 1) 1023 1.1.1.2 christos { 4, 17, NULL, NULL, V850_OPERAND_REG | V850_REG_EVEN, BFD_RELOC_NONE }, 1024 1.1.1.2 christos 1025 1.1.1.2 christos /* Stack pointer in prepare instruction. */ 1026 1.1 skrll #define SP (R4_EVEN + 1) 1027 1.1.1.2 christos { 2, 0, insert_spe, extract_spe, V850_OPERAND_REG, BFD_RELOC_NONE }, 1028 1.1.1.2 christos 1029 1.1.1.2 christos /* EP Register. */ 1030 1.1.1.2 christos #define EP (SP + 1) 1031 1.1.1.2 christos { 0, 0, NULL, NULL, V850_OPERAND_EP, BFD_RELOC_NONE }, 1032 1.1.1.2 christos 1033 1.1.1.2 christos /* A list of registers in a prepare/dispose instruction. */ 1034 1.1 skrll #define LIST12 (EP + 1) 1035 1.1 skrll { -1, 0xffe00001, NULL, NULL, V850E_OPERAND_REG_LIST, BFD_RELOC_NONE }, 1036 1.1.1.4 christos 1037 1.1.1.2 christos /* System register operands. */ 1038 1.1 skrll #define OLDSR1 (LIST12 + 1) 1039 1.1.1.4 christos { 5, 0, NULL, NULL, V850_OPERAND_SRG, BFD_RELOC_NONE }, 1040 1.1.1.4 christos 1041 1.1.1.4 christos #define SR1 (OLDSR1 + 1) 1042 1.1.1.2 christos { 0, 0, insert_SRSEL1, extract_SRSEL1, V850_OPERAND_SRG, BFD_RELOC_NONE }, 1043 1.1.1.4 christos 1044 1.1.1.2 christos /* The R2 field as a system register. */ 1045 1.1 skrll #define OLDSR2 (SR1 + 1) 1046 1.1.1.4 christos { 5, 11, NULL, NULL, V850_OPERAND_SRG, BFD_RELOC_NONE }, 1047 1.1.1.4 christos 1048 1.1.1.4 christos #define SR2 (OLDSR2 + 1) 1049 1.1.1.2 christos { 0, 0, insert_SRSEL2, extract_SRSEL2, V850_OPERAND_SRG, BFD_RELOC_NONE }, 1050 1.1.1.2 christos 1051 1.1.1.2 christos /* FPU CC bit position. */ 1052 1.1.1.2 christos #define FFF (SR2 + 1) 1053 1.1.1.2 christos { 3, 17, NULL, NULL, 0, BFD_RELOC_NONE }, 1054 1.1.1.2 christos 1055 1.1.1.2 christos /* The 4 bit condition code in a setf instruction. */ 1056 1.1.1.2 christos #define CCCC (FFF + 1) 1057 1.1.1.2 christos { 4, 0, NULL, NULL, V850_OPERAND_CC, BFD_RELOC_NONE }, 1058 1.1.1.2 christos 1059 1.1.1.2 christos /* Condition code in adf,sdf. */ 1060 1.1 skrll #define CCCC_NOTSA (CCCC + 1) 1061 1.1.1.2 christos { 4, 17, NULL, NULL, V850_OPERAND_CC|V850_NOT_SA, BFD_RELOC_NONE }, 1062 1.1.1.2 christos 1063 1.1.1.2 christos /* Condition code in conditional moves. */ 1064 1.1 skrll #define MOVCC (CCCC_NOTSA + 1) 1065 1.1.1.2 christos { 4, 17, NULL, NULL, V850_OPERAND_CC, BFD_RELOC_NONE }, 1066 1.1.1.2 christos 1067 1.1.1.2 christos /* Condition code in FPU. */ 1068 1.1.1.2 christos #define FLOAT_CCCC (MOVCC + 1) 1069 1.1.1.2 christos { 4, 27, NULL, NULL, V850_OPERAND_FLOAT_CC, BFD_RELOC_NONE }, 1070 1.1.1.2 christos 1071 1.1.1.2 christos /* The 1 bit immediate field in format C insn. */ 1072 1.1.1.2 christos #define VI1 (FLOAT_CCCC + 1) 1073 1.1.1.2 christos { 1, 3, NULL, NULL, 0, BFD_RELOC_NONE }, 1074 1.1.1.2 christos 1075 1.1.1.2 christos /* The 1 bit immediate field in format C insn. */ 1076 1.1.1.2 christos #define VC1 (VI1 + 1) 1077 1.1.1.2 christos { 1, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 1078 1.1.1.2 christos 1079 1.1.1.2 christos /* The 2 bit immediate field in format C insn. */ 1080 1.1.1.2 christos #define DI2 (VC1 + 1) 1081 1.1.1.2 christos { 2, 17, NULL, NULL, 0, BFD_RELOC_NONE }, 1082 1.1.1.2 christos 1083 1.1.1.2 christos /* The 2 bit immediate field in format C insn. */ 1084 1.1.1.2 christos #define VI2 (DI2 + 1) 1085 1.1.1.2 christos { 2, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 1086 1.1.1.2 christos 1087 1.1.1.2 christos /* The 2 bit immediate field in format C - DUP insn. */ 1088 1.1 skrll #define VI2DUP (VI2 + 1) 1089 1.1.1.2 christos { 2, 2, NULL, NULL, 0, BFD_RELOC_NONE }, 1090 1.1.1.2 christos 1091 1.1.1.2 christos /* The 3 bit immediate field in format 8 insn. */ 1092 1.1 skrll #define B3 (VI2DUP + 1) 1093 1.1.1.2 christos { 3, 11, NULL, NULL, 0, BFD_RELOC_NONE }, 1094 1.1.1.2 christos 1095 1.1.1.2 christos /* The 3 bit immediate field in format C insn. */ 1096 1.1.1.2 christos #define DI3 (B3 + 1) 1097 1.1.1.2 christos { 3, 17, NULL, NULL, 0, BFD_RELOC_NONE }, 1098 1.1.1.2 christos 1099 1.1.1.2 christos /* The 3 bit immediate field in format C insn. */ 1100 1.1.1.2 christos #define I3U (DI3 + 1) 1101 1.1.1.2 christos { 3, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 1102 1.1.1.2 christos 1103 1.1.1.2 christos /* The 4 bit immediate field in format C insn. */ 1104 1.1.1.2 christos #define I4U (I3U + 1) 1105 1.1.1.2 christos { 4, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 1106 1.1.1.2 christos 1107 1.1.1.2 christos /* The 4 bit immediate field in fetrap. */ 1108 1.1.1.2 christos #define I4U_NOTIMM0 (I4U + 1) 1109 1.1.1.2 christos { 4, 11, NULL, NULL, V850_NOT_IMM0, BFD_RELOC_NONE }, 1110 1.1.1.2 christos 1111 1.1.1.2 christos /* The unsigned disp4 field in a sld.bu. */ 1112 1.1 skrll #define D4U (I4U_NOTIMM0 + 1) 1113 1.1.1.2 christos { 4, 0, NULL, NULL, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_4_4_OFFSET }, 1114 1.1.1.2 christos 1115 1.1.1.2 christos /* The imm5 field in a format 2 insn. */ 1116 1.1 skrll #define I5 (D4U + 1) 1117 1.1.1.2 christos { 5, 0, NULL, NULL, V850_OPERAND_SIGNED, BFD_RELOC_NONE }, 1118 1.1.1.2 christos 1119 1.1.1.2 christos /* The imm5 field in a format 11 insn. */ 1120 1.1 skrll #define I5DIV1 (I5 + 1) 1121 1.1.1.2 christos { 5, 0, insert_i5div1, extract_i5div1, 0, BFD_RELOC_NONE }, 1122 1.1.1.2 christos 1123 1.1 skrll #define I5DIV2 (I5DIV1 + 1) 1124 1.1.1.2 christos { 5, 0, insert_i5div2, extract_i5div2, 0, BFD_RELOC_NONE }, 1125 1.1.1.2 christos 1126 1.1.1.2 christos #define I5DIV3 (I5DIV2 + 1) 1127 1.1.1.2 christos { 5, 0, insert_i5div3, extract_i5div3, 0, BFD_RELOC_NONE }, 1128 1.1.1.2 christos 1129 1.1.1.2 christos /* The unsigned imm5 field in a format 2 insn. */ 1130 1.1.1.2 christos #define I5U (I5DIV3 + 1) 1131 1.1.1.2 christos { 5, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 1132 1.1.1.2 christos 1133 1.1.1.2 christos /* The imm5 field in a prepare/dispose instruction. */ 1134 1.1.1.2 christos #define IMM5 (I5U + 1) 1135 1.1.1.2 christos { 5, 1, NULL, NULL, 0, BFD_RELOC_NONE }, 1136 1.1.1.2 christos 1137 1.1.1.2 christos /* The unsigned disp5 field in a sld.hu. */ 1138 1.1.1.2 christos #define D5_4U (IMM5 + 1) 1139 1.1.1.2 christos { 5, 0, insert_d5_4, extract_d5_4, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_4_5_OFFSET }, 1140 1.1.1.2 christos 1141 1.1.1.2 christos /* The IMM6 field in a callt instruction. */ 1142 1.1.1.2 christos #define IMM6 (D5_4U + 1) 1143 1.1.1.2 christos { 6, 0, NULL, NULL, 0, BFD_RELOC_V850_CALLT_6_7_OFFSET }, 1144 1.1.1.2 christos 1145 1.1.1.2 christos /* The signed disp7 field in a format 4 insn. */ 1146 1.1.1.2 christos #define D7U (IMM6 + 1) 1147 1.1.1.2 christos { 7, 0, NULL, NULL, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_7_7_OFFSET }, 1148 1.1.1.2 christos 1149 1.1.1.2 christos /* The unsigned DISP8 field in a format 4 insn. */ 1150 1.1.1.2 christos #define D8_7U (D7U + 1) 1151 1.1.1.2 christos { 8, 0, insert_d8_7, extract_d8_7, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_7_8_OFFSET }, 1152 1.1.1.2 christos 1153 1.1.1.2 christos /* The unsigned DISP8 field in a format 4 insn. */ 1154 1.1.1.2 christos #define D8_6U (D8_7U + 1) 1155 1.1.1.2 christos { 8, 0, insert_d8_6, extract_d8_6, V850_OPERAND_DISP, BFD_RELOC_V850_TDA_6_8_OFFSET }, 1156 1.1.1.2 christos 1157 1.1.1.2 christos /* The unsigned DISP8 field in a format 4 insn. */ 1158 1.1 skrll #define V8 (D8_6U + 1) 1159 1.1 skrll { 8, 0, insert_v8, extract_v8, 0, BFD_RELOC_NONE }, 1160 1.1.1.2 christos 1161 1.1.1.2 christos /* The imm9 field in a multiply word. */ 1162 1.1 skrll #define I9 (V8 + 1) 1163 1.1 skrll { 9, 0, insert_i9, extract_i9, V850_OPERAND_SIGNED, BFD_RELOC_NONE }, 1164 1.1 skrll 1165 1.1.1.2 christos /* The unsigned imm9 field in a multiply word. */ 1166 1.1 skrll #define U9 (I9 + 1) 1167 1.1.1.2 christos { 9, 0, insert_u9, extract_u9, 0, BFD_RELOC_NONE }, 1168 1.1.1.2 christos 1169 1.1.1.2 christos /* The DISP9 field in a format 3 insn. */ 1170 1.1 skrll #define D9 (U9 + 1) 1171 1.1.1.2 christos { 9, 0, insert_d9, extract_d9, V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_9_PCREL }, 1172 1.1.1.2 christos 1173 1.1.1.2 christos /* The DISP9 field in a format 3 insn, relaxable. */ 1174 1.1.1.2 christos #define D9_RELAX (D9 + 1) 1175 1.1.1.2 christos { 9, 0, insert_d9, extract_d9, V850_OPERAND_RELAX | V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_9_PCREL }, 1176 1.1.1.2 christos 1177 1.1.1.2 christos /* The imm16 field in a format 6 insn. */ 1178 1.1 skrll #define I16 (D9_RELAX + 1) 1179 1.1.1.4 christos { 16, 16, NULL, NULL, V850_OPERAND_SIGNED, BFD_RELOC_16 }, 1180 1.1.1.4 christos 1181 1.1.1.4 christos /* The signed 16 bit immediate following a prepare instruction. */ 1182 1.1 skrll #define IMM16LO (I16 + 1) 1183 1.1.1.2 christos { 16, 32, NULL, NULL, V850E_IMMEDIATE16 | V850_OPERAND_SIGNED, BFD_RELOC_LO16 }, 1184 1.1.1.2 christos 1185 1.1.1.2 christos /* The hi 16 bit immediate following a 32 bit instruction. */ 1186 1.1.1.2 christos #define IMM16HI (IMM16LO + 1) 1187 1.1.1.2 christos { 16, 16, NULL, NULL, V850E_IMMEDIATE16HI, BFD_RELOC_HI16 }, 1188 1.1.1.2 christos 1189 1.1.1.2 christos /* The unsigned imm16 in a format 6 insn. */ 1190 1.1 skrll #define I16U (IMM16HI + 1) 1191 1.1.1.2 christos { 16, 16, NULL, NULL, 0, BFD_RELOC_16 }, 1192 1.1.1.2 christos 1193 1.1.1.8 christos /* The disp16 field in a format 8 insn. */ 1194 1.1 skrll #define D16 (I16U + 1) 1195 1.1.1.2 christos { 16, 16, NULL, NULL, V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_LO16_SPLIT_OFFSET }, 1196 1.1.1.2 christos 1197 1.1.1.2 christos /* The disp16 field in an format 7 unsigned byte load insn. */ 1198 1.1.1.2 christos #define D16_16 (D16 + 1) 1199 1.1.1.2 christos { 16, 0, insert_d16_16, extract_d16_16, V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_16_SPLIT_OFFSET }, 1200 1.1.1.2 christos 1201 1.1.1.2 christos /* The disp16 field in a format 6 insn. */ 1202 1.1.1.2 christos #define D16_15 (D16_16 + 1) 1203 1.1.1.2 christos { 16, 0, insert_d16_15, extract_d16_15, V850_OPERAND_SIGNED | V850_OPERAND_DISP , BFD_RELOC_V850_16_S1 }, 1204 1.1.1.2 christos 1205 1.1.1.4 christos /* The unsigned DISP16 field in a format 7 insn. */ 1206 1.1.1.2 christos #define D16_LOOP (D16_15 + 1) 1207 1.1.1.2 christos { 16, 0, insert_u16_loop, extract_u16_loop, V850_OPERAND_RELAX | V850_OPERAND_DISP | V850_PCREL | V850_INVERSE_PCREL, BFD_RELOC_V850_16_PCREL }, 1208 1.1.1.2 christos 1209 1.1.1.2 christos /* The DISP17 field in a format 7 insn. */ 1210 1.1.1.2 christos #define D17_16 (D16_LOOP + 1) 1211 1.1.1.2 christos { 17, 0, insert_d17_16, extract_d17_16, V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_17_PCREL }, 1212 1.1.1.2 christos 1213 1.1.1.2 christos /* The DISP22 field in a format 4 insn, relaxable. 1214 1.1.1.2 christos This _must_ follow D9_RELAX; the assembler assumes that the longer 1215 1.1.1.2 christos version immediately follows the shorter version for relaxing. */ 1216 1.1.1.2 christos #define D22 (D17_16 + 1) 1217 1.1.1.2 christos { 22, 0, insert_d22, extract_d22, V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_22_PCREL }, 1218 1.1.1.2 christos 1219 1.1.1.2 christos #define D23 (D22 + 1) 1220 1.1.1.4 christos { 23, 0, insert_d23, extract_d23, V850E_IMMEDIATE23 | V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_23 }, 1221 1.1.1.4 christos 1222 1.1.1.4 christos #define D23_ALIGN1 (D23 + 1) 1223 1.1.1.2 christos { 23, 0, insert_d23_align1, extract_d23, V850E_IMMEDIATE23 | V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_23 }, 1224 1.1.1.4 christos 1225 1.1.1.2 christos /* The 32 bit immediate following a 32 bit instruction. */ 1226 1.1.1.2 christos #define IMM32 (D23_ALIGN1 + 1) 1227 1.1.1.2 christos { 32, 32, NULL, NULL, V850E_IMMEDIATE32, BFD_RELOC_32 }, 1228 1.1.1.2 christos 1229 1.1.1.2 christos #define D32_31 (IMM32 + 1) 1230 1.1.1.2 christos { 32, 32, NULL, NULL, V850E_IMMEDIATE32 | V850_OPERAND_SIGNED | V850_OPERAND_DISP, BFD_RELOC_V850_32_ABS }, 1231 1.1.1.2 christos 1232 1.1 skrll #define D32_31_PCREL (D32_31 + 1) 1233 1.1.1.4 christos { 32, 32, NULL, NULL, V850E_IMMEDIATE32 | V850_OPERAND_SIGNED | V850_OPERAND_DISP | V850_PCREL, BFD_RELOC_V850_32_PCREL }, 1234 1.1.1.4 christos 1235 1.1.1.4 christos #define POS_U (D32_31_PCREL + 1) 1236 1.1.1.4 christos { 0, 0, insert_POS, extract_POS_U, 0, BFD_RELOC_NONE }, 1237 1.1.1.4 christos 1238 1.1.1.4 christos #define POS_M (POS_U + 1) 1239 1.1.1.4 christos { 0, 0, insert_POS, extract_POS_L, 0, BFD_RELOC_NONE }, 1240 1.1.1.4 christos 1241 1.1.1.4 christos #define POS_L (POS_M + 1) 1242 1.1.1.4 christos { 0, 0, insert_POS, extract_POS_L, 0, BFD_RELOC_NONE }, 1243 1.1.1.4 christos 1244 1.1.1.4 christos #define WIDTH_U (POS_L + 1) 1245 1.1.1.4 christos { 0, 0, insert_WIDTH, extract_WIDTH_U, 0, BFD_RELOC_NONE }, 1246 1.1.1.4 christos 1247 1.1.1.4 christos #define WIDTH_M (WIDTH_U + 1) 1248 1.1.1.4 christos { 0, 0, insert_WIDTH, extract_WIDTH_M, 0, BFD_RELOC_NONE }, 1249 1.1.1.4 christos 1250 1.1.1.4 christos #define WIDTH_L (WIDTH_M + 1) 1251 1.1.1.4 christos { 0, 0, insert_WIDTH, extract_WIDTH_L, 0, BFD_RELOC_NONE }, 1252 1.1.1.4 christos 1253 1.1.1.4 christos #define SELID (WIDTH_L + 1) 1254 1.1.1.4 christos { 5, 27, insert_SELID, extract_SELID, 0, BFD_RELOC_NONE }, 1255 1.1.1.4 christos 1256 1.1.1.4 christos #define RIE_IMM5 (SELID + 1) 1257 1.1.1.4 christos { 5, 11, NULL, NULL, 0, BFD_RELOC_NONE }, 1258 1.1.1.4 christos 1259 1.1.1.4 christos #define RIE_IMM4 (RIE_IMM5 + 1) 1260 1.1.1.4 christos { 4, 0, NULL, NULL, 0, BFD_RELOC_NONE }, 1261 1.1.1.4 christos 1262 1.1.1.4 christos #define VECTOR8 (RIE_IMM4 + 1) 1263 1.1.1.4 christos { 0, 0, insert_VECTOR8, extract_VECTOR8, 0, BFD_RELOC_NONE }, 1264 1.1.1.4 christos 1265 1.1.1.4 christos #define VECTOR5 (VECTOR8 + 1) 1266 1.1.1.4 christos { 0, 0, insert_VECTOR5, extract_VECTOR5, 0, BFD_RELOC_NONE }, 1267 1.1.1.4 christos 1268 1.1.1.4 christos #define VR1 (VECTOR5 + 1) 1269 1.1.1.4 christos { 5, 0, NULL, NULL, V850_OPERAND_VREG, BFD_RELOC_NONE }, 1270 1.1.1.4 christos 1271 1.1.1.4 christos #define VR2 (VR1 + 1) 1272 1.1.1.4 christos { 5, 11, NULL, NULL, V850_OPERAND_VREG, BFD_RELOC_NONE }, 1273 1.1.1.4 christos 1274 1.1.1.4 christos #define CACHEOP (VR2 + 1) 1275 1.1.1.4 christos { 0, 0, insert_CACHEOP, extract_CACHEOP, V850_OPERAND_CACHEOP, BFD_RELOC_NONE }, 1276 1.1.1.4 christos 1277 1.1.1.4 christos #define PREFOP (CACHEOP + 1) 1278 1.1.1.4 christos { 0, 0, insert_PREFOP, extract_PREFOP, V850_OPERAND_PREFOP, BFD_RELOC_NONE }, 1279 1.1.1.4 christos 1280 1.1 skrll #define IMM10U (PREFOP + 1) 1281 1.1 skrll { 0, 0, insert_IMM10U, extract_IMM10U, 0, BFD_RELOC_NONE }, 1282 1.1 skrll }; 1283 1.1 skrll 1284 1.1 skrll 1285 1.1 skrll /* Reg - Reg instruction format (Format I). */ 1287 1.1 skrll #define IF1 {R1, R2} 1288 1.1 skrll 1289 1.1 skrll /* Imm - Reg instruction format (Format II). */ 1290 1.1 skrll #define IF2 {I5, R2} 1291 1.1 skrll 1292 1.1 skrll /* Conditional branch instruction format (Format III). */ 1293 1.1 skrll #define IF3 {D9_RELAX} 1294 1.1 skrll 1295 1.1 skrll /* 3 operand instruction (Format VI). */ 1296 1.1 skrll #define IF6 {I16, R1, R2} 1297 1.1 skrll 1298 1.1.1.2 christos /* 3 operand instruction (Format VI). */ 1299 1.1.1.2 christos #define IF6U {I16U, R1, R2} 1300 1.1 skrll 1301 1.1 skrll /* Conditional branch instruction format (Format VII). */ 1302 1.1 skrll #define IF7 {D17_16} 1303 1.1 skrll 1304 1.1 skrll 1305 1.1 skrll /* The opcode table. 1307 1.1 skrll 1308 1.1 skrll The format of the opcode table is: 1309 1.1 skrll 1310 1.1 skrll NAME OPCODE MASK { OPERANDS } MEMOP PROCESSOR 1311 1.1 skrll 1312 1.1 skrll NAME is the name of the instruction. 1313 1.1 skrll OPCODE is the instruction opcode. 1314 1.1 skrll MASK is the opcode mask; this is used to tell the disassembler 1315 1.1 skrll which bits in the actual opcode must match OPCODE. 1316 1.1 skrll OPERANDS is the list of operands. 1317 1.1 skrll MEMOP specifies which operand (if any) is a memory operand. 1318 1.1 skrll PROCESSORS specifies which CPU(s) support the opcode. 1319 1.1 skrll 1320 1.1 skrll The disassembler reads the table in order and prints the first 1321 1.1 skrll instruction which matches, so this table is sorted to put more 1322 1.1 skrll specific instructions before more general instructions. It is also 1323 1.1 skrll sorted by major opcode. 1324 1.1 skrll 1325 1.1 skrll The table is also sorted by name. This is used by the assembler. 1326 1.1 skrll When parsing an instruction the assembler finds the first occurance 1327 1.1 skrll of the name of the instruciton in this table and then attempts to 1328 1.1 skrll match the instruction's arguments with description of the operands 1329 1.1 skrll associated with the entry it has just found in this table. If the 1330 1.1 skrll match fails the assembler looks at the next entry in this table. 1331 1.1 skrll If that entry has the same name as the previous entry, then it 1332 1.1 skrll tries to match the instruction against that entry and so on. This 1333 1.1 skrll is how the assembler copes with multiple, different formats of the 1334 1.1.1.2 christos same instruction. */ 1335 1.1 skrll 1336 1.1 skrll const struct v850_opcode v850_opcodes[] = 1337 1.1.1.2 christos { 1338 1.1 skrll /* Standard instructions. */ 1339 1.1 skrll { "add", OP (0x0e), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1340 1.1.1.4 christos { "add", OP (0x12), OP_MASK, IF2, 0, PROCESSOR_ALL }, 1341 1.1 skrll 1342 1.1 skrll { "addi", OP (0x30), OP_MASK, IF6, 0, PROCESSOR_ALL }, 1343 1.1.1.2 christos 1344 1.1 skrll { "adf", two (0x07e0, 0x03a0), two (0x07e0, 0x07e1), {CCCC_NOTSA, R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1345 1.1 skrll 1346 1.1 skrll { "and", OP (0x0a), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1347 1.1 skrll 1348 1.1.1.2 christos { "andi", OP (0x36), OP_MASK, IF6U, 0, PROCESSOR_ALL }, 1349 1.1 skrll 1350 1.1.1.2 christos /* Signed integer. */ 1351 1.1 skrll { "bge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1352 1.1 skrll { "bgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1353 1.1 skrll { "ble", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1354 1.1.1.2 christos { "blt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1355 1.1 skrll /* Unsigned integer. */ 1356 1.1 skrll { "bh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1357 1.1 skrll { "bl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1358 1.1 skrll { "bnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1359 1.1 skrll { "bnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1360 1.1 skrll /* Common. */ 1361 1.1.1.2 christos { "be", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1362 1.1.1.2 christos { "bne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1363 1.1 skrll /* Others. */ 1364 1.1.1.2 christos { "bc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1365 1.1 skrll { "bf", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1366 1.1.1.2 christos { "bn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1367 1.1 skrll { "bnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1368 1.1 skrll { "bnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1369 1.1.1.2 christos { "bnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1370 1.1.1.2 christos { "bp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1371 1.1.1.2 christos { "br", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1372 1.1 skrll { "bsa", BOP (0xd), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1373 1.1.1.4 christos { "bt", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1374 1.1.1.4 christos { "bv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1375 1.1.1.4 christos { "bz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1376 1.1.1.4 christos 1377 1.1.1.4 christos /* Signed integer. */ 1378 1.1.1.4 christos { "bge", two (0x07ee, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1379 1.1.1.4 christos { "bgt", two (0x07ef, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1380 1.1.1.4 christos { "ble", two (0x07e7, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1381 1.1.1.4 christos { "blt", two (0x07e6, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1382 1.1.1.4 christos /* Unsigned integer. */ 1383 1.1.1.4 christos { "bh", two (0x07eb, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1384 1.1.1.4 christos { "bl", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1385 1.1.1.4 christos { "bnh", two (0x07e3, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1386 1.1.1.4 christos { "bnl", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1387 1.1.1.4 christos /* Common. */ 1388 1.1.1.4 christos { "be", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1389 1.1.1.4 christos { "bne", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1390 1.1.1.4 christos /* Others. */ 1391 1.1.1.4 christos { "bc", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1392 1.1.1.4 christos { "bf", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1393 1.1.1.4 christos { "bn", two (0x07e4, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1394 1.1.1.4 christos { "bnc", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1395 1.1.1.4 christos { "bnv", two (0x07e8, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1396 1.1.1.4 christos { "bnz", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1397 1.1.1.4 christos { "bp", two (0x07ec, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1398 1.1.1.4 christos { "br", two (0x07e5, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1399 1.1.1.4 christos { "bsa", two (0x07ed, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1400 1.1.1.4 christos { "bt", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1401 1.1.1.4 christos { "bv", two (0x07e0, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1402 1.1.1.4 christos { "bz", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP }, 1403 1.1.1.4 christos /* Bcond disp17 Gas local alias(not defined in spec). */ 1404 1.1.1.4 christos 1405 1.1.1.4 christos /* Signed integer. */ 1406 1.1.1.4 christos { "bge17", two (0x07ee, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1407 1.1.1.4 christos { "bgt17", two (0x07ef, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1408 1.1.1.4 christos { "ble17", two (0x07e7, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1409 1.1.1.4 christos { "blt17", two (0x07e6, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1410 1.1.1.4 christos /* Unsigned integer. */ 1411 1.1.1.4 christos { "bh17", two (0x07eb, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1412 1.1.1.4 christos { "bl17", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1413 1.1.1.4 christos { "bnh17", two (0x07e3, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1414 1.1.1.4 christos { "bnl17", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1415 1.1.1.4 christos /* Common. */ 1416 1.1.1.4 christos { "be17", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1417 1.1.1.4 christos { "bne17", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1418 1.1.1.4 christos /* Others. */ 1419 1.1.1.4 christos { "bc17", two (0x07e1, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1420 1.1.1.4 christos { "bf17", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1421 1.1.1.4 christos { "bn17", two (0x07e4, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1422 1.1.1.4 christos { "bnc17", two (0x07e9, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1423 1.1.1.4 christos { "bnv17", two (0x07e8, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1424 1.1.1.4 christos { "bnz17", two (0x07ea, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1425 1.1.1.4 christos { "bp17", two (0x07ec, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1426 1.1.1.4 christos { "br17", two (0x07e5, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1427 1.1.1.4 christos { "bsa17", two (0x07ed, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1428 1.1.1.2 christos { "bt17", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1429 1.1 skrll { "bv17", two (0x07e0, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1430 1.1.1.2 christos { "bz17", two (0x07e2, 0x0001), two (0xffef, 0x0001), IF7, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1431 1.1 skrll 1432 1.1.1.4 christos { "bsh", two (0x07e0, 0x0342), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 }, 1433 1.1.1.4 christos 1434 1.1.1.4 christos { "bsw", two (0x07e0, 0x0340), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 }, 1435 1.1.1.4 christos 1436 1.1.1.4 christos /* v850e3v5 bitfield instructions. */ 1437 1.1.1.4 christos { "bins", two (0x07e0, 0x0090), two (0x07e0, 0x07f1), {R1, POS_U, WIDTH_U, R2}, 0, PROCESSOR_V850E3V5_UP }, 1438 1.1.1.4 christos { "bins", two (0x07e0, 0x00b0), two (0x07e0, 0x07f1), {R1, POS_M, WIDTH_M, R2}, 0, PROCESSOR_V850E3V5_UP }, 1439 1.1.1.4 christos { "bins", two (0x07e0, 0x00d0), two (0x07e0, 0x07f1), {R1, POS_L, WIDTH_L, R2}, 0, PROCESSOR_V850E3V5_UP }, 1440 1.1.1.4 christos /* Gas local alias(not defined in spec). */ 1441 1.1.1.4 christos { "binsu",two (0x07e0, 0x0090), two (0x07e0, 0x07f1), {R1, POS_U, WIDTH_U, R2}, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1442 1.1.1.4 christos { "binsm",two (0x07e0, 0x00b0), two (0x07e0, 0x07f1), {R1, POS_M, WIDTH_M, R2}, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1443 1.1.1.2 christos { "binsl",two (0x07e0, 0x00d0), two (0x07e0, 0x07f1), {R1, POS_L, WIDTH_L, R2}, 0, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1444 1.1.1.2 christos 1445 1.1.1.4 christos { "cache", two (0xe7e0, 0x0160), two (0xe7e0, 0x07ff), {CACHEOP, R1}, 2, PROCESSOR_V850E3V5_UP }, 1446 1.1.1.2 christos 1447 1.1.1.2 christos { "callt", one (0x0200), one (0xffc0), {IMM6}, 0, PROCESSOR_NOT_V850 }, 1448 1.1.1.2 christos 1449 1.1.1.2 christos { "caxi", two (0x07e0, 0x00ee), two (0x07e0, 0x07ff), {R1, R2, R3}, 1, PROCESSOR_V850E2_UP }, 1450 1.1.1.2 christos 1451 1.1.1.2 christos { "clr1", two (0x87c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL }, 1452 1.1.1.2 christos { "clr1", two (0x07e0, 0x00e4), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 }, 1453 1.1.1.2 christos 1454 1.1.1.2 christos { "cmov", two (0x07e0, 0x0320), two (0x07e0, 0x07e1), {MOVCC, R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1455 1.1.1.2 christos { "cmov", two (0x07e0, 0x0300), two (0x07e0, 0x07e1), {MOVCC, I5, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1456 1.1.1.2 christos 1457 1.1.1.2 christos { "cmp", OP (0x0f), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1458 1.1.1.4 christos { "cmp", OP (0x13), OP_MASK, IF2, 0, PROCESSOR_ALL }, 1459 1.1.1.4 christos 1460 1.1.1.4 christos { "ctret", two (0x07e0, 0x0144), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 }, 1461 1.1.1.4 christos 1462 1.1.1.4 christos { "dbcp", one (0xe840), one (0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1463 1.1.1.4 christos 1464 1.1.1.2 christos { "dbhvtrap", one (0xe040), one (0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1465 1.1.1.2 christos 1466 1.1.1.4 christos { "dbpush", two (0x5fe0, 0x0160), two (0xffe0, 0x07ff), {R1, R3}, 0, PROCESSOR_V850E3V5_UP }, 1467 1.1.1.4 christos 1468 1.1.1.2 christos { "dbret", two (0x07e0, 0x0146), two (0xffff, 0xffff), {0}, 0, PROCESSOR_NOT_V850 }, 1469 1.1.1.2 christos 1470 1.1.1.2 christos { "dbtag", two (0xcfe0, 0x0160), two (0xffe0, 0x07ff), {IMM10U}, 0, PROCESSOR_V850E3V5_UP }, 1471 1.1.1.2 christos 1472 1.1.1.2 christos { "dbtrap", one (0xf840), one (0xffff), {0}, 0, PROCESSOR_NOT_V850 }, 1473 1.1.1.2 christos 1474 1.1.1.2 christos { "di", two (0x07e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, 1475 1.1.1.2 christos 1476 1.1.1.2 christos { "dispose", two (0x0640, 0x0000), two (0xffc0, 0x0000), {IMM5, LIST12, R2_DISPOSE},3, PROCESSOR_NOT_V850 }, 1477 1.1.1.2 christos { "dispose", two (0x0640, 0x0000), two (0xffc0, 0x001f), {IMM5, LIST12}, 0, PROCESSOR_NOT_V850 }, 1478 1.1.1.2 christos 1479 1.1.1.2 christos { "div", two (0x07e0, 0x02c0), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1480 1.1.1.2 christos 1481 1.1.1.2 christos { "divh", two (0x07e0, 0x0280), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1482 1.1.1.2 christos { "divh", OP (0x02), OP_MASK, {R1_NOTR0, R2_NOTR0}, 0, PROCESSOR_ALL }, 1483 1.1.1.2 christos 1484 1.1.1.2 christos { "divhn", two (0x07e0, 0x0280), two (0x07e0, 0x07c3), {I5DIV1, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1485 1.1.1.2 christos 1486 1.1.1.2 christos { "divhu", two (0x07e0, 0x0282), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1487 1.1.1.4 christos 1488 1.1.1.2 christos { "divhun", two (0x07e0, 0x0282), two (0x07e0, 0x07c3), {I5DIV1, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1489 1.1.1.4 christos { "divn", two (0x07e0, 0x02c0), two (0x07e0, 0x07c3), {I5DIV2, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1490 1.1.1.2 christos 1491 1.1.1.2 christos { "divq", two (0x07e0, 0x02fc), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1492 1.1.1.2 christos 1493 1.1.1.2 christos { "divqu", two (0x07e0, 0x02fe), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1494 1.1.1.2 christos 1495 1.1.1.4 christos { "divu", two (0x07e0, 0x02c2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1496 1.1.1.4 christos 1497 1.1.1.2 christos { "divun", two (0x07e0, 0x02c2), two (0x07e0, 0x07c3), {I5DIV2, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1498 1.1.1.2 christos 1499 1.1.1.4 christos { "dst", two (0x07e0, 0x0134), two (0xfffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1500 1.1.1.2 christos 1501 1.1.1.4 christos { "ei", two (0x87e0, 0x0160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, 1502 1.1.1.2 christos 1503 1.1.1.4 christos { "eiret", two (0x07e0, 0x0148), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E2_UP }, 1504 1.1.1.4 christos 1505 1.1.1.4 christos { "est", two (0x07e0, 0x0132), two (0xfffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1506 1.1.1.2 christos 1507 1.1.1.2 christos { "feret", two (0x07e0, 0x014a), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E2_UP }, 1508 1.1.1.2 christos 1509 1.1.1.4 christos { "fetrap", one (0x0040), one (0x87ff), {I4U_NOTIMM0}, 0, PROCESSOR_V850E2_UP }, 1510 1.1.1.2 christos 1511 1.1.1.2 christos { "halt", two (0x07e0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, 1512 1.1.1.2 christos 1513 1.1.1.4 christos { "hsh", two (0x07e0, 0x0346), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP }, 1514 1.1.1.4 christos 1515 1.1.1.4 christos { "hsw", two (0x07e0, 0x0344), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_NOT_V850 }, 1516 1.1.1.4 christos 1517 1.1.1.2 christos { "hvcall", two (0xd7e0, 0x4160), two (0xffe0, 0x41ff), {VECTOR8}, 0, PROCESSOR_V850E3V5_UP }, 1518 1.1.1.4 christos { "hvtrap", two (0x07e0, 0x0110), two (0xffe0, 0xffff), {VECTOR5}, 0, PROCESSOR_V850E3V5_UP }, 1519 1.1.1.4 christos 1520 1.1.1.4 christos { "jarl", two (0xc7e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3_NOTR0}, 1, PROCESSOR_V850E3V5_UP}, 1521 1.1.1.4 christos { "jarl", two (0x0780, 0x0000), two (0x07c0, 0x0001), {D22, R2_NOTR0}, 0, PROCESSOR_ALL}, 1522 1.1.1.2 christos { "jarl", one (0x02e0), one (0xffe0), {D32_31_PCREL, R1_NOTR0}, 0, PROCESSOR_V850E2_UP }, 1523 1.1.1.4 christos /* Gas local alias (not defined in spec). */ 1524 1.1.1.4 christos { "jarlr", two (0xc7e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3_NOTR0}, 1, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS}, 1525 1.1.1.4 christos /* Gas local alias of jarl imm22 (not defined in spec). */ 1526 1.1.1.2 christos { "jarl22", two (0x0780, 0x0000), two (0x07c0, 0x0001), {D22, R2_NOTR0}, 0, PROCESSOR_ALL | PROCESSOR_OPTION_ALIAS}, 1527 1.1.1.4 christos /* Gas local alias of jarl imm32 (not defined in spec). */ 1528 1.1.1.4 christos { "jarl32", one (0x02e0), one (0xffe0), {D32_31_PCREL, R1_NOTR0}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1529 1.1.1.2 christos { "jarlw", one (0x02e0), one (0xffe0), {D32_31_PCREL, R1_NOTR0}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1530 1.1.1.2 christos 1531 1.1.1.2 christos { "jmp", two (0x06e0, 0x0000), two (0xffe0, 0x0001), {D32_31, R1}, 2, PROCESSOR_V850E3V5_UP }, 1532 1.1.1.2 christos { "jmp", one (0x06e0), one (0xffe0), {D32_31, R1}, 2, PROCESSOR_V850E2 | PROCESSOR_V850E2V3 }, 1533 1.1.1.4 christos { "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL }, 1534 1.1.1.4 christos /* Gas local alias of jmp disp22(not defined in spec). */ 1535 1.1.1.2 christos { "jmp22", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL | PROCESSOR_OPTION_ALIAS }, 1536 1.1.1.2 christos /* Gas local alias of jmp disp32(not defined in spec). */ 1537 1.1.1.4 christos { "jmp32", one (0x06e0), one (0xffe0), {D32_31, R1}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1538 1.1.1.2 christos { "jmpw", one (0x06e0), one (0xffe0), {D32_31, R1}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1539 1.1.1.2 christos 1540 1.1.1.2 christos { "jr", two (0x0780, 0x0000), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL }, 1541 1.1.1.4 christos { "jr", one (0x02e0), one (0xffff), {D32_31_PCREL}, 0, PROCESSOR_V850E2_UP }, 1542 1.1.1.2 christos /* Gas local alias of mov imm22(not defined in spec). */ 1543 1.1.1.2 christos { "jr22", two (0x0780, 0x0000), two (0xffc0, 0x0001), {D22}, 0, PROCESSOR_ALL | PROCESSOR_OPTION_ALIAS }, 1544 1.1 skrll /* Gas local alias of mov imm32(not defined in spec). */ 1545 1.1 skrll { "jr32", one (0x02e0), one (0xffff), {D32_31_PCREL}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1546 1.1 skrll 1547 1.1 skrll /* Alias of bcond (same as CA850). */ 1548 1.1 skrll { "jgt", BOP (0xf), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1549 1.1 skrll { "jge", BOP (0xe), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1550 1.1 skrll { "jlt", BOP (0x6), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1551 1.1 skrll { "jle", BOP (0x7), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1552 1.1 skrll /* Unsigned integer. */ 1553 1.1 skrll { "jh", BOP (0xb), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1554 1.1 skrll { "jnh", BOP (0x3), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1555 1.1 skrll { "jl", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1556 1.1 skrll { "jnl", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1557 1.1 skrll /* Common. */ 1558 1.1 skrll { "je", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1559 1.1 skrll { "jne", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1560 1.1 skrll /* Others. */ 1561 1.1 skrll { "jv", BOP (0x0), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1562 1.1 skrll { "jnv", BOP (0x8), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1563 1.1 skrll { "jn", BOP (0x4), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1564 1.1 skrll { "jp", BOP (0xc), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1565 1.1 skrll { "jc", BOP (0x1), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1566 1.1 skrll { "jnc", BOP (0x9), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1567 1.1 skrll { "jz", BOP (0x2), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1568 1.1.1.4 christos { "jnz", BOP (0xa), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1569 1.1.1.2 christos { "jbr", BOP (0x5), BOP_MASK, IF3, 0, PROCESSOR_ALL }, 1570 1.1.1.2 christos 1571 1.1.1.5 christos 1572 1.1.1.4 christos { "ldacc", two (0x07e0, 0x0bc4), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION }, 1573 1.1.1.2 christos 1574 1.1.1.2 christos { "ld.b", two (0x0700, 0x0000), two (0x07e0, 0x0000), {D16, R1, R2}, 2, PROCESSOR_ALL }, 1575 1.1.1.5 christos { "ld.b", two (0x0780, 0x0005), two (0xffe0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP }, 1576 1.1.1.4 christos { "ld.b23", two (0x0780, 0x0005), two (0x07e0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1577 1.1.1.4 christos 1578 1.1.1.4 christos { "ld.bu", two (0x0780, 0x0001), two (0x07c0, 0x0001), {D16_16, R1, R2_NOTR0}, 2, PROCESSOR_NOT_V850 }, 1579 1.1.1.4 christos { "ld.bu", two (0x07a0, 0x0005), two (0xffe0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP }, 1580 1.1.1.2 christos { "ld.bu23", two (0x07a0, 0x0005), two (0x07e0, 0x000f), {D23, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1581 1.1.1.2 christos 1582 1.1.1.4 christos { "ld.dw", two (0x07a0, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3_EVEN}, 2, PROCESSOR_V850E3V5_UP }, 1583 1.1.1.4 christos { "ld.dw23", two (0x07a0, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3_EVEN}, 2, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1584 1.1.1.2 christos 1585 1.1.1.2 christos { "ld.h", two (0x0720, 0x0000), two (0x07e0, 0x0001), {D16_15, R1, R2}, 2, PROCESSOR_ALL }, 1586 1.1.1.4 christos { "ld.h", two (0x0780, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP }, 1587 1.1.1.4 christos { "ld.h23", two (0x0780, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1588 1.1.1.2 christos 1589 1.1.1.2 christos { "ld.hu", two (0x07e0, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2_NOTR0}, 2, PROCESSOR_NOT_V850 }, 1590 1.1.1.4 christos { "ld.hu", two (0x07a0, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP }, 1591 1.1.1.4 christos { "ld.hu23", two (0x07a0, 0x0007), two (0x07e0, 0x000f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1592 1.1 skrll 1593 1.1.1.4 christos { "ld.w", two (0x0720, 0x0001), two (0x07e0, 0x0001), {D16_15, R1, R2}, 2, PROCESSOR_ALL }, 1594 1.1.1.2 christos { "ld.w", two (0x0780, 0x0009), two (0xffe0, 0x001f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP }, 1595 1.1.1.4 christos { "ld.w23", two (0x0780, 0x0009), two (0x07e0, 0x001f), {D23_ALIGN1, R1, R3}, 2, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1596 1.1.1.4 christos 1597 1.1.1.4 christos { "ldl.w", two (0x07e0, 0x0378), two (0xffe0, 0x07ff), {R1, R3}, 1, PROCESSOR_V850E3V5_UP }, 1598 1.1.1.2 christos 1599 1.1.1.4 christos { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, PROCESSOR_V850E3V5_UP }, 1600 1.1.1.4 christos { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, SR2}, 0, PROCESSOR_V850E3V5_UP }, 1601 1.1.1.4 christos { "ldsr", two (0x07e0, 0x0020), two (0x07e0, 0x07ff), {R1, OLDSR2}, 0, (PROCESSOR_ALL & (~ PROCESSOR_V850E3V5_UP)) }, 1602 1.1.1.2 christos 1603 1.1.1.4 christos { "ldtc.gr", two (0x07e0, 0x0032), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E3V5_UP }, 1604 1.1.1.4 christos { "ldtc.sr", two (0x07e0, 0x0030), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, PROCESSOR_V850E3V5_UP }, 1605 1.1.1.2 christos { "ldtc.sr", two (0x07e0, 0x0030), two (0x07e0, 0x07ff), {R1, SR2}, 0, PROCESSOR_V850E3V5_UP }, 1606 1.1.1.4 christos 1607 1.1.1.4 christos { "ldtc.vr", two (0x07e0, 0x0832), two (0x07e0, 0xffff), {R1, VR2}, 0, PROCESSOR_V850E3V5_UP }, 1608 1.1.1.4 christos { "ldtc.pc", two (0x07e0, 0xf832), two (0x07e0, 0xffff), {R1}, 0, PROCESSOR_V850E3V5_UP }, 1609 1.1.1.4 christos 1610 1.1.1.4 christos { "ldvc.sr", two (0x07e0, 0x0034), two (0x07e0, 0x07ff), {R1, SR2, SELID}, 0, PROCESSOR_V850E3V5_UP }, 1611 1.1.1.4 christos { "ldvc.sr", two (0x07e0, 0x0034), two (0x07e0, 0x07ff), {R1, SR2}, 0, PROCESSOR_V850E3V5_UP }, 1612 1.1.1.4 christos 1613 1.1.1.4 christos { "loop", two (0x06e0, 0x0001), two (0xffe0, 0x0001), {R1, D16_LOOP}, 0, PROCESSOR_V850E3V5_UP }, 1614 1.1.1.4 christos 1615 1.1.1.4 christos { "macacc", two (0x07e0, 0x0bc0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION }, 1616 1.1.1.4 christos 1617 1.1.1.4 christos { "mac", two (0x07e0, 0x03c0), two (0x07e0, 0x0fe1), {R1, R2, R3_EVEN, R4_EVEN}, 0, PROCESSOR_V850E2_UP }, 1618 1.1.1.2 christos 1619 1.1.1.2 christos { "macu", two (0x07e0, 0x03e0), two (0x07e0, 0x0fe1), {R1, R2, R3_EVEN, R4_EVEN}, 0, PROCESSOR_V850E2_UP }, 1620 1.1.1.2 christos 1621 1.1.1.2 christos { "macuacc", two (0x07e0, 0x0bc2), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION }, 1622 1.1.1.2 christos 1623 1.1.1.2 christos { "mov", OP (0x00), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1624 1.1.1.2 christos { "mov", OP (0x10), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL }, 1625 1.1.1.2 christos { "mov", one (0x0620), one (0xffe0), {IMM32, R1}, 0, PROCESSOR_NOT_V850 }, 1626 1.1.1.2 christos /* Gas local alias of mov imm32(not defined in spec). */ 1627 1.1.1.2 christos { "movl", one (0x0620), one (0xffe0), {IMM32, R1}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_ALIAS }, 1628 1.1.1.2 christos 1629 1.1.1.2 christos { "movea", OP (0x31), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1630 1.1.1.2 christos 1631 1.1.1.2 christos { "movhi", OP (0x32), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1632 1.1.1.2 christos 1633 1.1.1.2 christos { "mul", two (0x07e0, 0x0220), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1634 1.1.1.2 christos { "mul", two (0x07e0, 0x0240), two (0x07e0, 0x07c3), {I9, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1635 1.1.1.2 christos 1636 1.1.1.2 christos { "mulh", OP (0x17), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL }, 1637 1.1.1.2 christos { "mulh", OP (0x07), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1638 1.1.1.2 christos 1639 1.1.1.2 christos { "mulhi", OP (0x37), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1640 1.1.1.2 christos 1641 1.1.1.2 christos { "mulu", two (0x07e0, 0x0222), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1642 1.1.1.2 christos { "mulu", two (0x07e0, 0x0242), two (0x07e0, 0x07c3), {U9, R2, R3}, 0, PROCESSOR_NOT_V850 }, 1643 1.1.1.2 christos 1644 1.1.1.2 christos { "nop", one (0x00), one (0xffff), {0}, 0, PROCESSOR_ALL }, 1645 1.1.1.2 christos 1646 1.1.1.2 christos { "not", OP (0x01), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1647 1.1.1.2 christos 1648 1.1.1.2 christos { "not1", two (0x47c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL }, 1649 1.1.1.2 christos { "not1", two (0x07e0, 0x00e2), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 }, 1650 1.1.1.2 christos 1651 1.1.1.4 christos { "or", OP (0x08), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1652 1.1.1.4 christos 1653 1.1.1.4 christos { "ori", OP (0x34), OP_MASK, IF6U, 0, PROCESSOR_ALL }, 1654 1.1.1.4 christos 1655 1.1.1.2 christos { "popsp", two (0x67e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3}, 0, PROCESSOR_V850E3V5_UP }, 1656 1.1.1.2 christos 1657 1.1.1.2 christos { "pref", two (0xdfe0, 0x0160), two (0xffe0, 0x07ff), {PREFOP, R1}, 2, PROCESSOR_V850E3V5_UP }, 1658 1.1.1.2 christos 1659 1.1.1.2 christos { "prepare", two (0x0780, 0x0003), two (0xffc0, 0x001f), {LIST12, IMM5, SP}, 0, PROCESSOR_NOT_V850 }, 1660 1.1.1.2 christos { "prepare", two (0x0780, 0x000b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16LO},0, PROCESSOR_NOT_V850 }, 1661 1.1.1.4 christos { "prepare", two (0x0780, 0x0013), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16HI},0, PROCESSOR_NOT_V850 }, 1662 1.1.1.4 christos { "prepare", two (0x0780, 0x001b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM32}, 0, PROCESSOR_NOT_V850 }, 1663 1.1.1.4 christos { "prepare", two (0x0780, 0x0001), two (0xffc0, 0x001f), {LIST12, IMM5}, 0, PROCESSOR_NOT_V850 }, 1664 1.1.1.4 christos 1665 1.1.1.4 christos { "pushsp", two (0x47e0, 0x0160), two (0xffe0, 0x07ff), {R1, R3}, 0, PROCESSOR_V850E3V5_UP }, 1666 1.1.1.2 christos 1667 1.1.1.2 christos { "rotl", two (0x07e0, 0x00c6), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1668 1.1.1.4 christos { "rotl", two (0x07e0, 0x00c4), two (0x07e0, 0x07ff), {I5U, R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1669 1.1.1.2 christos 1670 1.1.1.2 christos { "reti", two (0x07e0, 0x0140), two (0xffff, 0xffff), {0}, 0, PROCESSOR_ALL }, 1671 1.1.1.2 christos 1672 1.1.1.2 christos { "sar", two (0x07e0, 0x00a2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1673 1.1.1.2 christos { "sar", OP (0x15), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL }, 1674 1.1.1.4 christos { "sar", two (0x07e0, 0x00a0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL }, 1675 1.1.1.2 christos 1676 1.1.1.2 christos { "sasf", two (0x07e0, 0x0200), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_NOT_V850 }, 1677 1.1.1.2 christos 1678 1.1.1.4 christos { "satadd", two (0x07e0, 0x03ba), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1679 1.1.1.2 christos { "satadd", OP (0x11), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL }, 1680 1.1.1.2 christos { "satadd", OP (0x06), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1681 1.1.1.2 christos 1682 1.1.1.2 christos { "satsub", two (0x07e0, 0x039a), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1683 1.1.1.2 christos { "satsub", OP (0x05), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1684 1.1.1.2 christos 1685 1.1.1.4 christos { "satsubi", OP (0x33), OP_MASK, {I16, R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1686 1.1.1.2 christos 1687 1.1.1.4 christos { "satsubr", OP (0x04), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL }, 1688 1.1.1.2 christos 1689 1.1.1.4 christos { "sbf", two (0x07e0, 0x0380), two (0x07e0, 0x07e1), {CCCC_NOTSA, R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1690 1.1.1.2 christos 1691 1.1.1.4 christos { "sch0l", two (0x07e0, 0x0364), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP }, 1692 1.1.1.2 christos 1693 1.1.1.4 christos { "sch0r", two (0x07e0, 0x0360), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP }, 1694 1.1.1.2 christos 1695 1.1.1.2 christos { "sch1l", two (0x07e0, 0x0366), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP }, 1696 1.1.1.2 christos 1697 1.1.1.2 christos { "sch1r", two (0x07e0, 0x0362), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2_UP }, 1698 1.1.1.2 christos 1699 1.1.1.2 christos { "sdivhn", two (0x07e0, 0x0180), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1700 1.1.1.2 christos { "sdivhun", two (0x07e0, 0x0182), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1701 1.1.1.2 christos { "sdivn", two (0x07e0, 0x01c0), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1702 1.1.1.2 christos { "sdivun", two (0x07e0, 0x01c2), two (0x07e0, 0x07c3), {I5DIV3, R1, R2, R3}, 0, PROCESSOR_NOT_V850 | PROCESSOR_OPTION_EXTENSION }, 1703 1.1.1.2 christos 1704 1.1.1.2 christos { "set1", two (0x07c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL }, 1705 1.1.1.4 christos { "set1", two (0x07e0, 0x00e0), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 }, 1706 1.1.1.2 christos 1707 1.1.1.2 christos { "setf", two (0x07e0, 0x0000), two (0x07f0, 0xffff), {CCCC, R2}, 0, PROCESSOR_ALL }, 1708 1.1.1.2 christos 1709 1.1.1.4 christos { "shl", two (0x07e0, 0x00c2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1710 1.1.1.2 christos { "shl", OP (0x16), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL }, 1711 1.1.1.2 christos { "shl", two (0x07e0, 0x00c0), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL }, 1712 1.1.1.2 christos 1713 1.1.1.2 christos { "shr", two (0x07e0, 0x0082), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2_UP }, 1714 1.1.1.2 christos { "shr", OP (0x14), OP_MASK, {I5U, R2}, 0, PROCESSOR_ALL }, 1715 1.1.1.2 christos { "shr", two (0x07e0, 0x0080), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_ALL }, 1716 1.1.1.2 christos 1717 1.1.1.2 christos { "sld.b", one (0x0300), one (0x0780), {D7U, EP, R2}, 2, PROCESSOR_ALL }, 1718 1.1.1.2 christos 1719 1.1.1.2 christos { "sld.bu", one (0x0060), one (0x07f0), {D4U, EP, R2_NOTR0}, 2, PROCESSOR_NOT_V850 }, 1720 1.1.1.2 christos 1721 1.1.1.2 christos { "sld.h", one (0x0400), one (0x0780), {D8_7U,EP, R2}, 2, PROCESSOR_ALL }, 1722 1.1.1.2 christos 1723 1.1.1.4 christos { "sld.hu", one (0x0070), one (0x07f0), {D5_4U,EP, R2_NOTR0}, 2, PROCESSOR_NOT_V850 }, 1724 1.1.1.4 christos 1725 1.1.1.2 christos { "sld.w", one (0x0500), one (0x0781), {D8_6U,EP, R2}, 2, PROCESSOR_ALL }, 1726 1.1.1.2 christos 1727 1.1.1.2 christos { "snooze", two (0x0fe0, 0x0120), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1728 1.1.1.2 christos 1729 1.1.1.2 christos { "sst.b", one (0x0380), one (0x0780), {R2, D7U, EP}, 3, PROCESSOR_ALL }, 1730 1.1.1.2 christos 1731 1.1.1.4 christos { "sst.h", one (0x0480), one (0x0780), {R2, D8_7U,EP}, 3, PROCESSOR_ALL }, 1732 1.1.1.4 christos 1733 1.1.1.2 christos { "sst.w", one (0x0501), one (0x0781), {R2, D8_6U,EP}, 3, PROCESSOR_ALL }, 1734 1.1.1.2 christos 1735 1.1.1.4 christos { "stacch", two (0x07e0, 0x0bca), two (0x07ff, 0xffff), {R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION }, 1736 1.1.1.4 christos { "staccl", two (0x07e0, 0x0bc8), two (0x07ff, 0xffff), {R2}, 0, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_EXTENSION }, 1737 1.1.1.4 christos 1738 1.1.1.4 christos { "st.b", two (0x0740, 0x0000), two (0x07e0, 0x0000), {R2, D16, R1}, 3, PROCESSOR_ALL }, 1739 1.1.1.4 christos { "st.b", two (0x0780, 0x000d), two (0x07e0, 0x000f), {R3, D23, R1}, 3, PROCESSOR_V850E2_UP }, 1740 1.1.1.2 christos { "st.b23", two (0x0780, 0x000d), two (0x07e0, 0x000f), {R3, D23, R1}, 3, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1741 1.1.1.2 christos 1742 1.1.1.4 christos { "st.dw", two (0x07a0, 0x000f), two (0xffe0, 0x001f), {R3_EVEN, D23_ALIGN1, R1}, 3, PROCESSOR_V850E3V5_UP }, 1743 1.1.1.4 christos { "st.dw23", two (0x07a0, 0x000f), two (0xffe0, 0x001f), {R3_EVEN, D23_ALIGN1, R1}, 3, PROCESSOR_V850E3V5_UP | PROCESSOR_OPTION_ALIAS }, 1744 1.1.1.2 christos 1745 1.1.1.2 christos { "st.h", two (0x0760, 0x0000), two (0x07e0, 0x0001), {R2, D16_15, R1}, 3, PROCESSOR_ALL }, 1746 1.1.1.4 christos { "st.h", two (0x07a0, 0x000d), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP }, 1747 1.1.1.4 christos { "st.h23", two (0x07a0, 0x000d), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1748 1.1.1.4 christos 1749 1.1.1.4 christos { "st.w", two (0x0760, 0x0001), two (0x07e0, 0x0001), {R2, D16_15, R1}, 3, PROCESSOR_ALL }, 1750 1.1.1.2 christos { "st.w", two (0x0780, 0x000f), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP }, 1751 1.1.1.4 christos { "st.w23", two (0x0780, 0x000f), two (0x07e0, 0x000f), {R3, D23_ALIGN1, R1}, 3, PROCESSOR_V850E2_UP | PROCESSOR_OPTION_ALIAS }, 1752 1.1.1.4 christos 1753 1.1.1.4 christos { "stc.w", two (0x07e0, 0x037a), two (0xffe0, 0x07ff), {R3, R1}, 2, PROCESSOR_V850E3V5_UP }, 1754 1.1.1.4 christos 1755 1.1.1.4 christos { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0x07ff), {SR1, R2, SELID}, 0, PROCESSOR_V850E3V5_UP }, 1756 1.1.1.4 christos { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0x07ff), {SR1, R2}, 0, PROCESSOR_V850E3V5_UP }, 1757 1.1.1.4 christos { "stsr", two (0x07e0, 0x0040), two (0x07e0, 0x07ff), {OLDSR1, R2}, 0, (PROCESSOR_ALL & (~ PROCESSOR_V850E3V5_UP)) }, 1758 1.1.1.4 christos 1759 1.1.1.4 christos { "sttc.gr", two (0x07e0, 0x0052), two (0x07e0, 0xffff), {R1, R2}, 0, PROCESSOR_V850E3V5_UP }, 1760 1.1.1.4 christos { "sttc.sr", two (0x07e0, 0x0050), two (0x07e0, 0x07ff), {SR1, R2, SELID}, 0, PROCESSOR_V850E3V5_UP }, 1761 1.1.1.4 christos { "sttc.sr", two (0x07e0, 0x0050), two (0x07e0, 0x07ff), {SR1, R2}, 0, PROCESSOR_V850E3V5_UP }, 1762 1.1.1.4 christos { "sttc.vr", two (0x07e0, 0x0852), two (0x07e0, 0xffff), {VR1, R2}, 0, PROCESSOR_V850E3V5_UP }, 1763 1.1 skrll { "sttc.pc", two (0x07e0, 0xf852), two (0x07e0, 0xffff), {R2}, 0, PROCESSOR_V850E3V5_UP }, 1764 1.1.1.2 christos 1765 1.1.1.2 christos { "stvc.sr", two (0x07e0, 0x0054), two (0x07e0, 0x07ff), {SR1, R2, SELID}, 0, PROCESSOR_V850E3V5_UP }, 1766 1.1.1.2 christos { "stvc.sr", two (0x07e0, 0x0054), two (0x07e0, 0x07ff), {SR1, R2}, 0, PROCESSOR_V850E3V5_UP }, 1767 1.1.1.2 christos 1768 1.1.1.2 christos { "sub", OP (0x0d), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1769 1.1.1.2 christos 1770 1.1.1.2 christos { "subr", OP (0x0c), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1771 1.1.1.2 christos 1772 1.1.1.2 christos { "switch", one (0x0040), one (0xffe0), {R1_NOTR0}, 0, PROCESSOR_NOT_V850 }, 1773 1.1.1.2 christos 1774 1.1.1.4 christos { "sxb", one (0x00a0), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 }, 1775 1.1.1.4 christos 1776 1.1.1.4 christos { "sxh", one (0x00e0), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 }, 1777 1.1.1.4 christos 1778 1.1.1.4 christos { "tlbai", two (0x87e0, 0x8960), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1779 1.1.1.4 christos { "tlbr", two (0x87e0, 0xe960), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1780 1.1.1.2 christos { "tlbs", two (0x87e0, 0xc160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1781 1.1.1.2 christos { "tlbvi", two (0x87e0, 0x8160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1782 1.1.1.2 christos { "tlbw", two (0x87e0, 0xe160), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1783 1.1.1.2 christos 1784 1.1.1.2 christos { "trap", two (0x07e0, 0x0100), two (0xffe0, 0xffff), {I5U}, 0, PROCESSOR_ALL }, 1785 1.1.1.2 christos 1786 1.1.1.2 christos { "tst", OP (0x0b), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1787 1.1.1.2 christos 1788 1.1.1.2 christos { "tst1", two (0xc7c0, 0x0000), two (0xc7e0, 0x0000), {B3, D16, R1}, 3, PROCESSOR_ALL }, 1789 1.1.1.2 christos { "tst1", two (0x07e0, 0x00e6), two (0x07e0, 0xffff), {R2, R1}, 3, PROCESSOR_NOT_V850 }, 1790 1.1.1.2 christos 1791 1.1.1.2 christos { "xor", OP (0x09), OP_MASK, IF1, 0, PROCESSOR_ALL }, 1792 1.1.1.2 christos 1793 1.1.1.2 christos { "xori", OP (0x35), OP_MASK, IF6U, 0, PROCESSOR_ALL }, 1794 1.1.1.2 christos 1795 1.1.1.2 christos { "zxb", one (0x0080), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 }, 1796 1.1.1.4 christos 1797 1.1.1.4 christos { "zxh", one (0x00c0), one (0xffe0), {R1}, 0, PROCESSOR_NOT_V850 }, 1798 1.1.1.4 christos 1799 1.1.1.4 christos /* Floating point operation. */ 1800 1.1.1.4 christos { "absf.d", two (0x07e0, 0x0458), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1801 1.1.1.4 christos { "absf.s", two (0x07e0, 0x0448), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1802 1.1.1.4 christos { "addf.d", two (0x07e0, 0x0470), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1803 1.1.1.4 christos { "addf.s", two (0x07e0, 0x0460), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1804 1.1.1.4 christos { "ceilf.dl", two (0x07e2, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1805 1.1.1.4 christos { "ceilf.dul", two (0x07f2, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1806 1.1.1.4 christos { "ceilf.duw", two (0x07f2, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1807 1.1.1.4 christos { "ceilf.dw", two (0x07e2, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1808 1.1.1.4 christos { "ceilf.sl", two (0x07e2, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1809 1.1.1.2 christos { "ceilf.sul", two (0x07f2, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1810 1.1.1.4 christos { "ceilf.suw", two (0x07f2, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1811 1.1.1.4 christos { "ceilf.sw", two (0x07e2, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1812 1.1.1.2 christos { "cmovf.d", two (0x07e0, 0x0410), two (0x0fe1, 0x0ff1), {FFF, R1_EVEN, R2_EVEN, R3_EVEN_NOTR0}, 0, PROCESSOR_V850E2V3_UP }, 1813 1.1.1.4 christos /* Default value for FFF is 0(not defined in spec). */ 1814 1.1.1.4 christos { "cmovf.d", two (0x07e0, 0x0410), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN_NOTR0}, 0, PROCESSOR_V850E2V3_UP }, 1815 1.1.1.4 christos { "cmovf.s", two (0x07e0, 0x0400), two (0x07e0, 0x07f1), {FFF, R1, R2, R3_NOTR0}, 0, PROCESSOR_V850E2V3_UP }, 1816 1.1.1.4 christos /* Default value for FFF is 0(not defined in spec). */ 1817 1.1.1.4 christos { "cmovf.s", two (0x07e0, 0x0400), two (0x07e0, 0x07ff), {R1, R2, R3_NOTR0}, 0, PROCESSOR_V850E2V3_UP }, 1818 1.1.1.4 christos { "cmpf.d", two (0x07e0, 0x0430), two (0x0fe1, 0x87f1), {FLOAT_CCCC, R2_EVEN, R1_EVEN, FFF}, 0, PROCESSOR_V850E2V3_UP }, 1819 1.1.1.4 christos { "cmpf.d", two (0x07e0, 0x0430), two (0x0fe1, 0x87ff), {FLOAT_CCCC, R2_EVEN, R1_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1820 1.1.1.4 christos { "cmpf.s", two (0x07e0, 0x0420), two (0x07e0, 0x87f1), {FLOAT_CCCC, R2, R1, FFF}, 0, PROCESSOR_V850E2V3_UP }, 1821 1.1.1.4 christos { "cmpf.s", two (0x07e0, 0x0420), two (0x07e0, 0x87ff), {FLOAT_CCCC, R2, R1}, 0, PROCESSOR_V850E2V3_UP }, 1822 1.1.1.4 christos { "cvtf.dl", two (0x07e4, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1823 1.1.1.4 christos { "cvtf.ds", two (0x07e3, 0x0452), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1824 1.1.1.4 christos { "cvtf.dul", two (0x07f4, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1825 1.1.1.4 christos { "cvtf.duw", two (0x07f4, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1826 1.1.1.4 christos { "cvtf.dw", two (0x07e4, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1827 1.1.1.4 christos { "cvtf.hs", two (0x07e2, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1828 1.1.1.4 christos { "cvtf.ld", two (0x07e1, 0x0452), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1829 1.1.1.4 christos { "cvtf.ls", two (0x07e1, 0x0442), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1830 1.1.1.4 christos { "cvtf.sd", two (0x07e2, 0x0452), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1831 1.1.1.4 christos { "cvtf.sl", two (0x07e4, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1832 1.1.1.4 christos { "cvtf.sh", two (0x07e3, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1833 1.1.1.4 christos { "cvtf.sul", two (0x07f4, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1834 1.1.1.4 christos { "cvtf.suw", two (0x07f4, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1835 1.1.1.4 christos { "cvtf.sw", two (0x07e4, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1836 1.1.1.4 christos { "cvtf.uld", two (0x07f1, 0x0452), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1837 1.1.1.4 christos { "cvtf.uls", two (0x07f1, 0x0442), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1838 1.1.1.4 christos { "cvtf.uwd", two (0x07f0, 0x0452), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1839 1.1.1.4 christos { "cvtf.uws", two (0x07f0, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1840 1.1.1.4 christos { "cvtf.wd", two (0x07e0, 0x0452), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1841 1.1.1.4 christos { "cvtf.ws", two (0x07e0, 0x0442), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1842 1.1.1.4 christos { "divf.d", two (0x07e0, 0x047e), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1843 1.1.1.4 christos { "divf.s", two (0x07e0, 0x046e), two (0x07e0, 0x07ff), {R1_NOTR0, R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1844 1.1.1.4 christos { "floorf.dl", two (0x07e3, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1845 1.1.1.4 christos { "floorf.dul", two (0x07f3, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1846 1.1.1.4 christos { "floorf.duw", two (0x07f3, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1847 1.1.1.4 christos { "floorf.dw", two (0x07e3, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1848 1.1.1.2 christos { "floorf.sl", two (0x07e3, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1849 1.1.1.4 christos { "floorf.sul", two (0x07f3, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1850 1.1.1.4 christos { "floorf.suw", two (0x07f3, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1851 1.1.1.4 christos { "floorf.sw", two (0x07e3, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1852 1.1.1.4 christos { "maddf.s", two (0x07e0, 0x0500), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 }, 1853 1.1.1.4 christos { "fmaf.s", two (0x07e0, 0x04e0), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1854 1.1.1.2 christos { "maxf.d", two (0x07e0, 0x0478), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1855 1.1.1.4 christos { "maxf.s", two (0x07e0, 0x0468), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1856 1.1.1.4 christos { "minf.d", two (0x07e0, 0x047a), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1857 1.1.1.4 christos { "minf.s", two (0x07e0, 0x046a), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1858 1.1.1.4 christos { "msubf.s", two (0x07e0, 0x0520), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 }, 1859 1.1.1.4 christos { "fmsf.s", two (0x07e0, 0x04e2), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1860 1.1.1.2 christos { "mulf.d", two (0x07e0, 0x0474), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1861 1.1.1.4 christos { "mulf.s", two (0x07e0, 0x0464), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1862 1.1.1.2 christos { "negf.d", two (0x07e1, 0x0458), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1863 1.1.1.4 christos { "negf.s", two (0x07e1, 0x0448), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1864 1.1.1.4 christos { "nmaddf.s", two (0x07e0, 0x0540), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 }, 1865 1.1.1.4 christos { "fnmaf.s", two (0x07e0, 0x04e4), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1866 1.1.1.4 christos { "nmsubf.s", two (0x07e0, 0x0560), two (0x07e0, 0x0761), {R1, R2, R3, R4}, 0, PROCESSOR_V850E2V3 }, 1867 1.1.1.4 christos { "fnmsf.s", two (0x07e0, 0x04e6), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E3V5_UP }, 1868 1.1.1.4 christos { "recipf.d", two (0x07e1, 0x045e), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1869 1.1.1.4 christos { "recipf.s", two (0x07e1, 0x044e), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1870 1.1.1.4 christos 1871 1.1.1.4 christos { "roundf.dl", two (0x07e0, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1872 1.1.1.4 christos { "roundf.dul", two (0x07f0, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1873 1.1.1.4 christos { "roundf.duw", two (0x07f0, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1874 1.1.1.4 christos { "roundf.dw", two (0x07e0, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1875 1.1.1.4 christos { "roundf.sl", two (0x07e0, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1876 1.1.1.4 christos { "roundf.sul", two (0x07f0, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1877 1.1.1.4 christos { "roundf.suw", two (0x07f0, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1878 1.1.1.4 christos { "roundf.sw", two (0x07e0, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_EXTENSION }, 1879 1.1.1.4 christos 1880 1.1.1.4 christos { "rsqrtf.d", two (0x07e2, 0x045e), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1881 1.1.1.4 christos { "rsqrtf.s", two (0x07e2, 0x044e), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1882 1.1.1.4 christos { "sqrtf.d", two (0x07e0, 0x045e), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1883 1.1.1.4 christos { "sqrtf.s", two (0x07e0, 0x044e), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1884 1.1.1.4 christos { "subf.d", two (0x07e0, 0x0472), two (0x0fe1, 0x0fff), {R1_EVEN, R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1885 1.1.1.4 christos { "subf.s", two (0x07e0, 0x0462), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1886 1.1.1.4 christos { "trfsr", two (0x07e0, 0x0400), two (0xffff, 0xfff1), {FFF}, 0, PROCESSOR_V850E2V3_UP }, 1887 1.1.1.4 christos { "trfsr", two (0x07e0, 0x0400), two (0xffff, 0xffff), {0}, 0, PROCESSOR_V850E2V3_UP }, 1888 1.1.1.4 christos { "trncf.dl", two (0x07e1, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1889 1.1.1.4 christos { "trncf.dul", two (0x07f1, 0x0454), two (0x0fff, 0x0fff), {R2_EVEN, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1890 1.1.1.4 christos { "trncf.duw", two (0x07f1, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1891 1.1.1.4 christos { "trncf.dw", two (0x07e1, 0x0450), two (0x0fff, 0x07ff), {R2_EVEN, R3}, 0, PROCESSOR_V850E2V3_UP }, 1892 1.1.1.2 christos { "trncf.sl", two (0x07e1, 0x0444), two (0x07ff, 0x0fff), {R2, R3_EVEN}, 0, PROCESSOR_V850E2V3_UP }, 1893 1.1.1.2 christos { "trncf.sul", two (0x07f1, 0x0444), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1894 1.1.1.2 christos { "trncf.suw", two (0x07f1, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1895 1.1.1.2 christos { "trncf.sw", two (0x07e1, 0x0440), two (0x07ff, 0x07ff), {R2, R3}, 0, PROCESSOR_V850E2V3_UP }, 1896 1.1.1.4 christos 1897 1.1.1.2 christos /* Special instruction (from gdb) mov 1, r0. */ 1898 1.1.1.4 christos { "breakpoint", one (0x0001), one (0xffff), {UNUSED}, 0, PROCESSOR_ALL }, 1899 1.1.1.4 christos 1900 1.1.1.4 christos { "synci", one (0x001c), one (0xffff), {0}, 0, PROCESSOR_V850E3V5_UP }, 1901 1.1.1.4 christos 1902 1.1.1.4 christos { "synce", one (0x001d), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP }, 1903 1.1.1.4 christos { "syncm", one (0x001e), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP }, 1904 1.1.1.4 christos { "syncp", one (0x001f), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP }, 1905 1.1.1.4 christos { "syscall", two (0xd7e0, 0x0160), two (0xffe0, 0xc7ff), {V8}, 0, PROCESSOR_V850E2V3_UP }, 1906 1.1.1.4 christos /* Alias of syncp. */ 1907 1.1.1.2 christos { "sync", one (0x001f), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP | PROCESSOR_OPTION_ALIAS }, 1908 1.1.1.2 christos { "rmtrap", one (0xf040), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP }, 1909 1.1 skrll { "rie", one (0x0040), one (0xffff), {0}, 0, PROCESSOR_V850E2V3_UP }, 1910 1.1 skrll { "rie", two (0x07f0, 0x0000), two (0x07f0, 0xffff), {RIE_IMM5,RIE_IMM4}, 0, PROCESSOR_V850E2V3_UP }, 1911 1.1 skrll 1912 1.1 skrll { 0, 0, 0, {0}, 0, 0 }, 1913 } ; 1914 1915 const int v850_num_opcodes = 1916 sizeof (v850_opcodes) / sizeof (v850_opcodes[0]); 1917