Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tile-desc_32.h
Go to the documentation of this file.
1 /* TILEPro 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_tilepro_h
22 #define opcode_tilepro_h
23 
24 #include <arch/opcode.h>
25 
26 
27 enum
28 {
29  TILEPRO_MAX_OPERANDS = 5 /* mm */
30 };
31 
32 typedef enum
33 {
430 
431 
432 
433 
434 typedef enum
435 {
442 
443 #define tilepro_is_x_pipeline(p) ((int)(p) <= (int)TILEPRO_PIPELINE_X1)
444 
445 typedef enum
446 {
452 
454 {
455  /* Is this operand a register, immediate or address? */
457 
458  /* The default relocation type for this operand. */
459  signed int default_reloc : 16;
460 
461  /* How many bits is this value? (used for range checking) */
462  unsigned int num_bits : 5;
463 
464  /* Is the value signed? (used for range checking) */
465  unsigned int is_signed : 1;
466 
467  /* Is this operand a source register? */
468  unsigned int is_src_reg : 1;
469 
470  /* Is this operand written? (i.e. is it a destination register) */
471  unsigned int is_dest_reg : 1;
472 
473  /* Is this operand PC-relative? */
474  unsigned int is_pc_relative : 1;
475 
476  /* By how many bits do we right shift the value before inserting? */
477  unsigned int rightshift : 2;
478 
479  /* Return the bits for this operand to be ORed into an existing bundle. */
481 
482  /* Extract this operand and return it. */
483  unsigned int (*extract) (tilepro_bundle_bits bundle);
484 };
485 
486 
487 extern const struct tilepro_operand tilepro_operands[];
488 
489 /* One finite-state machine per pipe for rapid instruction decoding. */
490 extern const unsigned short * const
492 
493 
495 {
496  /* The opcode mnemonic, e.g. "add" */
497  const char *name;
498 
499  /* The enum value for this mnemonic. */
501 
502  /* A bit mask of which of the five pipes this instruction
503  is compatible with:
504  X0 0x01
505  X1 0x02
506  Y0 0x04
507  Y1 0x08
508  Y2 0x10 */
509  unsigned char pipes;
510 
511  /* How many operands are there? */
512  unsigned char num_operands;
513 
514  /* Which register does this write implicitly, or TREG_ZERO if none? */
516 
517  /* Can this be bundled with other instructions (almost always true). */
518  unsigned char can_bundle;
519 
520  /* The description of the operands. Each of these is an
521  * index into the tilepro_operands[] table. */
523 
524 };
525 
526 extern const struct tilepro_opcode tilepro_opcodes[];
527 
528 
529 /* Used for non-textual disassembly into structs. */
531 {
532  const struct tilepro_opcode *opcode;
535 };
536 
537 
538 /* Disassemble a bundle into a struct for machine processing. */
540  unsigned int pc,
543 
544 
545 /* Given a set of bundle bits and a specific pipe, returns which
546  * instruction the bundle contains in that pipe.
547  */
548 extern const struct tilepro_opcode *
550 
551 
552 
553 #endif /* opcode_tilepro_h */