home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / kaffe-0.2 / kaffe / codegen / instruction.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-12  |  1.6 KB  |  91 lines

  1. /*
  2.  * instruction.h
  3.  * Format of a partially translated instruction.
  4.  *
  5.  * Copyright (c) 1996 Systems Architecture Research Centre,
  6.  *           City University, London, UK.
  7.  *
  8.  * See the file "license.terms" for information on usage and redistribution
  9.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10.  *
  11.  * Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
  12.  */
  13.  
  14. #ifndef __instruction_h
  15. #define __instruction_h
  16.  
  17. #include "gtypes.h"
  18. #include "bytecode.h"
  19.  
  20. struct _nativeReg;
  21.  
  22. typedef enum {
  23.     t_any,
  24.     t_int,
  25.     t_long,
  26.     t_float,
  27.     t_double,
  28.     t_objref,
  29. } operandType;
  30.  
  31. typedef enum {
  32.     i_hard            = 0,
  33.     i_soft            = 1,
  34.     i_sync            = 2,
  35. } encoding;
  36.  
  37. typedef enum {
  38.     i_null            = 0,
  39.     i_endblock        = 1,
  40. } instnType;
  41.  
  42. typedef struct _operand {
  43.     bool            valid;
  44.     operandType        type;
  45.     struct _nativeReg*    reg;
  46. } operand;
  47.  
  48. #define    MAXIN            8
  49. #define    MAXOUT            8
  50. #define    MAXVAL            8
  51.  
  52. typedef struct _instn {
  53.     instnType        type;
  54.     operand            in[MAXIN];
  55.     operand            out[MAXOUT];
  56.     bytecode        op;
  57.     int            value[MAXVAL];
  58.     float            fvalue;
  59.     int            addr;
  60. } instn;
  61.  
  62. struct _methods;
  63.  
  64. void    dumpInstn(struct _methods*);
  65. void    dumpExceptions(struct _methods*);
  66. void    dumpSwitches(struct _methods*);
  67. int    calculateAddresses(struct _methods*);
  68. void    output(instn*, int);
  69.  
  70. typedef struct _nativeInstn {
  71.     int        in;
  72.     int        out;
  73.     int        size;
  74.     encoding    coding;
  75.     void*        func;
  76. } nativeInstn;
  77.  
  78. typedef struct _nativeReg {
  79.         char*           name;
  80.     int        regno;
  81.         int             stack;
  82.         operand*        lastWrite;
  83. } nativeReg;
  84.  
  85. extern nativeInstn instnTable[];
  86.  
  87. /* Include machine specific instruction details */
  88. #include "md.h"
  89.  
  90. #endif
  91.