home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / kaffe-0.5p4-src.tgz / tar.out / contrib / kaffe / kaffevm / jit / basecode.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  3KB  |  111 lines

  1. /* basecode.h
  2.  * Define the base instructions macros.
  3.  *
  4.  * Copyright (c) 1996 Systems Architecture Research Centre,
  5.  *           City University, London, UK.
  6.  *
  7.  * See the file "license.terms" for information on usage and redistribution
  8.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  9.  *
  10.  * Written by Tim Wilkinson <tim@sarc.city.ac.uk>, June 1996.
  11.  */
  12.  
  13. #ifndef __basecode_h
  14. #define __basecode_h
  15.  
  16. extern int argcount;
  17.  
  18. /* -------------------------------------------------------------------- */
  19. /* Branches */
  20.  
  21. #define    ba            0    /* Always */
  22. #define    beq            1    /* Equal */
  23. #define    blt            2    /* Less than */
  24. #define    ble            3    /* Less than or equal */
  25. #define    bgt            4    /* Greater than */
  26. #define    bge            5    /* Greater than or equal */
  27. #define    bne            6    /* Not equal */
  28. #define    bn            7    /* Never */
  29.  
  30. #define    invert_branch(b)    (7-(b))
  31.  
  32. #define    bindirect        8    /* Indirect */
  33.  
  34. /* -------------------------------------------------------------------- */
  35. /* Basic blocks and instructions */
  36.  
  37. #define    start_instruction()    _start_instruction(pc)
  38. #define    start_function()    prologue()
  39. #define    start_basic_block()    _start_basic_block(npc, stackno)
  40. #define    end_basic_block()    _end_basic_block(stackno, tmpslot)
  41. #define    end_function()        epilogue()
  42. #define    start_exception_block()    _start_exception_block(stackno)
  43. #define    cancel_insn(_s)        overwrite_optimise(slot_insn(_s))
  44.  
  45. /* -------------------------------------------------------------------- */
  46. /* Conditional monitors */
  47.  
  48. #define    monitor_enter()        mon_enter(meth, local(0))
  49. #define    monitor_exit()        mon_exit(meth, local(0))
  50.  
  51. /* -------------------------------------------------------------------- */
  52. /* Instruction formats */
  53.  
  54. #define    slot_const_const(dst, src, src2, func, t)            \
  55.     {                                \
  56.         void func(sequence*);                    \
  57.         _slot_const_const((dst), (src), (src2), (func), (t));    \
  58.     }
  59.  
  60. #define    slot_slot_const(dst, src, src2, func, t)            \
  61.     {                                \
  62.         void func(sequence*);                    \
  63.         _slot_slot_const((dst), (src), (src2), (func), (t));    \
  64.     }
  65.  
  66. #define    slot_slot_fconst(dst, src, src2, func, t)            \
  67.     {                                \
  68.         void func(sequence*);                    \
  69.         _slot_slot_fconst((dst), (src), (src2), (func), (t));    \
  70.     }
  71.  
  72. #define    slot_slot_slot(dst, src, src2, func, t)                \
  73.     {                                \
  74.         void func(sequence*);                    \
  75.         _slot_slot_slot((dst), (src), (src2), (func), (t));    \
  76.     }
  77.  
  78. #define    lslot_slot_lconst(dst, src, src2, func, t)            \
  79.     {                                \
  80.         void func(sequence*);                    \
  81.         _lslot_slot_lconst((dst), (src), (src2), (func), (t));    \
  82.     }
  83.  
  84. #define    lslot_slot_fconst(dst, src, src2, func, t)            \
  85.     {                                \
  86.         void func(sequence*);                    \
  87.         _lslot_slot_fconst((dst), (src), (src2), (func), (t));    \
  88.     }
  89.  
  90. #define    lslot_lslot_lslot(dst, src, src2, func, t)            \
  91.     {                                \
  92.         void func(sequence*);                    \
  93.         _lslot_lslot_lslot((dst), (src), (src2), (func), (t));    \
  94.     }
  95.  
  96. #define    lslot_lslot_slot(dst, src, src2, func, t)            \
  97.     {                                \
  98.         void func(sequence*);                    \
  99.         _lslot_lslot_slot((dst), (src), (src2), (func), (t));    \
  100.     }
  101.  
  102. #define    slot_slot_lslot(dst, src, src2, func, t)            \
  103.     {                                \
  104.         void func(sequence*);                    \
  105.         _slot_slot_lslot((dst), (src), (src2), (func), (t));    \
  106.     }
  107.  
  108. /* -------------------------------------------------------------------- */
  109.  
  110. #endif
  111.