debian man page for z88dk-copt

Query: z88dk-copt

OS: debian

Section: 1

Links: debian man pages   all man pages

Forums: unix linux community   forum categories

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

copt(1) 							z88 Development Kit							   copt(1)

NAME
copt - peephole optimizer
SYSNOPIS
copt file ...
DESCRIPTION
copt is a general-purpose peephole optimizer. It reads code from its standard input and writes an improved version to its standard output. copy reads the named files for its optimizations, which are encoded as follows: <pattern for input line 1> <pattern for input line 2> ... <pattern for input line n> = <pattern for output line 1> <pattern for output line 2> ... <pattern for output line m> <blank line> Pattern matching uses literal string comparison, with one exception: ``%%'' matches the ``%'' character, and ``%'' followed by a digit matches everything up to the next occurrence of the next pattern character, though all occurrences of %n must denote the same string. For example, the pattern ``%1=%1.'' matches exactly those strings that begin with a string X, followed by a ``='' (the first), followed by a second occurrence of X, followed by a period. In this way, the input/output pattern mov $%1,r%2 mov *r%2,r%2 = mov %1,r%2 commands copt to replace runs like mov $_a,r3 mov *r3,r3 with mov _a,r3 Note that a tab or newline can terminate a %n variable. copt compares each run of input patterns with the current input instruction and its predecessors. If no match is found, it advances to the next input instruction and tries again. Otherwise, it replaces the input instructions with the corresponding output patterns, pattern vari- ables instantiated,and resumes its search with the first instruction of the replacement. copt matches input patterns in reverse order to cascade optimizations without backing up.
BUGS
Errors in optimization files are always possible.
SEE ALSO
z88dk(1), z88dk-zcc(1), z88dk-z80asm(1), z88dk-appmake(1), z88dk-copt(1).
AUTHOR
z88dk was written by Dominic Morris <dom@z88dk.org>, and others. 01 December 2009 copt(1)
Related Man Pages
z88dk-copt(1) - debian
z88dk-appmake(1) - debian
evmeventnamematch(3) - hpux
fnmatch(3) - minix
fnmatch(3) - ultrix
Similar Topics in the Unix Linux Community
pattern containg ' search and replace
extracting pattern from every line
Need help to replace a pattern with a blank line
Reducing input file size after pattern search
Modify text file if found multiple pattern match for every line.