2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 /* $Id: pattern.h,v 2.4 1994/06/24 10:40:30 ceriel Exp $ */
8 * pattern contains the optimization patterns in an apparently
9 * unordered fashion. All patterns follow each other unaligned.
10 * Each pattern looks as follows:
11 * Byte 0: high byte of hash value associated with this pattern.
12 * Byte 1-2: index of next pattern with same low byte of hash value.
13 * Byte 3- : pattern and replacement.
14 * First comes the pattern length
15 * then the pattern opcodes,
16 * then a boolean expression,
17 * then the one-byte replacement length
18 * then the intermixed pattern opcodes and operands or
19 * 0 followed by the one-byte special optimization expression.
20 * If the DIAGOPT option is set, the optimization is followed
21 * by the line number in the tables.
24 #undef ALLOWSPECIAL /* Special optimizations allowed */
35 typedef struct exprnode expr_t;
36 typedef struct exprnode *expr_p;
39 * contents of .ex_operator
67 #define EX_POINTERSIZE 25
68 #define EX_WORDSIZE 26
70 #define EX_SAMESIGN 28
74 #define N_EX_OPS 32 /* must be one higher then previous */
78 * Definition of special opcodes used in patterns
81 #define op_pfirst op_LLP
82 #define op_LLP (op_last+1)
83 #define op_LEP (op_last+2)
84 #define op_SLP (op_last+3)
85 #define op_SEP (op_last+4)
86 #define op_plast op_SEP
89 * Definition of the structure in which instruction operands
90 * are kept during pattern matching.
93 typedef struct eval eval_t;
94 typedef struct eval *eval_p;
110 #define EV_FRAG 3 /* and all higher numbers */
112 typedef struct iarg iarg_t;
113 typedef struct iarg *iarg_p;
121 * The next extern declarations refer to data generated by mktab
124 extern byte pattern[];
125 extern short lastind;
126 extern iarg_t iargs[];
127 extern byte nparam[];
128 extern bool nonumlab[];
129 extern bool onlyconst[];
130 extern expr_t enodes[];