Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tile-desc_64.h
Go to the documentation of this file.
1 /* TILE-Gx opcode information.
2  *
3  * Copyright 2011 Tilera Corporation. All Rights Reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation, version 2.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12  * NON INFRINGEMENT. See the GNU General Public License for
13  * more details.
14  *
15  *
16  *
17  *
18  *
19  */
20 
21 #ifndef opcode_tile_h
22 #define opcode_tile_h
23 
24 #include <arch/opcode.h>
25 
26 
27 enum
28 {
29  TILEGX_MAX_OPERANDS = 4 /* bfexts */
30 };
31 
32 typedef enum
33 {
369 
370 
371 
372 typedef enum
373 {
380 
381 #define tilegx_is_x_pipeline(p) ((int)(p) <= (int)TILEGX_PIPELINE_X1)
382 
383 typedef enum
384 {
390 
392 {
393  /* Is this operand a register, immediate or address? */
395 
396  /* The default relocation type for this operand. */
397  signed int default_reloc : 16;
398 
399  /* How many bits is this value? (used for range checking) */
400  unsigned int num_bits : 5;
401 
402  /* Is the value signed? (used for range checking) */
403  unsigned int is_signed : 1;
404 
405  /* Is this operand a source register? */
406  unsigned int is_src_reg : 1;
407 
408  /* Is this operand written? (i.e. is it a destination register) */
409  unsigned int is_dest_reg : 1;
410 
411  /* Is this operand PC-relative? */
412  unsigned int is_pc_relative : 1;
413 
414  /* By how many bits do we right shift the value before inserting? */
415  unsigned int rightshift : 2;
416 
417  /* Return the bits for this operand to be ORed into an existing bundle. */
419 
420  /* Extract this operand and return it. */
421  unsigned int (*extract) (tilegx_bundle_bits bundle);
422 };
423 
424 
425 extern const struct tilegx_operand tilegx_operands[];
426 
427 /* One finite-state machine per pipe for rapid instruction decoding. */
428 extern const unsigned short * const
430 
431 
433 {
434  /* The opcode mnemonic, e.g. "add" */
435  const char *name;
436 
437  /* The enum value for this mnemonic. */
439 
440  /* A bit mask of which of the five pipes this instruction
441  is compatible with:
442  X0 0x01
443  X1 0x02
444  Y0 0x04
445  Y1 0x08
446  Y2 0x10 */
447  unsigned char pipes;
448 
449  /* How many operands are there? */
450  unsigned char num_operands;
451 
452  /* Which register does this write implicitly, or TREG_ZERO if none? */
454 
455  /* Can this be bundled with other instructions (almost always true). */
456  unsigned char can_bundle;
457 
458  /* The description of the operands. Each of these is an
459  * index into the tilegx_operands[] table. */
461 
462 };
463 
464 extern const struct tilegx_opcode tilegx_opcodes[];
465 
466 /* Used for non-textual disassembly into structs. */
468 {
469  const struct tilegx_opcode *opcode;
472 };
473 
474 
475 /* Disassemble a bundle into a struct for machine processing. */
477  unsigned long long pc,
480 
481 
482 
483 #endif /* opcode_tilegx_h */