aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2010-06-25 17:02:05 -0400
committerChris Metcalf <cmetcalf@tilera.com>2010-07-06 13:40:56 -0400
commit863fbac67138882b99fc60fcb0ec568bbad9a44f (patch)
tree1457799a6258d9502111f1da45f55b917ace56db /arch/tile/include
parent9f9c0382cda2334b35b40b00f4ed9d6f89f37a7b (diff)
arch/tile: Shrink the tile-opcode files considerably.
The C file (tile-desc_{32,64}.c) was about 300KB before this change, and is now shrunk down to 100K. The original file included support for BFD in the binutils toolchain, which is not necessary in the kernel; the kernel version only needs to include enough support to enable the single-stepper and backtracer. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/tile/include')
-rw-r--r--arch/tile/include/asm/opcode-tile_32.h93
-rw-r--r--arch/tile/include/asm/opcode-tile_64.h93
2 files changed, 2 insertions, 184 deletions
diff --git a/arch/tile/include/asm/opcode-tile_32.h b/arch/tile/include/asm/opcode-tile_32.h
index 90f8dd372531..eda60ecbae3d 100644
--- a/arch/tile/include/asm/opcode-tile_32.h
+++ b/arch/tile/include/asm/opcode-tile_32.h
@@ -28,6 +28,7 @@ typedef enum
28 TILE_OPC_MOVELI_SN, 28 TILE_OPC_MOVELI_SN,
29 TILE_OPC_MOVELIS, 29 TILE_OPC_MOVELIS,
30 TILE_OPC_PREFETCH, 30 TILE_OPC_PREFETCH,
31 TILE_OPC_RAISE,
31 TILE_OPC_ADD, 32 TILE_OPC_ADD,
32 TILE_OPC_ADD_SN, 33 TILE_OPC_ADD_SN,
33 TILE_OPC_ADDB, 34 TILE_OPC_ADDB,
@@ -419,43 +420,6 @@ typedef enum
419 420
420#define TILE_ELF_NAME "elf32-tilepro" 421#define TILE_ELF_NAME "elf32-tilepro"
421 422
422enum
423{
424 TILE_SN_MAX_OPERANDS = 6 /* route */
425};
426
427typedef enum
428{
429 TILE_SN_OPC_BZ,
430 TILE_SN_OPC_BNZ,
431 TILE_SN_OPC_JRR,
432 TILE_SN_OPC_FNOP,
433 TILE_SN_OPC_BLZ,
434 TILE_SN_OPC_NOP,
435 TILE_SN_OPC_MOVEI,
436 TILE_SN_OPC_MOVE,
437 TILE_SN_OPC_BGEZ,
438 TILE_SN_OPC_JR,
439 TILE_SN_OPC_BLEZ,
440 TILE_SN_OPC_BBNS,
441 TILE_SN_OPC_JALRR,
442 TILE_SN_OPC_BPT,
443 TILE_SN_OPC_JALR,
444 TILE_SN_OPC_SHR1,
445 TILE_SN_OPC_BGZ,
446 TILE_SN_OPC_BBS,
447 TILE_SN_OPC_SHL8II,
448 TILE_SN_OPC_ADDI,
449 TILE_SN_OPC_HALT,
450 TILE_SN_OPC_ROUTE,
451 TILE_SN_OPC_NONE
452} tile_sn_mnemonic;
453
454extern const unsigned char tile_sn_route_encode[6 * 6 * 6];
455extern const signed char tile_sn_route_decode[256][3];
456extern const char tile_sn_direction_names[6][5];
457extern const signed char tile_sn_dest_map[6][6];
458
459 423
460static __inline unsigned int 424static __inline unsigned int
461get_BrOff_SN(tile_bundle_bits num) 425get_BrOff_SN(tile_bundle_bits num)
@@ -1387,8 +1351,6 @@ create_UnShOpcodeExtension_Y1(int num)
1387} 1351}
1388 1352
1389 1353
1390typedef unsigned short tile_sn_instruction_bits;
1391
1392 1354
1393typedef enum 1355typedef enum
1394{ 1356{
@@ -1519,41 +1481,10 @@ struct tile_opcode
1519 * index into the tile_operands[] table. */ 1481 * index into the tile_operands[] table. */
1520 unsigned char operands[TILE_NUM_PIPELINE_ENCODINGS][TILE_MAX_OPERANDS]; 1482 unsigned char operands[TILE_NUM_PIPELINE_ENCODINGS][TILE_MAX_OPERANDS];
1521 1483
1522 /* A mask of which bits have predefined values for each pipeline.
1523 * This is useful for disassembly. */
1524 tile_bundle_bits fixed_bit_masks[TILE_NUM_PIPELINE_ENCODINGS];
1525
1526 /* For each bit set in fixed_bit_masks, what the value is for this
1527 * instruction. */
1528 tile_bundle_bits fixed_bit_values[TILE_NUM_PIPELINE_ENCODINGS];
1529}; 1484};
1530 1485
1531extern const struct tile_opcode tile_opcodes[]; 1486extern const struct tile_opcode tile_opcodes[];
1532 1487
1533struct tile_sn_opcode
1534{
1535 /* The opcode mnemonic, e.g. "add" */
1536 const char *name;
1537
1538 /* The enum value for this mnemonic. */
1539 tile_sn_mnemonic mnemonic;
1540
1541 /* How many operands are there? */
1542 unsigned char num_operands;
1543
1544 /* The description of the operands. Each of these is an
1545 * index into the tile_operands[] table. */
1546 unsigned char operands[TILE_SN_MAX_OPERANDS];
1547
1548 /* A mask of which bits have predefined values.
1549 * This is useful for disassembly. */
1550 tile_sn_instruction_bits fixed_bit_mask;
1551
1552 /* For each bit set in fixed_bit_masks, what its value is. */
1553 tile_sn_instruction_bits fixed_bit_values;
1554};
1555
1556extern const struct tile_sn_opcode tile_sn_opcodes[];
1557 1488
1558/* Used for non-textual disassembly into structs. */ 1489/* Used for non-textual disassembly into structs. */
1559struct tile_decoded_instruction 1490struct tile_decoded_instruction
@@ -1571,27 +1502,5 @@ extern int parse_insn_tile(tile_bundle_bits bits,
1571 decoded[TILE_MAX_INSTRUCTIONS_PER_BUNDLE]); 1502 decoded[TILE_MAX_INSTRUCTIONS_PER_BUNDLE]);
1572 1503
1573 1504
1574/* Canonical names of all the registers. */
1575/* ISSUE: This table lives in "tile-dis.c" */
1576extern const char * const tile_register_names[];
1577
1578/* Descriptor for a special-purpose register. */
1579struct tile_spr
1580{
1581 /* The number */
1582 int number;
1583
1584 /* The name */
1585 const char *name;
1586};
1587
1588/* List of all the SPRs; ordered by increasing number. */
1589extern const struct tile_spr tile_sprs[];
1590
1591/* Number of special-purpose registers. */
1592extern const int tile_num_sprs;
1593
1594extern const char *
1595get_tile_spr_name (int num);
1596 1505
1597#endif /* opcode_tile_h */ 1506#endif /* opcode_tile_h */
diff --git a/arch/tile/include/asm/opcode-tile_64.h b/arch/tile/include/asm/opcode-tile_64.h
index 90f8dd372531..eda60ecbae3d 100644
--- a/arch/tile/include/asm/opcode-tile_64.h
+++ b/arch/tile/include/asm/opcode-tile_64.h
@@ -28,6 +28,7 @@ typedef enum
28 TILE_OPC_MOVELI_SN, 28 TILE_OPC_MOVELI_SN,
29 TILE_OPC_MOVELIS, 29 TILE_OPC_MOVELIS,
30 TILE_OPC_PREFETCH, 30 TILE_OPC_PREFETCH,
31 TILE_OPC_RAISE,
31 TILE_OPC_ADD, 32 TILE_OPC_ADD,
32 TILE_OPC_ADD_SN, 33 TILE_OPC_ADD_SN,
33 TILE_OPC_ADDB, 34 TILE_OPC_ADDB,
@@ -419,43 +420,6 @@ typedef enum
419 420
420#define TILE_ELF_NAME "elf32-tilepro" 421#define TILE_ELF_NAME "elf32-tilepro"
421 422
422enum
423{
424 TILE_SN_MAX_OPERANDS = 6 /* route */
425};
426
427typedef enum
428{
429 TILE_SN_OPC_BZ,
430 TILE_SN_OPC_BNZ,
431 TILE_SN_OPC_JRR,
432 TILE_SN_OPC_FNOP,
433 TILE_SN_OPC_BLZ,
434 TILE_SN_OPC_NOP,
435 TILE_SN_OPC_MOVEI,
436 TILE_SN_OPC_MOVE,
437 TILE_SN_OPC_BGEZ,
438 TILE_SN_OPC_JR,
439 TILE_SN_OPC_BLEZ,
440 TILE_SN_OPC_BBNS,
441 TILE_SN_OPC_JALRR,
442 TILE_SN_OPC_BPT,
443 TILE_SN_OPC_JALR,
444 TILE_SN_OPC_SHR1,
445 TILE_SN_OPC_BGZ,
446 TILE_SN_OPC_BBS,
447 TILE_SN_OPC_SHL8II,
448 TILE_SN_OPC_ADDI,
449 TILE_SN_OPC_HALT,
450 TILE_SN_OPC_ROUTE,
451 TILE_SN_OPC_NONE
452} tile_sn_mnemonic;
453
454extern const unsigned char tile_sn_route_encode[6 * 6 * 6];
455extern const signed char tile_sn_route_decode[256][3];
456extern const char tile_sn_direction_names[6][5];
457extern const signed char tile_sn_dest_map[6][6];
458
459 423
460static __inline unsigned int 424static __inline unsigned int
461get_BrOff_SN(tile_bundle_bits num) 425get_BrOff_SN(tile_bundle_bits num)
@@ -1387,8 +1351,6 @@ create_UnShOpcodeExtension_Y1(int num)
1387} 1351}
1388 1352
1389 1353
1390typedef unsigned short tile_sn_instruction_bits;
1391
1392 1354
1393typedef enum 1355typedef enum
1394{ 1356{
@@ -1519,41 +1481,10 @@ struct tile_opcode
1519 * index into the tile_operands[] table. */ 1481 * index into the tile_operands[] table. */
1520 unsigned char operands[TILE_NUM_PIPELINE_ENCODINGS][TILE_MAX_OPERANDS]; 1482 unsigned char operands[TILE_NUM_PIPELINE_ENCODINGS][TILE_MAX_OPERANDS];
1521 1483
1522 /* A mask of which bits have predefined values for each pipeline.
1523 * This is useful for disassembly. */
1524 tile_bundle_bits fixed_bit_masks[TILE_NUM_PIPELINE_ENCODINGS];
1525
1526 /* For each bit set in fixed_bit_masks, what the value is for this
1527 * instruction. */
1528 tile_bundle_bits fixed_bit_values[TILE_NUM_PIPELINE_ENCODINGS];
1529}; 1484};
1530 1485
1531extern const struct tile_opcode tile_opcodes[]; 1486extern const struct tile_opcode tile_opcodes[];
1532 1487
1533struct tile_sn_opcode
1534{
1535 /* The opcode mnemonic, e.g. "add" */
1536 const char *name;
1537
1538 /* The enum value for this mnemonic. */
1539 tile_sn_mnemonic mnemonic;
1540
1541 /* How many operands are there? */
1542 unsigned char num_operands;
1543
1544 /* The description of the operands. Each of these is an
1545 * index into the tile_operands[] table. */
1546 unsigned char operands[TILE_SN_MAX_OPERANDS];
1547
1548 /* A mask of which bits have predefined values.
1549 * This is useful for disassembly. */
1550 tile_sn_instruction_bits fixed_bit_mask;
1551
1552 /* For each bit set in fixed_bit_masks, what its value is. */
1553 tile_sn_instruction_bits fixed_bit_values;
1554};
1555
1556extern const struct tile_sn_opcode tile_sn_opcodes[];
1557 1488
1558/* Used for non-textual disassembly into structs. */ 1489/* Used for non-textual disassembly into structs. */
1559struct tile_decoded_instruction 1490struct tile_decoded_instruction
@@ -1571,27 +1502,5 @@ extern int parse_insn_tile(tile_bundle_bits bits,
1571 decoded[TILE_MAX_INSTRUCTIONS_PER_BUNDLE]); 1502 decoded[TILE_MAX_INSTRUCTIONS_PER_BUNDLE]);
1572 1503
1573 1504
1574/* Canonical names of all the registers. */
1575/* ISSUE: This table lives in "tile-dis.c" */
1576extern const char * const tile_register_names[];
1577
1578/* Descriptor for a special-purpose register. */
1579struct tile_spr
1580{
1581 /* The number */
1582 int number;
1583
1584 /* The name */
1585 const char *name;
1586};
1587
1588/* List of all the SPRs; ordered by increasing number. */
1589extern const struct tile_spr tile_sprs[];
1590
1591/* Number of special-purpose registers. */
1592extern const int tile_num_sprs;
1593
1594extern const char *
1595get_tile_spr_name (int num);
1596 1505
1597#endif /* opcode_tile_h */ 1506#endif /* opcode_tile_h */