123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- .TH EM_OPT 3 "$Revision$"
- .ad
- .SH NAME
- emopt \- EM code peephole optimizer interface for compilers
- .SH SYNOPSIS
- .nf
- .B #define PEEPHOLE
- .B #include <em.h>
- .PP
- .B void O_init(wsize, psize)
- .B arith wsize, psize;
- .PP
- .B int O_open(filename)
- .B void O_close()
- .B int O_busy()
- .B char *filename;
- .PP
- .B void O_magic()
- .PP
- .B void O_df_dlb(l)
- .B void O_df_dnam(s)
- .B void O_df_ilb(l)
- .B label l; char *s;
- .PP
- .B void O_pro(s, l)
- .B void O_pro_narg(s)
- .B void O_end(l)
- .B void O_end_narg()
- .B char *s; arith l;
- .PP
- .B void O_exa_dlb(l)
- .B void O_exa_dnam(s)
- .B void O_exp(s)
- .B void O_ina_dlb(l)
- .B void O_ina_dnam(s)
- .B void O_inp(s)
- .B char *s; label l;
- .PP
- .BI "void O_bss_" cstp ()
- .BI "void O_hol_" cstp ()
- .BI "void O_con_" cstp ()
- .BI "void O_rom_" cstp ()
- .PP
- .B #include <em_mes.h>
- .B void O_mes_begin(ms)
- .BI "void O_" cstp ()
- .B void O_mes_end()
- .B int ms;
- .PP
- .B void O_exc(c1, c2)
- .B arith c1, c2;
- .PP
- .BI "void O_" mnem ()
- .BI "void O_" mnem _dlb()
- .BI "void O_" mnem _dnam()
- .BI "void O_" mnem _narg()
- .PP
- .B void O_insertpart(id)
- .B int id;
- .PP
- .B void O_beginpart(id)
- .B int id;
- .PP
- .B void O_endpart(id)
- .B int id;
- .fi
- .SH DESCRIPTION
- This package provides a procedural EM code peephole optimizer interface to be
- used in compilers and other EM code producing programs. The interface
- routines are identical to the EM_CODE(3) procedure interface except that all
- names have been replaced by
- .I O_xxx
- It is possible to convert
- a program that is currently using the EM_CODE interface
- to use this module instead by defining
- .I PEEPHOLE
- before including
- .I em.h.
- This defines a series of macros to map all the
- .I C_xxx
- names to the corresponding
- .I O_xxx
- names. The module in turn calls
- .I C_xxx
- routines to output the optimized code. Hence it is possible to add peephole
- optimization to any program that outputs EM code using the EM_CODE module.
- .PP
- Details of the
- .I O_xxx
- routines may be obtained by referring to the description
- of the corresponding
- .I C_xxx
- routine in EM_CODE(3).
- .SH FILES
- .nf
- ~em/modules/h/em.h
- ~em/modules/lib/libemopt.a
- .fi
- .SH MODULES
- .nf
- alloc(3), system(3), string(3), em_code(3)
- .fi
- .SH SEE ALSO
- em_nopt(1) em_code(3), read_em(3), em_mes(3)
- .SH DIAGNOSTICS
- .I O_open
- returns 1 if the open is successful and 0 if not.
- .SH BUGS
- It is not possible to indicate that the argument of
- .B O_con_cst ()
- must be seen as an unsigned value.
- .SH AUTHOR
- Bruce McKenzie <bruce@cosc.canterbury.ac.nz>
|