em_opt.3 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .TH EM_OPT 3 "$Revision$"
  2. .ad
  3. .SH NAME
  4. emopt \- EM code peephole optimizer interface for compilers
  5. .SH SYNOPSIS
  6. .nf
  7. .B #define PEEPHOLE
  8. .B #include <em.h>
  9. .PP
  10. .B O_init(wsize, psize)
  11. .B arith wsize, psize;
  12. .PP
  13. .B int O_open(filename)
  14. .B O_close()
  15. .B int O_busy()
  16. .B char *filename;
  17. .PP
  18. .B O_magic()
  19. .PP
  20. .B O_df_dlb(l)
  21. .B O_df_dnam(s)
  22. .B O_df_ilb(l)
  23. .B label l; char *s;
  24. .PP
  25. .B O_pro(s, l)
  26. .B O_pro_narg(s)
  27. .B O_end(l)
  28. .B O_end_narg()
  29. .B char *s; arith l;
  30. .PP
  31. .B O_exa_dlb(l)
  32. .B O_exa_dnam(s)
  33. .B O_exp(s)
  34. .B O_ina_dlb(l)
  35. .B O_ina_dnam(s)
  36. .B O_inp(s)
  37. .B char *s; label l;
  38. .PP
  39. .BI O_bss_ cstp ()
  40. .BI O_hol_ cstp ()
  41. .BI O_con_ cstp ()
  42. .BI O_rom_ cstp ()
  43. .PP
  44. .B #include <em_mes.h>
  45. .B O_mes_begin(ms)
  46. .BI O_ cstp ()
  47. .B O_mes_end()
  48. .B int ms;
  49. .PP
  50. .B O_exc(c1, c2)
  51. .B arith c1, c2;
  52. .PP
  53. .BI O_ mnem ()
  54. .BI O_ mnem _dlb()
  55. .BI O_ mnem _dnam()
  56. .BI O_ mnem _narg()
  57. .PP
  58. .B O_insertpart(id)
  59. .B int id;
  60. .PP
  61. .B O_beginpart(id)
  62. .B int id;
  63. .PP
  64. .B O_endpart(id)
  65. .B int id;
  66. .fi
  67. .SH DESCRIPTION
  68. This package provides a procedural EM code peephole optimizer interface to be
  69. used in compilers and other EM code producing programs. The interface
  70. routines are identical to the EM_CODE(3) procedure interface except that all
  71. names have been replaced by
  72. .I O_xxx
  73. It is possible to convert
  74. a program that is currently using the EM_CODE interface
  75. to use this module instead by defining
  76. .I PEEPHOLE
  77. before including
  78. .I em.h.
  79. This defines a series of macros to map all the
  80. .I C_xxx
  81. names to the corresponding
  82. .I O_xxx
  83. names. The module in turn calls
  84. .I C_xxx
  85. routines to output the optimized code. Hence it is possible to add peephole
  86. optimization to any program that outputs EM code using the EM_CODE module.
  87. .PP
  88. Details of the
  89. .I O_xxx
  90. routines may be obtained by referring to the description
  91. of the corresponding
  92. .I C_xxx
  93. routine in EM_CODE(3).
  94. .SH FILES
  95. .nf
  96. ~em/modules/h/em.h
  97. ~em/modules/lib/libemopt.a
  98. .fi
  99. .SH MODULES
  100. .nf
  101. alloc(3), system(3), string(3), em_code(3)
  102. .fi
  103. .SH SEE ALSO
  104. em_nopt(1) em_code(3), read_em(3), em_mes(3)
  105. .SH DIAGNOSTICS
  106. .I O_open
  107. returns 1 if the open is successful and 0 if not.
  108. .SH BUGS
  109. It is not possible to indicate that the argument of
  110. .B O_con_cst ()
  111. must be seen as an unsigned value.
  112. .SH AUTHOR
  113. Bruce McKenzie <bruce@cocs.canterbury.ac.nz>