xref: /titanic_41/usr/src/cmd/geniconvtbl/disassemble.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1999 by Sun Microsystems, Inc.
24*7c478bd9Sstevel@tonic-gate  * All rights reserved.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*7c478bd9Sstevel@tonic-gate 
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #include <stdio.h>
31*7c478bd9Sstevel@tonic-gate #include <stdlib.h>
32*7c478bd9Sstevel@tonic-gate #include <stddef.h>
33*7c478bd9Sstevel@tonic-gate #include <fcntl.h>
34*7c478bd9Sstevel@tonic-gate #include <unistd.h>
35*7c478bd9Sstevel@tonic-gate #include <libintl.h>
36*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
37*7c478bd9Sstevel@tonic-gate #include <sys/stat.h>
38*7c478bd9Sstevel@tonic-gate #include <sys/mman.h>
39*7c478bd9Sstevel@tonic-gate #include <errno.h>
40*7c478bd9Sstevel@tonic-gate #include <stdarg.h>
41*7c478bd9Sstevel@tonic-gate #include <string.h>
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate #include "iconv_tm.h"
44*7c478bd9Sstevel@tonic-gate #include "itm_util.h"
45*7c478bd9Sstevel@tonic-gate 
46*7c478bd9Sstevel@tonic-gate /*
47*7c478bd9Sstevel@tonic-gate  * function prototype
48*7c478bd9Sstevel@tonic-gate  */
49*7c478bd9Sstevel@tonic-gate 
50*7c478bd9Sstevel@tonic-gate static itm_hdr_t	*itm_attach(const char *);
51*7c478bd9Sstevel@tonic-gate static void	dump_tables(itm_hdr_t *, itm_info_hdr_t *);
52*7c478bd9Sstevel@tonic-gate static void	dump_direc_tbl(itm_hdr_t *, itm_place_t);
53*7c478bd9Sstevel@tonic-gate static void	dump_map(itm_hdr_t *, itm_place_t, int);
54*7c478bd9Sstevel@tonic-gate static void	dump_map_i_f(itm_hdr_t *, itm_place_t, int);
55*7c478bd9Sstevel@tonic-gate static void	dump_map_l_f(itm_hdr_t *, itm_place_t, int);
56*7c478bd9Sstevel@tonic-gate static void	dump_map_hash(itm_hdr_t *, itm_place_t, int);
57*7c478bd9Sstevel@tonic-gate static void	dump_map_dense_enc(itm_hdr_t *, itm_place_t, int);
58*7c478bd9Sstevel@tonic-gate static void	dump_cond_tbl(itm_hdr_t *, itm_place_t, int);
59*7c478bd9Sstevel@tonic-gate static void	dump_op_tbl(itm_hdr_t *, itm_place_t, int);
60*7c478bd9Sstevel@tonic-gate static void	dump_op(itm_hdr_t *, itm_place2_t);
61*7c478bd9Sstevel@tonic-gate static void	dump_expr(itm_hdr_t *, itm_place_t);
62*7c478bd9Sstevel@tonic-gate static void	dump_range(itm_hdr_t *, itm_place_t);
63*7c478bd9Sstevel@tonic-gate static void	dump_escapeseq(itm_hdr_t *, itm_place_t);
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate static char	*tbl_name(itm_hdr_t *, itm_tbl_hdr_t *);
66*7c478bd9Sstevel@tonic-gate static char	*reg_name(itm_hdr_t	*itm_hdr, itm_place_t op);
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate static void	printi(int, char *, ...);
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate 
71*7c478bd9Sstevel@tonic-gate /*
72*7c478bd9Sstevel@tonic-gate  * macro definition
73*7c478bd9Sstevel@tonic-gate  */
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate #define	ADDR(place)	((void *)(((char *)(itm_hdr)) + \
76*7c478bd9Sstevel@tonic-gate 			((itm_place2_t)((place).itm_ptr))))
77*7c478bd9Sstevel@tonic-gate #define	DADDR(n)	(((n)->size <= (sizeof ((n)->place))) ?	\
78*7c478bd9Sstevel@tonic-gate 				((char *)(&((n)->place))) :\
79*7c478bd9Sstevel@tonic-gate 				((char *)(ADDR((n)->place))))
80*7c478bd9Sstevel@tonic-gate #define	ADDR2(place2)	((void *)(((char *)(itm_hdr)) + \
81*7c478bd9Sstevel@tonic-gate 			((itm_place2_t)(place2))))
82*7c478bd9Sstevel@tonic-gate #define	INFO_HDR(pa)	((void *)(((char *)pa) + \
83*7c478bd9Sstevel@tonic-gate 			((itm_hdr_t *)(pa))->info_hdr.itm_ptr))
84*7c478bd9Sstevel@tonic-gate 
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate #if defined(RESERVED_NAME_PREFIX)
87*7c478bd9Sstevel@tonic-gate #define	RNPREF		RESERVED_NAME_PREFIX
88*7c478bd9Sstevel@tonic-gate #else /* !defined(RESERVED_NAME_PREFIX) */
89*7c478bd9Sstevel@tonic-gate #define	RNPREF		/* null strings */
90*7c478bd9Sstevel@tonic-gate #endif /* !defined(RESERVED_NAME_PREFIX) */
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate 
93*7c478bd9Sstevel@tonic-gate void
disassemble(char * file)94*7c478bd9Sstevel@tonic-gate disassemble(char	*file)
95*7c478bd9Sstevel@tonic-gate {
96*7c478bd9Sstevel@tonic-gate 	itm_hdr_t	*itm_hdr;
97*7c478bd9Sstevel@tonic-gate 	itm_info_hdr_t	*info_hdr;
98*7c478bd9Sstevel@tonic-gate 	itm_data_t	type_id;
99*7c478bd9Sstevel@tonic-gate 
100*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('d', ("disassemble %s\n", file));
101*7c478bd9Sstevel@tonic-gate 
102*7c478bd9Sstevel@tonic-gate 	itm_hdr = itm_attach(file);
103*7c478bd9Sstevel@tonic-gate 
104*7c478bd9Sstevel@tonic-gate 	if (NULL == itm_hdr) {
105*7c478bd9Sstevel@tonic-gate 		exit(3);
106*7c478bd9Sstevel@tonic-gate 	}
107*7c478bd9Sstevel@tonic-gate 
108*7c478bd9Sstevel@tonic-gate 	if (0 == itm_hdr->info_hdr.itm_ptr) {
109*7c478bd9Sstevel@tonic-gate 		itm_error(gettext("binarytable is stripped\n"));
110*7c478bd9Sstevel@tonic-gate 		exit(4);
111*7c478bd9Sstevel@tonic-gate 	}
112*7c478bd9Sstevel@tonic-gate 
113*7c478bd9Sstevel@tonic-gate 	if (0 == itm_hdr->info_hdr.itm_ptr) {
114*7c478bd9Sstevel@tonic-gate 		info_hdr = malloc_vital(sizeof (itm_info_hdr_t));
115*7c478bd9Sstevel@tonic-gate 		(void) memset(info_hdr, 0, sizeof (itm_info_hdr_t));
116*7c478bd9Sstevel@tonic-gate 	} else {
117*7c478bd9Sstevel@tonic-gate 		info_hdr = INFO_HDR(itm_hdr);
118*7c478bd9Sstevel@tonic-gate 	}
119*7c478bd9Sstevel@tonic-gate 
120*7c478bd9Sstevel@tonic-gate #if defined(ENABLE_TRACE)
121*7c478bd9Sstevel@tonic-gate 	dump_itm_header(itm_hdr, info_hdr);
122*7c478bd9Sstevel@tonic-gate #endif
123*7c478bd9Sstevel@tonic-gate 	printi(0, "//\n", file);
124*7c478bd9Sstevel@tonic-gate 	printi(0, "// %s\n", file);
125*7c478bd9Sstevel@tonic-gate 	printi(0, "//\n", file);
126*7c478bd9Sstevel@tonic-gate 
127*7c478bd9Sstevel@tonic-gate 	type_id = itm_hdr->type_id;
128*7c478bd9Sstevel@tonic-gate 	if ((NULL != cmd_opt.disassemble) &&
129*7c478bd9Sstevel@tonic-gate 	    ((sizeof (itm_place_t)) < type_id.size)) {
130*7c478bd9Sstevel@tonic-gate 		type_id.place.itm_ptr += (itm_place2_t)itm_hdr;
131*7c478bd9Sstevel@tonic-gate 	}
132*7c478bd9Sstevel@tonic-gate 	printi(1, "%s {\n", name_to_str(&type_id));
133*7c478bd9Sstevel@tonic-gate 	dump_tables(itm_hdr, info_hdr);
134*7c478bd9Sstevel@tonic-gate 	printi(-1, "}\n");
135*7c478bd9Sstevel@tonic-gate }
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate #if defined(ENABLE_TRACE)
138*7c478bd9Sstevel@tonic-gate void
dump_itm_header(itm_hdr_t * itm_header,itm_info_hdr_t * info_header)139*7c478bd9Sstevel@tonic-gate dump_itm_header(itm_hdr_t	*itm_header, itm_info_hdr_t	*info_header)
140*7c478bd9Sstevel@tonic-gate {
141*7c478bd9Sstevel@tonic-gate 	char	*str_type_id;
142*7c478bd9Sstevel@tonic-gate 	char	*str_interpreter;
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate 	itm_data_t	type_id;
145*7c478bd9Sstevel@tonic-gate 	itm_data_t	interpreter;
146*7c478bd9Sstevel@tonic-gate 
147*7c478bd9Sstevel@tonic-gate 	type_id = itm_header->type_id;
148*7c478bd9Sstevel@tonic-gate 	str_type_id = malloc_vital(itm_header->type_id.size + 1);
149*7c478bd9Sstevel@tonic-gate 	if ((NULL != cmd_opt.disassemble) &&
150*7c478bd9Sstevel@tonic-gate 	    ((sizeof (itm_place_t)) < type_id.size)) {
151*7c478bd9Sstevel@tonic-gate 		type_id.place.itm_ptr += (itm_place2_t)itm_header;
152*7c478bd9Sstevel@tonic-gate 	}
153*7c478bd9Sstevel@tonic-gate 	(void) memcpy(str_type_id, name_to_str(&type_id), type_id.size + 1);
154*7c478bd9Sstevel@tonic-gate 
155*7c478bd9Sstevel@tonic-gate 	interpreter = itm_header->interpreter;
156*7c478bd9Sstevel@tonic-gate 	str_interpreter = malloc_vital(itm_header->interpreter.size + 1);
157*7c478bd9Sstevel@tonic-gate 	if ((NULL != cmd_opt.disassemble) &&
158*7c478bd9Sstevel@tonic-gate 	    ((sizeof (itm_place_t)) < interpreter.size)) {
159*7c478bd9Sstevel@tonic-gate 		interpreter.place.itm_ptr += (itm_place2_t)itm_header;
160*7c478bd9Sstevel@tonic-gate 	}
161*7c478bd9Sstevel@tonic-gate 	(void) memcpy(str_interpreter, name_to_str(&interpreter),
162*7c478bd9Sstevel@tonic-gate 		interpreter.size + 1);
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('D',
165*7c478bd9Sstevel@tonic-gate 			("\n"
166*7c478bd9Sstevel@tonic-gate 			"------\n"
167*7c478bd9Sstevel@tonic-gate 			"Sizeof Data Structures \n"
168*7c478bd9Sstevel@tonic-gate 			" sizeof(int)		    = %ld\n"
169*7c478bd9Sstevel@tonic-gate 			" sizeof(long)		    = %ld\n"
170*7c478bd9Sstevel@tonic-gate 			" sizeof(uintptr_t)	    = %ld\n"
171*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_place_t)  = %ld\n"
172*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_data_t)   = %ld\n"
173*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_hdr_t)    = %ld\n"
174*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_place_tbl_info_t)  = %ld\n"
175*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_section_info_t)    = %ld\n"
176*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_action_type_t)     = %ld\n"
177*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_direct_t)	= %ld\n"
178*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_cond_t)	= %ld\n"
179*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_range_hdr_t)       = %ld\n"
180*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_escapeseq_hdr_t)   = %ld\n"
181*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_map_idx_fix_hdr_t) = %ld\n"
182*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_map_lookup_hdr_t)  = %ld\n"
183*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_map_hash_hdr_t)    = %ld\n"
184*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_map_dense_enc_hdr_t) = %ld\n"
185*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_expr_t)   = %ld\n"
186*7c478bd9Sstevel@tonic-gate 			" sizeof(enum itm_op_type_t)  = %ld\n"
187*7c478bd9Sstevel@tonic-gate 			" sizeof(struct itm_op_t)     u= %ld\n"
188*7c478bd9Sstevel@tonic-gate 			" sizeof(enum itm_expr_type_t)= %ld\n"
189*7c478bd9Sstevel@tonic-gate 			"\n",
190*7c478bd9Sstevel@tonic-gate 
191*7c478bd9Sstevel@tonic-gate 			sizeof (int),
192*7c478bd9Sstevel@tonic-gate 			sizeof (long),
193*7c478bd9Sstevel@tonic-gate 			sizeof (uintptr_t),
194*7c478bd9Sstevel@tonic-gate 			sizeof (itm_place_t),
195*7c478bd9Sstevel@tonic-gate 			sizeof (itm_data_t),
196*7c478bd9Sstevel@tonic-gate 			sizeof (itm_hdr_t),
197*7c478bd9Sstevel@tonic-gate 			sizeof (itm_place_tbl_info_t),
198*7c478bd9Sstevel@tonic-gate 			sizeof (itm_section_info_t),
199*7c478bd9Sstevel@tonic-gate 			sizeof (itm_action_type_t),
200*7c478bd9Sstevel@tonic-gate 			sizeof (itm_direc_t),
201*7c478bd9Sstevel@tonic-gate 			sizeof (itm_cond_t),
202*7c478bd9Sstevel@tonic-gate 			sizeof (itm_range_hdr_t),
203*7c478bd9Sstevel@tonic-gate 			sizeof (itm_escapeseq_hdr_t),
204*7c478bd9Sstevel@tonic-gate 			sizeof (itm_map_idx_fix_hdr_t),
205*7c478bd9Sstevel@tonic-gate 			sizeof (itm_map_lookup_hdr_t),
206*7c478bd9Sstevel@tonic-gate 			sizeof (itm_map_hash_hdr_t),
207*7c478bd9Sstevel@tonic-gate 			sizeof (itm_map_dense_enc_hdr_t),
208*7c478bd9Sstevel@tonic-gate 			sizeof (itm_expr_t),
209*7c478bd9Sstevel@tonic-gate 			sizeof (itm_op_type_t),
210*7c478bd9Sstevel@tonic-gate 			sizeof (itm_op_t),
211*7c478bd9Sstevel@tonic-gate 			sizeof (itm_expr_type_t)));
212*7c478bd9Sstevel@tonic-gate 
213*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('H',
214*7c478bd9Sstevel@tonic-gate 			("ident		= %c%c%c\n"
215*7c478bd9Sstevel@tonic-gate 			"spec		= %02x%02x%02x%02x\n"
216*7c478bd9Sstevel@tonic-gate 			"version	= %02x%02x%02x%02x\n"
217*7c478bd9Sstevel@tonic-gate 			"itm_size	= %ld\n"
218*7c478bd9Sstevel@tonic-gate 			"type_id	= %s\n"
219*7c478bd9Sstevel@tonic-gate 			"interpreter	= %s\n"
220*7c478bd9Sstevel@tonic-gate 			"op_init_tbl	= %ld\n"
221*7c478bd9Sstevel@tonic-gate 			"op_reset_tbl	= %ld\n"
222*7c478bd9Sstevel@tonic-gate 			"direc_init_tbl = %ld\n"
223*7c478bd9Sstevel@tonic-gate 			"reg_num	= %ld\n"
224*7c478bd9Sstevel@tonic-gate 			"itm_hdr_size	= %ld\n"
225*7c478bd9Sstevel@tonic-gate 			"info_hdr	= %ld\n"
226*7c478bd9Sstevel@tonic-gate 			"info_hdr_size	= %ld\n",
227*7c478bd9Sstevel@tonic-gate 
228*7c478bd9Sstevel@tonic-gate 			itm_header->ident[0],
229*7c478bd9Sstevel@tonic-gate 			itm_header->ident[1],
230*7c478bd9Sstevel@tonic-gate 			itm_header->ident[2],
231*7c478bd9Sstevel@tonic-gate 			/* itm_header->ident[3], */
232*7c478bd9Sstevel@tonic-gate 			itm_header->spec[0],
233*7c478bd9Sstevel@tonic-gate 			itm_header->spec[1],
234*7c478bd9Sstevel@tonic-gate 			itm_header->spec[2],
235*7c478bd9Sstevel@tonic-gate 			itm_header->spec[3],
236*7c478bd9Sstevel@tonic-gate 			itm_header->version[0],
237*7c478bd9Sstevel@tonic-gate 			itm_header->version[1],
238*7c478bd9Sstevel@tonic-gate 			itm_header->version[2],
239*7c478bd9Sstevel@tonic-gate 			itm_header->version[3],
240*7c478bd9Sstevel@tonic-gate 			itm_header->itm_size.itm_ptr,
241*7c478bd9Sstevel@tonic-gate 			str_type_id,
242*7c478bd9Sstevel@tonic-gate 			str_interpreter,
243*7c478bd9Sstevel@tonic-gate 			itm_header->op_init_tbl.itm_ptr,
244*7c478bd9Sstevel@tonic-gate 			itm_header->op_reset_tbl.itm_ptr,
245*7c478bd9Sstevel@tonic-gate 			itm_header->direc_init_tbl.itm_ptr,
246*7c478bd9Sstevel@tonic-gate 			itm_header->reg_num,
247*7c478bd9Sstevel@tonic-gate 			itm_header->itm_hdr_size,
248*7c478bd9Sstevel@tonic-gate 			itm_header->info_hdr.itm_ptr,
249*7c478bd9Sstevel@tonic-gate 			(sizeof (itm_info_hdr_t))));
250*7c478bd9Sstevel@tonic-gate 
251*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('H',
252*7c478bd9Sstevel@tonic-gate 			("  str_sec     = (%4ld %4ld %4ld)	"
253*7c478bd9Sstevel@tonic-gate 			"  str_plc_tbl = (%4ld %4ld %4ld)\n"
254*7c478bd9Sstevel@tonic-gate 			"direc_sec_tbl = (%4ld %4ld %4ld)	"
255*7c478bd9Sstevel@tonic-gate 			"direc_plc_tbl = (%4ld %4ld %4ld)\n"
256*7c478bd9Sstevel@tonic-gate 			" cond_sec_tbl = (%4ld %4ld %4ld)	"
257*7c478bd9Sstevel@tonic-gate 			" cond_plc_tbl = (%4ld %4ld %4ld)\n"
258*7c478bd9Sstevel@tonic-gate 			"  map_sec_tbl = (%4ld %4ld %4ld)	"
259*7c478bd9Sstevel@tonic-gate 			"  map_plc_tbl = (%4ld %4ld %4ld)\n"
260*7c478bd9Sstevel@tonic-gate 			"   op_sec_tbl = (%4ld %4ld %4ld)	"
261*7c478bd9Sstevel@tonic-gate 			"   op_plc_tbl = (%4ld %4ld %4ld)\n"
262*7c478bd9Sstevel@tonic-gate 			"range_sec_tbl = (%4ld %4ld %4ld)	"
263*7c478bd9Sstevel@tonic-gate 			"range_plc_tbl = (%4ld %4ld %4ld)\n"
264*7c478bd9Sstevel@tonic-gate 			"escsq_sec_tbl = (%4ld %4ld %4ld)	"
265*7c478bd9Sstevel@tonic-gate 			"escsq_plc_tbl = (%4ld %4ld %4ld)\n"
266*7c478bd9Sstevel@tonic-gate 			" data_sec     = (%4ld %4ld %4ld)	"
267*7c478bd9Sstevel@tonic-gate 			" data_plc_tbl = (%4ld %4ld %4ld)\n"
268*7c478bd9Sstevel@tonic-gate 			" name_sec     = (%4ld %4ld %4ld)	"
269*7c478bd9Sstevel@tonic-gate 			" name_plc_tbl = (%4ld %4ld %4ld)\n"
270*7c478bd9Sstevel@tonic-gate 			"					"
271*7c478bd9Sstevel@tonic-gate 			"  reg_plc_tbl = (%4ld %4ld %4ld)\n"
272*7c478bd9Sstevel@tonic-gate 			"%s\n",
273*7c478bd9Sstevel@tonic-gate 			info_header->str_sec.place.itm_ptr,
274*7c478bd9Sstevel@tonic-gate 			info_header->str_sec.size,
275*7c478bd9Sstevel@tonic-gate 			info_header->str_sec.number,
276*7c478bd9Sstevel@tonic-gate 			info_header->str_plc_tbl.place.itm_ptr,
277*7c478bd9Sstevel@tonic-gate 			info_header->str_plc_tbl.size,
278*7c478bd9Sstevel@tonic-gate 			info_header->str_plc_tbl.number,
279*7c478bd9Sstevel@tonic-gate 			info_header->direc_tbl_sec.place.itm_ptr,
280*7c478bd9Sstevel@tonic-gate 			info_header->direc_tbl_sec.size,
281*7c478bd9Sstevel@tonic-gate 			info_header->direc_tbl_sec.number,
282*7c478bd9Sstevel@tonic-gate 			info_header->direc_plc_tbl.place.itm_ptr,
283*7c478bd9Sstevel@tonic-gate 			info_header->direc_plc_tbl.size,
284*7c478bd9Sstevel@tonic-gate 			info_header->direc_plc_tbl.number,
285*7c478bd9Sstevel@tonic-gate 			info_header->cond_tbl_sec.place.itm_ptr,
286*7c478bd9Sstevel@tonic-gate 			info_header->cond_tbl_sec.size,
287*7c478bd9Sstevel@tonic-gate 			info_header->cond_tbl_sec.number,
288*7c478bd9Sstevel@tonic-gate 			info_header->cond_plc_tbl.place.itm_ptr,
289*7c478bd9Sstevel@tonic-gate 			info_header->cond_plc_tbl.size,
290*7c478bd9Sstevel@tonic-gate 			info_header->cond_plc_tbl.number,
291*7c478bd9Sstevel@tonic-gate 			info_header->map_tbl_sec.place.itm_ptr,
292*7c478bd9Sstevel@tonic-gate 			info_header->map_tbl_sec.size,
293*7c478bd9Sstevel@tonic-gate 			info_header->map_tbl_sec.number,
294*7c478bd9Sstevel@tonic-gate 			info_header->map_plc_tbl.place.itm_ptr,
295*7c478bd9Sstevel@tonic-gate 			info_header->map_plc_tbl.size,
296*7c478bd9Sstevel@tonic-gate 			info_header->map_plc_tbl.number,
297*7c478bd9Sstevel@tonic-gate 			info_header->op_tbl_sec.place.itm_ptr,
298*7c478bd9Sstevel@tonic-gate 			info_header->op_tbl_sec.size,
299*7c478bd9Sstevel@tonic-gate 			info_header->op_tbl_sec.number,
300*7c478bd9Sstevel@tonic-gate 			info_header->op_plc_tbl.place.itm_ptr,
301*7c478bd9Sstevel@tonic-gate 			info_header->op_plc_tbl.size,
302*7c478bd9Sstevel@tonic-gate 			info_header->op_plc_tbl.number,
303*7c478bd9Sstevel@tonic-gate 			info_header->range_tbl_sec.place.itm_ptr,
304*7c478bd9Sstevel@tonic-gate 			info_header->range_tbl_sec.size,
305*7c478bd9Sstevel@tonic-gate 			info_header->range_tbl_sec.number,
306*7c478bd9Sstevel@tonic-gate 			info_header->range_plc_tbl.place.itm_ptr,
307*7c478bd9Sstevel@tonic-gate 			info_header->range_plc_tbl.size,
308*7c478bd9Sstevel@tonic-gate 			info_header->range_plc_tbl.number,
309*7c478bd9Sstevel@tonic-gate 			info_header->escapeseq_tbl_sec.place.itm_ptr,
310*7c478bd9Sstevel@tonic-gate 			info_header->escapeseq_tbl_sec.size,
311*7c478bd9Sstevel@tonic-gate 			info_header->escapeseq_tbl_sec.number,
312*7c478bd9Sstevel@tonic-gate 			info_header->escapeseq_plc_tbl.place.itm_ptr,
313*7c478bd9Sstevel@tonic-gate 			info_header->escapeseq_plc_tbl.size,
314*7c478bd9Sstevel@tonic-gate 			info_header->escapeseq_plc_tbl.number,
315*7c478bd9Sstevel@tonic-gate 			info_header->data_sec.place.itm_ptr,
316*7c478bd9Sstevel@tonic-gate 			info_header->data_sec.size,
317*7c478bd9Sstevel@tonic-gate 			info_header->data_sec.number,
318*7c478bd9Sstevel@tonic-gate 			info_header->data_plc_tbl.place.itm_ptr,
319*7c478bd9Sstevel@tonic-gate 			info_header->data_plc_tbl.size,
320*7c478bd9Sstevel@tonic-gate 			info_header->data_plc_tbl.number,
321*7c478bd9Sstevel@tonic-gate 			info_header->name_sec.place.itm_ptr,
322*7c478bd9Sstevel@tonic-gate 			info_header->name_sec.size,
323*7c478bd9Sstevel@tonic-gate 			info_header->name_sec.number,
324*7c478bd9Sstevel@tonic-gate 			info_header->name_plc_tbl.place.itm_ptr,
325*7c478bd9Sstevel@tonic-gate 			info_header->name_plc_tbl.size,
326*7c478bd9Sstevel@tonic-gate 			info_header->name_plc_tbl.number,
327*7c478bd9Sstevel@tonic-gate 			info_header->reg_plc_tbl.place.itm_ptr,
328*7c478bd9Sstevel@tonic-gate 			info_header->reg_plc_tbl.size,
329*7c478bd9Sstevel@tonic-gate 			info_header->reg_plc_tbl.number,
330*7c478bd9Sstevel@tonic-gate 			"--------"));
331*7c478bd9Sstevel@tonic-gate }
332*7c478bd9Sstevel@tonic-gate #endif
333*7c478bd9Sstevel@tonic-gate 
334*7c478bd9Sstevel@tonic-gate /*
335*7c478bd9Sstevel@tonic-gate  * Dump tables
336*7c478bd9Sstevel@tonic-gate  */
337*7c478bd9Sstevel@tonic-gate static void
dump_tables(itm_hdr_t * itm_hdr,itm_info_hdr_t * info_hdr)338*7c478bd9Sstevel@tonic-gate dump_tables(itm_hdr_t	*itm_hdr, itm_info_hdr_t	*info_hdr)
339*7c478bd9Sstevel@tonic-gate {
340*7c478bd9Sstevel@tonic-gate 	itm_num_t	n;
341*7c478bd9Sstevel@tonic-gate 	itm_data_t	*data;
342*7c478bd9Sstevel@tonic-gate 	itm_place_t	*place;
343*7c478bd9Sstevel@tonic-gate 	itm_place2_t	place2;
344*7c478bd9Sstevel@tonic-gate 	itm_data_t	d;
345*7c478bd9Sstevel@tonic-gate 
346*7c478bd9Sstevel@tonic-gate 	data = (itm_data_t *)(ADDR(info_hdr->reg_plc_tbl.place));
347*7c478bd9Sstevel@tonic-gate 	for (n = 0; n < info_hdr->reg_plc_tbl.number; n++, data += 1) {
348*7c478bd9Sstevel@tonic-gate 		d = *(data);
349*7c478bd9Sstevel@tonic-gate 		if ((sizeof (itm_place_t)) < d.size) {
350*7c478bd9Sstevel@tonic-gate 			d.place.itm_ptr = (itm_place2_t)ADDR(d.place);
351*7c478bd9Sstevel@tonic-gate 		}
352*7c478bd9Sstevel@tonic-gate 		printi(0, "// register: %s\n", name_to_str(&d));
353*7c478bd9Sstevel@tonic-gate 	}
354*7c478bd9Sstevel@tonic-gate 
355*7c478bd9Sstevel@tonic-gate 	data = (itm_data_t *)(ADDR(info_hdr->name_plc_tbl.place));
356*7c478bd9Sstevel@tonic-gate 	for (n = 0, place2 = info_hdr->name_plc_tbl.place.itm_ptr;
357*7c478bd9Sstevel@tonic-gate 	    n < info_hdr->name_plc_tbl.number;
358*7c478bd9Sstevel@tonic-gate 	    n++, data += 1, place2 += sizeof (itm_data_t)) {
359*7c478bd9Sstevel@tonic-gate 		d = *(data);
360*7c478bd9Sstevel@tonic-gate 
361*7c478bd9Sstevel@tonic-gate 		if ((sizeof (itm_place_t)) < d.size) {
362*7c478bd9Sstevel@tonic-gate 			d.place.itm_ptr = (itm_place2_t)ADDR(d.place);
363*7c478bd9Sstevel@tonic-gate 		}
364*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('p', ("(*)name=%ld",
365*7c478bd9Sstevel@tonic-gate 				((sizeof (itm_place_t)) < d.size) ?
366*7c478bd9Sstevel@tonic-gate 				d.place.itm_ptr:
367*7c478bd9Sstevel@tonic-gate 				(place2 + offsetof(itm_data_t, place))));
368*7c478bd9Sstevel@tonic-gate 		printi(0, "// name: %s\n", name_to_str(&d));
369*7c478bd9Sstevel@tonic-gate 
370*7c478bd9Sstevel@tonic-gate 	}
371*7c478bd9Sstevel@tonic-gate 
372*7c478bd9Sstevel@tonic-gate 	place = (itm_place_t *)(ADDR(info_hdr->cond_plc_tbl.place));
373*7c478bd9Sstevel@tonic-gate 	for (n = 0; n < info_hdr->cond_plc_tbl.number; n++, place += 1) {
374*7c478bd9Sstevel@tonic-gate 		dump_cond_tbl(itm_hdr, *place, 1);
375*7c478bd9Sstevel@tonic-gate 	}
376*7c478bd9Sstevel@tonic-gate 	place = (itm_place_t *)(ADDR(info_hdr->map_plc_tbl.place));
377*7c478bd9Sstevel@tonic-gate 	for (n = 0; n < info_hdr->map_plc_tbl.number;
378*7c478bd9Sstevel@tonic-gate 	    n++, place += 1) {
379*7c478bd9Sstevel@tonic-gate 		dump_map(itm_hdr, *place, 1);
380*7c478bd9Sstevel@tonic-gate 	}
381*7c478bd9Sstevel@tonic-gate 	place = (itm_place_t *)(ADDR(info_hdr->op_plc_tbl.place));
382*7c478bd9Sstevel@tonic-gate 	for (n = 0; n < info_hdr->op_plc_tbl.number;
383*7c478bd9Sstevel@tonic-gate 	    n++, place += 1) {
384*7c478bd9Sstevel@tonic-gate 		dump_op_tbl(itm_hdr, *place, 1);
385*7c478bd9Sstevel@tonic-gate 	}
386*7c478bd9Sstevel@tonic-gate 	place = (itm_place_t *)(ADDR(info_hdr->direc_plc_tbl.place));
387*7c478bd9Sstevel@tonic-gate 	for (n = 0; n < info_hdr->direc_plc_tbl.number; n++, place += 1) {
388*7c478bd9Sstevel@tonic-gate 		dump_direc_tbl(itm_hdr, *place);
389*7c478bd9Sstevel@tonic-gate 	}
390*7c478bd9Sstevel@tonic-gate }
391*7c478bd9Sstevel@tonic-gate 
392*7c478bd9Sstevel@tonic-gate 
393*7c478bd9Sstevel@tonic-gate /*
394*7c478bd9Sstevel@tonic-gate  * Dump direction
395*7c478bd9Sstevel@tonic-gate  */
396*7c478bd9Sstevel@tonic-gate static void
dump_direc_tbl(itm_hdr_t * itm_hdr,itm_place_t direc_place)397*7c478bd9Sstevel@tonic-gate dump_direc_tbl(itm_hdr_t	*itm_hdr, itm_place_t direc_place)
398*7c478bd9Sstevel@tonic-gate {
399*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*direc_hdr;
400*7c478bd9Sstevel@tonic-gate 	itm_direc_t	*direc;
401*7c478bd9Sstevel@tonic-gate 	itm_type_t	type;
402*7c478bd9Sstevel@tonic-gate 	long		i;
403*7c478bd9Sstevel@tonic-gate 	char		*name;
404*7c478bd9Sstevel@tonic-gate 
405*7c478bd9Sstevel@tonic-gate 	direc_hdr = (itm_tbl_hdr_t *)ADDR(direc_place);
406*7c478bd9Sstevel@tonic-gate 	direc = (itm_direc_t *)(direc_hdr + 1);
407*7c478bd9Sstevel@tonic-gate 
408*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)direc=%ld ", direc_place.itm_ptr));
409*7c478bd9Sstevel@tonic-gate 
410*7c478bd9Sstevel@tonic-gate 	printi(1, RNPREF "direction");
411*7c478bd9Sstevel@tonic-gate 	if (0 != direc_hdr->name.itm_ptr) {
412*7c478bd9Sstevel@tonic-gate 		name = tbl_name(itm_hdr, direc_hdr);
413*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
414*7c478bd9Sstevel@tonic-gate 			printi(0, " %s", name);
415*7c478bd9Sstevel@tonic-gate 		}
416*7c478bd9Sstevel@tonic-gate 	}
417*7c478bd9Sstevel@tonic-gate 	printi(0, " {\n");
418*7c478bd9Sstevel@tonic-gate 
419*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < direc_hdr->number; i++, direc++) {
420*7c478bd9Sstevel@tonic-gate 		dump_cond_tbl(itm_hdr, direc->condition, 0);
421*7c478bd9Sstevel@tonic-gate 
422*7c478bd9Sstevel@tonic-gate 		printi(0, "\t");
423*7c478bd9Sstevel@tonic-gate 
424*7c478bd9Sstevel@tonic-gate 		type = (ITM_TBL_MASK &
425*7c478bd9Sstevel@tonic-gate 			(((itm_tbl_hdr_t *)(ADDR(direc->action)))->type));
426*7c478bd9Sstevel@tonic-gate 
427*7c478bd9Sstevel@tonic-gate 		if (ITM_TBL_OP == type) {
428*7c478bd9Sstevel@tonic-gate 			dump_op_tbl(itm_hdr, direc->action, 0);
429*7c478bd9Sstevel@tonic-gate 		} else if (ITM_TBL_DIREC == type) {
430*7c478bd9Sstevel@tonic-gate 			printi(0, "direction: action: %ld\n",
431*7c478bd9Sstevel@tonic-gate 				direc->action.itm_ptr);
432*7c478bd9Sstevel@tonic-gate 		} else if (ITM_TBL_MAP == type) {
433*7c478bd9Sstevel@tonic-gate 			dump_map(itm_hdr, direc->action, 0);
434*7c478bd9Sstevel@tonic-gate 		} else {
435*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF
436*7c478bd9Sstevel@tonic-gate 				"error ELIBBAD // unknown operation (%lx)\n",
437*7c478bd9Sstevel@tonic-gate 				type);
438*7c478bd9Sstevel@tonic-gate 		}
439*7c478bd9Sstevel@tonic-gate 	}
440*7c478bd9Sstevel@tonic-gate 
441*7c478bd9Sstevel@tonic-gate 	printi(-1, "};\n");
442*7c478bd9Sstevel@tonic-gate }
443*7c478bd9Sstevel@tonic-gate 
444*7c478bd9Sstevel@tonic-gate 
445*7c478bd9Sstevel@tonic-gate static void
dump_map(itm_hdr_t * itm_hdr,itm_place_t map_place,int standalone)446*7c478bd9Sstevel@tonic-gate dump_map(itm_hdr_t	*itm_hdr, itm_place_t map_place, int standalone)
447*7c478bd9Sstevel@tonic-gate {
448*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*tbl_hdr;
449*7c478bd9Sstevel@tonic-gate 
450*7c478bd9Sstevel@tonic-gate 	tbl_hdr = (itm_tbl_hdr_t *)ADDR(map_place);
451*7c478bd9Sstevel@tonic-gate 
452*7c478bd9Sstevel@tonic-gate 	switch (tbl_hdr->type) {
453*7c478bd9Sstevel@tonic-gate 	case ITM_TBL_MAP_INDEX_FIXED_1_1:
454*7c478bd9Sstevel@tonic-gate 	case ITM_TBL_MAP_INDEX_FIXED:
455*7c478bd9Sstevel@tonic-gate 		dump_map_i_f(itm_hdr, map_place, standalone);
456*7c478bd9Sstevel@tonic-gate 		break;
457*7c478bd9Sstevel@tonic-gate 	case ITM_TBL_MAP_LOOKUP:
458*7c478bd9Sstevel@tonic-gate 		dump_map_l_f(itm_hdr, map_place, standalone);
459*7c478bd9Sstevel@tonic-gate 		break;
460*7c478bd9Sstevel@tonic-gate 	case ITM_TBL_MAP_HASH:
461*7c478bd9Sstevel@tonic-gate 		dump_map_hash(itm_hdr, map_place, standalone);
462*7c478bd9Sstevel@tonic-gate 		break;
463*7c478bd9Sstevel@tonic-gate 	case ITM_TBL_MAP_DENSE_ENC:
464*7c478bd9Sstevel@tonic-gate 		dump_map_dense_enc(itm_hdr, map_place, standalone);
465*7c478bd9Sstevel@tonic-gate 		break;
466*7c478bd9Sstevel@tonic-gate 	default:
467*7c478bd9Sstevel@tonic-gate 		break;
468*7c478bd9Sstevel@tonic-gate 	}
469*7c478bd9Sstevel@tonic-gate }
470*7c478bd9Sstevel@tonic-gate 
471*7c478bd9Sstevel@tonic-gate 
472*7c478bd9Sstevel@tonic-gate /*
473*7c478bd9Sstevel@tonic-gate  * Dump map-indexed-fixed
474*7c478bd9Sstevel@tonic-gate  */
475*7c478bd9Sstevel@tonic-gate static void
dump_map_i_f(itm_hdr_t * itm_hdr,itm_place_t map_place,int standalone)476*7c478bd9Sstevel@tonic-gate dump_map_i_f(itm_hdr_t		*itm_hdr, itm_place_t map_place, int standalone)
477*7c478bd9Sstevel@tonic-gate {
478*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t		*tbl_hdr;
479*7c478bd9Sstevel@tonic-gate 	itm_map_idx_fix_hdr_t	*map_hdr;
480*7c478bd9Sstevel@tonic-gate 	itm_num_t		i;
481*7c478bd9Sstevel@tonic-gate 	itm_num_t		j;
482*7c478bd9Sstevel@tonic-gate 	unsigned char		*p;
483*7c478bd9Sstevel@tonic-gate 	unsigned char		*map_error;
484*7c478bd9Sstevel@tonic-gate 	char			*name;
485*7c478bd9Sstevel@tonic-gate 	int			error_flag;
486*7c478bd9Sstevel@tonic-gate 
487*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('d', ("dump_map_i_f\n"));
488*7c478bd9Sstevel@tonic-gate 
489*7c478bd9Sstevel@tonic-gate 	tbl_hdr = (itm_tbl_hdr_t *)ADDR(map_place);
490*7c478bd9Sstevel@tonic-gate 	map_hdr = (itm_map_idx_fix_hdr_t *)(tbl_hdr + 1);
491*7c478bd9Sstevel@tonic-gate 
492*7c478bd9Sstevel@tonic-gate 	if (0 < map_hdr->error_num) {
493*7c478bd9Sstevel@tonic-gate 		p = (unsigned char *)(map_hdr + 1);
494*7c478bd9Sstevel@tonic-gate 		map_error = p + (map_hdr->result_len * (tbl_hdr->number));
495*7c478bd9Sstevel@tonic-gate 		if (0 == map_hdr->default_error) {
496*7c478bd9Sstevel@tonic-gate 			map_error += map_hdr->result_len;
497*7c478bd9Sstevel@tonic-gate 		}
498*7c478bd9Sstevel@tonic-gate 	} else if (1 == map_hdr->default_error) {
499*7c478bd9Sstevel@tonic-gate 		p = (unsigned char *)(map_hdr + 1);
500*7c478bd9Sstevel@tonic-gate 		map_error = p + (map_hdr->result_len * (tbl_hdr->number));
501*7c478bd9Sstevel@tonic-gate 	} else {
502*7c478bd9Sstevel@tonic-gate 		map_error = NULL;
503*7c478bd9Sstevel@tonic-gate 	}
504*7c478bd9Sstevel@tonic-gate 
505*7c478bd9Sstevel@tonic-gate 	if ((standalone) &&
506*7c478bd9Sstevel@tonic-gate 	    (0 == tbl_hdr->name.itm_ptr) &&
507*7c478bd9Sstevel@tonic-gate 	    (map_place.itm_ptr != itm_hdr->direc_init_tbl.itm_ptr)) {
508*7c478bd9Sstevel@tonic-gate 		return;
509*7c478bd9Sstevel@tonic-gate 	}
510*7c478bd9Sstevel@tonic-gate 
511*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)map=%ld ", map_place.itm_ptr));
512*7c478bd9Sstevel@tonic-gate 
513*7c478bd9Sstevel@tonic-gate 	if (0 == tbl_hdr->name.itm_ptr) {
514*7c478bd9Sstevel@tonic-gate 		name = NULL;
515*7c478bd9Sstevel@tonic-gate 	} else {
516*7c478bd9Sstevel@tonic-gate 		name = tbl_name(itm_hdr, tbl_hdr);
517*7c478bd9Sstevel@tonic-gate 	}
518*7c478bd9Sstevel@tonic-gate 
519*7c478bd9Sstevel@tonic-gate 	if ((0 == standalone) && (0 != tbl_hdr->name.itm_ptr)) {
520*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
521*7c478bd9Sstevel@tonic-gate 			printi(0, "%s;\n", name);
522*7c478bd9Sstevel@tonic-gate 		} else {
523*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF "unknown;\n", name);
524*7c478bd9Sstevel@tonic-gate 		}
525*7c478bd9Sstevel@tonic-gate 		return;
526*7c478bd9Sstevel@tonic-gate 	} else {
527*7c478bd9Sstevel@tonic-gate 		printi(1, RNPREF "map");
528*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
529*7c478bd9Sstevel@tonic-gate 			printi(0, " %s", name);
530*7c478bd9Sstevel@tonic-gate 		}
531*7c478bd9Sstevel@tonic-gate 		printi(0, " {\n");
532*7c478bd9Sstevel@tonic-gate 	}
533*7c478bd9Sstevel@tonic-gate 
534*7c478bd9Sstevel@tonic-gate 	printi(0, "//  simple indexed map\n");
535*7c478bd9Sstevel@tonic-gate 	printi(0, "//  source_len=%ld result_len=%ld\n",
536*7c478bd9Sstevel@tonic-gate 		map_hdr->source_len, map_hdr->result_len);
537*7c478bd9Sstevel@tonic-gate 	printi(0, "//  start=0x%p end=0x%p\n", /* DO NOT CHANGE to %ld */
538*7c478bd9Sstevel@tonic-gate 		map_hdr->start.itm_ptr, map_hdr->end.itm_ptr);
539*7c478bd9Sstevel@tonic-gate 	if (0 < map_hdr->error_num) {
540*7c478bd9Sstevel@tonic-gate 		printi(0, "//  error_num=%ld\n",
541*7c478bd9Sstevel@tonic-gate 			map_hdr->error_num);
542*7c478bd9Sstevel@tonic-gate 	}
543*7c478bd9Sstevel@tonic-gate 	if (0 == map_hdr->default_error) {
544*7c478bd9Sstevel@tonic-gate 		p = (((unsigned char *)(map_hdr + 1)) +
545*7c478bd9Sstevel@tonic-gate 			(map_hdr->result_len *
546*7c478bd9Sstevel@tonic-gate 			(map_hdr->end.itm_ptr - map_hdr->start.itm_ptr + 1)));
547*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default 0x");
548*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->result_len; j++) {
549*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *(p + j));
550*7c478bd9Sstevel@tonic-gate 		}
551*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
552*7c478bd9Sstevel@tonic-gate 	} else if (-1 == map_hdr->default_error) {
553*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default\t" RNPREF "default\n");
554*7c478bd9Sstevel@tonic-gate 	}
555*7c478bd9Sstevel@tonic-gate 	error_flag = 0;
556*7c478bd9Sstevel@tonic-gate 	for (i = 0; i <= (map_hdr->end.itm_ptr - map_hdr->start.itm_ptr); i++) {
557*7c478bd9Sstevel@tonic-gate 		p = (((unsigned char *)(map_hdr + 1)) +
558*7c478bd9Sstevel@tonic-gate 			(map_hdr->result_len * i));
559*7c478bd9Sstevel@tonic-gate 		if ((NULL == map_error) ||
560*7c478bd9Sstevel@tonic-gate 		    (0 == *(map_error + i))) {
561*7c478bd9Sstevel@tonic-gate 			printi(0, "0x%0*p\t",
562*7c478bd9Sstevel@tonic-gate 			(map_hdr->source_len * 2), i + map_hdr->start.itm_ptr);
563*7c478bd9Sstevel@tonic-gate 			printi(0, "0x");
564*7c478bd9Sstevel@tonic-gate 			for (j = 0; j < map_hdr->result_len; j++) {
565*7c478bd9Sstevel@tonic-gate 				printi(0, "%02x", *(p + j));
566*7c478bd9Sstevel@tonic-gate 			}
567*7c478bd9Sstevel@tonic-gate 			error_flag = 0;
568*7c478bd9Sstevel@tonic-gate 			printi(0, "\n");
569*7c478bd9Sstevel@tonic-gate 		} else	if (0 >= map_hdr->default_error) {
570*7c478bd9Sstevel@tonic-gate 			if (0 == error_flag) {
571*7c478bd9Sstevel@tonic-gate 				printi(0, "0x%0*p\t",
572*7c478bd9Sstevel@tonic-gate 				(map_hdr->source_len * 2),
573*7c478bd9Sstevel@tonic-gate 				i + map_hdr->start.itm_ptr);
574*7c478bd9Sstevel@tonic-gate 				printi(0, "error\n");
575*7c478bd9Sstevel@tonic-gate 				error_flag = 1;
576*7c478bd9Sstevel@tonic-gate 			} else if (error_flag == 1) {
577*7c478bd9Sstevel@tonic-gate 				printi(0, " :\t:\n");
578*7c478bd9Sstevel@tonic-gate 				error_flag = 2;
579*7c478bd9Sstevel@tonic-gate 			}
580*7c478bd9Sstevel@tonic-gate 		}
581*7c478bd9Sstevel@tonic-gate 	}
582*7c478bd9Sstevel@tonic-gate 	printi(-1, "};\n");
583*7c478bd9Sstevel@tonic-gate }
584*7c478bd9Sstevel@tonic-gate 
585*7c478bd9Sstevel@tonic-gate 
586*7c478bd9Sstevel@tonic-gate /*
587*7c478bd9Sstevel@tonic-gate  * Dump map-lookup-fixed
588*7c478bd9Sstevel@tonic-gate  */
589*7c478bd9Sstevel@tonic-gate static void
dump_map_l_f(itm_hdr_t * itm_hdr,itm_place_t map_place,int standalone)590*7c478bd9Sstevel@tonic-gate dump_map_l_f(itm_hdr_t		*itm_hdr, itm_place_t map_place, int standalone)
591*7c478bd9Sstevel@tonic-gate {
592*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t		*tbl_hdr;
593*7c478bd9Sstevel@tonic-gate 	itm_map_lookup_hdr_t	*map_hdr;
594*7c478bd9Sstevel@tonic-gate 	itm_num_t		i;
595*7c478bd9Sstevel@tonic-gate 	itm_num_t		j;
596*7c478bd9Sstevel@tonic-gate 	unsigned char		*p;
597*7c478bd9Sstevel@tonic-gate 	char			*name;
598*7c478bd9Sstevel@tonic-gate 
599*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('d', ("dump_map_l_f\n"));
600*7c478bd9Sstevel@tonic-gate 
601*7c478bd9Sstevel@tonic-gate 	tbl_hdr = (itm_tbl_hdr_t *)ADDR(map_place);
602*7c478bd9Sstevel@tonic-gate 	map_hdr = (itm_map_lookup_hdr_t *)(tbl_hdr + 1);
603*7c478bd9Sstevel@tonic-gate 
604*7c478bd9Sstevel@tonic-gate 	if ((standalone) &&
605*7c478bd9Sstevel@tonic-gate 	    (0 == tbl_hdr->name.itm_ptr) &&
606*7c478bd9Sstevel@tonic-gate 	    (map_place.itm_ptr != itm_hdr->direc_init_tbl.itm_ptr)) {
607*7c478bd9Sstevel@tonic-gate 		return;
608*7c478bd9Sstevel@tonic-gate 	}
609*7c478bd9Sstevel@tonic-gate 
610*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)map=%ld ", map_place.itm_ptr));
611*7c478bd9Sstevel@tonic-gate 
612*7c478bd9Sstevel@tonic-gate 	if (0 == tbl_hdr->name.itm_ptr) {
613*7c478bd9Sstevel@tonic-gate 		name = NULL;
614*7c478bd9Sstevel@tonic-gate 	} else {
615*7c478bd9Sstevel@tonic-gate 		name = tbl_name(itm_hdr, tbl_hdr);
616*7c478bd9Sstevel@tonic-gate 	}
617*7c478bd9Sstevel@tonic-gate 
618*7c478bd9Sstevel@tonic-gate 	if ((0 == standalone) && (0 != tbl_hdr->name.itm_ptr)) {
619*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
620*7c478bd9Sstevel@tonic-gate 			printi(0, "%s;\n", name);
621*7c478bd9Sstevel@tonic-gate 		} else {
622*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF "unknown;\n", name);
623*7c478bd9Sstevel@tonic-gate 		}
624*7c478bd9Sstevel@tonic-gate 		return;
625*7c478bd9Sstevel@tonic-gate 	} else {
626*7c478bd9Sstevel@tonic-gate 		printi(1, RNPREF "map");
627*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
628*7c478bd9Sstevel@tonic-gate 			printi(0, " %s", name);
629*7c478bd9Sstevel@tonic-gate 		}
630*7c478bd9Sstevel@tonic-gate 		printi(0, " {\n");
631*7c478bd9Sstevel@tonic-gate 	}
632*7c478bd9Sstevel@tonic-gate 
633*7c478bd9Sstevel@tonic-gate 	printi(0, "//  binary search map\n");
634*7c478bd9Sstevel@tonic-gate 	printi(0, "//  source_len=%ld result_len=%ld\n",
635*7c478bd9Sstevel@tonic-gate 		map_hdr->source_len, map_hdr->result_len);
636*7c478bd9Sstevel@tonic-gate 	if (0 < map_hdr->error_num) {
637*7c478bd9Sstevel@tonic-gate 		printi(0, "//  error_num=%ld\n",
638*7c478bd9Sstevel@tonic-gate 			map_hdr->error_num);
639*7c478bd9Sstevel@tonic-gate 	}
640*7c478bd9Sstevel@tonic-gate 
641*7c478bd9Sstevel@tonic-gate 	if (0 == map_hdr->default_error) {
642*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default\t0x");
643*7c478bd9Sstevel@tonic-gate 		p = ((unsigned char *)(map_hdr + 1) +
644*7c478bd9Sstevel@tonic-gate 			(tbl_hdr->number *
645*7c478bd9Sstevel@tonic-gate 			(map_hdr->source_len + map_hdr->result_len + 1)) +
646*7c478bd9Sstevel@tonic-gate 			map_hdr->source_len + 1);
647*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->result_len; j++, p++) {
648*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *p);
649*7c478bd9Sstevel@tonic-gate 		}
650*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
651*7c478bd9Sstevel@tonic-gate 	} else if (-1 == map_hdr->default_error) {
652*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default\t" RNPREF "default\n");
653*7c478bd9Sstevel@tonic-gate 	}
654*7c478bd9Sstevel@tonic-gate 	p = (unsigned char *)(map_hdr + 1);
655*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < tbl_hdr->number; i++) {
656*7c478bd9Sstevel@tonic-gate 		printi(0, "0x");
657*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->source_len; j++, p++) {
658*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *p);
659*7c478bd9Sstevel@tonic-gate 		}
660*7c478bd9Sstevel@tonic-gate 
661*7c478bd9Sstevel@tonic-gate 		if (0 != (*p)) {
662*7c478bd9Sstevel@tonic-gate 			p += map_hdr->result_len + 1;
663*7c478bd9Sstevel@tonic-gate 			printi(0, "\terror");
664*7c478bd9Sstevel@tonic-gate 		} else {
665*7c478bd9Sstevel@tonic-gate 			p++;
666*7c478bd9Sstevel@tonic-gate 			printi(0, "\t0x");
667*7c478bd9Sstevel@tonic-gate 			for (j = 0; j < map_hdr->result_len; j++, p++) {
668*7c478bd9Sstevel@tonic-gate 				printi(0, "%02x", *p);
669*7c478bd9Sstevel@tonic-gate 			}
670*7c478bd9Sstevel@tonic-gate 		}
671*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
672*7c478bd9Sstevel@tonic-gate 	}
673*7c478bd9Sstevel@tonic-gate 	printi(-1, "};\n");
674*7c478bd9Sstevel@tonic-gate }
675*7c478bd9Sstevel@tonic-gate 
676*7c478bd9Sstevel@tonic-gate /*
677*7c478bd9Sstevel@tonic-gate  * Dump map-hash
678*7c478bd9Sstevel@tonic-gate  */
679*7c478bd9Sstevel@tonic-gate static void
dump_map_hash(itm_hdr_t * itm_hdr,itm_place_t map_place,int standalone)680*7c478bd9Sstevel@tonic-gate dump_map_hash(itm_hdr_t		*itm_hdr, itm_place_t map_place, int standalone)
681*7c478bd9Sstevel@tonic-gate {
682*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t		*tbl_hdr;
683*7c478bd9Sstevel@tonic-gate 	itm_map_hash_hdr_t	*map_hdr;
684*7c478bd9Sstevel@tonic-gate 	itm_num_t		i;
685*7c478bd9Sstevel@tonic-gate 	itm_num_t		j;
686*7c478bd9Sstevel@tonic-gate 	unsigned char		*p;
687*7c478bd9Sstevel@tonic-gate 	unsigned char		*map_hash;
688*7c478bd9Sstevel@tonic-gate 	unsigned char		*map_error;
689*7c478bd9Sstevel@tonic-gate 	char			*name;
690*7c478bd9Sstevel@tonic-gate 
691*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('d', ("dump_map_hash\n"));
692*7c478bd9Sstevel@tonic-gate 
693*7c478bd9Sstevel@tonic-gate 	tbl_hdr = (itm_tbl_hdr_t *)ADDR(map_place);
694*7c478bd9Sstevel@tonic-gate 	map_hdr = (itm_map_hash_hdr_t *)(tbl_hdr + 1);
695*7c478bd9Sstevel@tonic-gate 	map_error = (unsigned char *)(map_hdr + 1);
696*7c478bd9Sstevel@tonic-gate 	map_hash = (map_error + map_hdr->hash_tbl_num);
697*7c478bd9Sstevel@tonic-gate 
698*7c478bd9Sstevel@tonic-gate 	if ((standalone) &&
699*7c478bd9Sstevel@tonic-gate 	    (0 == tbl_hdr->name.itm_ptr) &&
700*7c478bd9Sstevel@tonic-gate 	    (map_place.itm_ptr != itm_hdr->direc_init_tbl.itm_ptr)) {
701*7c478bd9Sstevel@tonic-gate 		return;
702*7c478bd9Sstevel@tonic-gate 	}
703*7c478bd9Sstevel@tonic-gate 
704*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)map=%ld ", map_place.itm_ptr));
705*7c478bd9Sstevel@tonic-gate 
706*7c478bd9Sstevel@tonic-gate 	if (0 == tbl_hdr->name.itm_ptr) {
707*7c478bd9Sstevel@tonic-gate 		name = NULL;
708*7c478bd9Sstevel@tonic-gate 	} else {
709*7c478bd9Sstevel@tonic-gate 		name = tbl_name(itm_hdr, tbl_hdr);
710*7c478bd9Sstevel@tonic-gate 	}
711*7c478bd9Sstevel@tonic-gate 
712*7c478bd9Sstevel@tonic-gate 	if ((0 == standalone) && (0 != tbl_hdr->name.itm_ptr)) {
713*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
714*7c478bd9Sstevel@tonic-gate 			printi(0, "%s;\n", name);
715*7c478bd9Sstevel@tonic-gate 		} else {
716*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF "unknown;\n", name);
717*7c478bd9Sstevel@tonic-gate 		}
718*7c478bd9Sstevel@tonic-gate 		return;
719*7c478bd9Sstevel@tonic-gate 	} else {
720*7c478bd9Sstevel@tonic-gate 		printi(1, RNPREF "map");
721*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
722*7c478bd9Sstevel@tonic-gate 			printi(0, " %s", name);
723*7c478bd9Sstevel@tonic-gate 		}
724*7c478bd9Sstevel@tonic-gate 		printi(0, " {\n");
725*7c478bd9Sstevel@tonic-gate 	}
726*7c478bd9Sstevel@tonic-gate 
727*7c478bd9Sstevel@tonic-gate 	printi(0, "//  hashed map\n");
728*7c478bd9Sstevel@tonic-gate 	printi(0, "//  number=%ld\n",
729*7c478bd9Sstevel@tonic-gate 		tbl_hdr->number);
730*7c478bd9Sstevel@tonic-gate 	printi(0, "//  source_len=%ld result_len=%ld\n",
731*7c478bd9Sstevel@tonic-gate 		map_hdr->source_len, map_hdr->result_len);
732*7c478bd9Sstevel@tonic-gate 	printi(0, "//  hash_tbl_size=%ld hash_of_size=%ld hash_of_num=%ld\n",
733*7c478bd9Sstevel@tonic-gate 		map_hdr->hash_tbl_size,
734*7c478bd9Sstevel@tonic-gate 		map_hdr->hash_of_size, map_hdr->hash_of_num);
735*7c478bd9Sstevel@tonic-gate 	if (0 < map_hdr->error_num) {
736*7c478bd9Sstevel@tonic-gate 		printi(0, "//  error_num=%ld\n",
737*7c478bd9Sstevel@tonic-gate 			map_hdr->error_num);
738*7c478bd9Sstevel@tonic-gate 	}
739*7c478bd9Sstevel@tonic-gate 
740*7c478bd9Sstevel@tonic-gate 
741*7c478bd9Sstevel@tonic-gate 	if (0 == map_hdr->default_error) {
742*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default\t0x");
743*7c478bd9Sstevel@tonic-gate 		p = map_hash + map_hdr->hash_tbl_size +
744*7c478bd9Sstevel@tonic-gate 			map_hdr->hash_of_size;
745*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->result_len; j++, p++) {
746*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *p);
747*7c478bd9Sstevel@tonic-gate 		}
748*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
749*7c478bd9Sstevel@tonic-gate 	} else if (-1 == map_hdr->default_error) {
750*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default\t" RNPREF "default\n");
751*7c478bd9Sstevel@tonic-gate 	}
752*7c478bd9Sstevel@tonic-gate 	p = map_hash;
753*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('d', ("dump_map_hash: %ld %ld\n",
754*7c478bd9Sstevel@tonic-gate 			tbl_hdr->number, map_hdr->hash_of_num));
755*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < map_hdr->hash_tbl_num; i++) {
756*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('d', ("dump_map_hash: %x (0x%08p)\n", *p, p));
757*7c478bd9Sstevel@tonic-gate 		if (0 == *(map_error + i)) {
758*7c478bd9Sstevel@tonic-gate 			p += (map_hdr->source_len + 1 + map_hdr->result_len);
759*7c478bd9Sstevel@tonic-gate 			continue;
760*7c478bd9Sstevel@tonic-gate 		}
761*7c478bd9Sstevel@tonic-gate 		printi(0, "0x");
762*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->source_len; j++, p++) {
763*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *p);
764*7c478bd9Sstevel@tonic-gate 		}
765*7c478bd9Sstevel@tonic-gate 
766*7c478bd9Sstevel@tonic-gate 		if (0 != (*p)) {
767*7c478bd9Sstevel@tonic-gate 			p += map_hdr->result_len + 1;
768*7c478bd9Sstevel@tonic-gate 			printi(0, "\terror");
769*7c478bd9Sstevel@tonic-gate 		} else {
770*7c478bd9Sstevel@tonic-gate 			p++;
771*7c478bd9Sstevel@tonic-gate 			printi(0, "\t0x");
772*7c478bd9Sstevel@tonic-gate 			for (j = 0; j < map_hdr->result_len; j++, p++) {
773*7c478bd9Sstevel@tonic-gate 				printi(0, "%02x", *p);
774*7c478bd9Sstevel@tonic-gate 			}
775*7c478bd9Sstevel@tonic-gate 		}
776*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
777*7c478bd9Sstevel@tonic-gate 	}
778*7c478bd9Sstevel@tonic-gate 	printi(0, "// of table\n");
779*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < map_hdr->hash_of_num; i++) {
780*7c478bd9Sstevel@tonic-gate 		printi(0, "0x");
781*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->source_len; j++, p++) {
782*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *p);
783*7c478bd9Sstevel@tonic-gate 		}
784*7c478bd9Sstevel@tonic-gate 		if (0 != (*p)) {
785*7c478bd9Sstevel@tonic-gate 			p += map_hdr->result_len + 1;
786*7c478bd9Sstevel@tonic-gate 			printi(0, "\terror\n");
787*7c478bd9Sstevel@tonic-gate 		} else {
788*7c478bd9Sstevel@tonic-gate 			p++;
789*7c478bd9Sstevel@tonic-gate 			printi(0, "\t0x");
790*7c478bd9Sstevel@tonic-gate 			for (j = 0; j < map_hdr->result_len; j++, p++) {
791*7c478bd9Sstevel@tonic-gate 				printi(0, "%02x", *p);
792*7c478bd9Sstevel@tonic-gate 			}
793*7c478bd9Sstevel@tonic-gate 			printi(0, "\n");
794*7c478bd9Sstevel@tonic-gate 		}
795*7c478bd9Sstevel@tonic-gate 	}
796*7c478bd9Sstevel@tonic-gate 	printi(-1, "};\n");
797*7c478bd9Sstevel@tonic-gate }
798*7c478bd9Sstevel@tonic-gate 
799*7c478bd9Sstevel@tonic-gate 
800*7c478bd9Sstevel@tonic-gate /*
801*7c478bd9Sstevel@tonic-gate  * Dump map-dense-encoding
802*7c478bd9Sstevel@tonic-gate  */
803*7c478bd9Sstevel@tonic-gate static void
dump_map_dense_enc(itm_hdr_t * itm_hdr,itm_place_t map_place,int standalone)804*7c478bd9Sstevel@tonic-gate dump_map_dense_enc(itm_hdr_t	*itm_hdr, itm_place_t map_place, int standalone)
805*7c478bd9Sstevel@tonic-gate {
806*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t			*tbl_hdr;
807*7c478bd9Sstevel@tonic-gate 	itm_map_dense_enc_hdr_t		*map_hdr;
808*7c478bd9Sstevel@tonic-gate 	itm_num_t			i;
809*7c478bd9Sstevel@tonic-gate 	itm_num_t			j;
810*7c478bd9Sstevel@tonic-gate 	unsigned char			*p;
811*7c478bd9Sstevel@tonic-gate 	unsigned char			*map_ptr;
812*7c478bd9Sstevel@tonic-gate 	unsigned char			*map_error;
813*7c478bd9Sstevel@tonic-gate 	unsigned char			*byte_seq_min;
814*7c478bd9Sstevel@tonic-gate 	unsigned char			*byte_seq_max;
815*7c478bd9Sstevel@tonic-gate 	char				*name;
816*7c478bd9Sstevel@tonic-gate 	int				error_flag;
817*7c478bd9Sstevel@tonic-gate 
818*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('d', ("dump_map_dense_enc\n"));
819*7c478bd9Sstevel@tonic-gate 
820*7c478bd9Sstevel@tonic-gate 	tbl_hdr = (itm_tbl_hdr_t *)ADDR(map_place);
821*7c478bd9Sstevel@tonic-gate 	map_hdr = (itm_map_dense_enc_hdr_t *)(tbl_hdr + 1);
822*7c478bd9Sstevel@tonic-gate 	map_ptr = ((unsigned char *)(map_hdr + 1) +
823*7c478bd9Sstevel@tonic-gate 			map_hdr->source_len + map_hdr->source_len);
824*7c478bd9Sstevel@tonic-gate 
825*7c478bd9Sstevel@tonic-gate 	if (0 < map_hdr->error_num) {
826*7c478bd9Sstevel@tonic-gate 		map_error = (map_ptr +
827*7c478bd9Sstevel@tonic-gate 			(tbl_hdr->number * map_hdr->result_len));
828*7c478bd9Sstevel@tonic-gate 		if (0 == map_hdr->default_error) {
829*7c478bd9Sstevel@tonic-gate 			map_error += map_hdr->result_len;
830*7c478bd9Sstevel@tonic-gate 		}
831*7c478bd9Sstevel@tonic-gate 	} else if (1 == map_hdr->default_error) {
832*7c478bd9Sstevel@tonic-gate 		map_error = (map_ptr +
833*7c478bd9Sstevel@tonic-gate 			(tbl_hdr->number * map_hdr->result_len));
834*7c478bd9Sstevel@tonic-gate 	} else {
835*7c478bd9Sstevel@tonic-gate 		map_error = NULL;
836*7c478bd9Sstevel@tonic-gate 	}
837*7c478bd9Sstevel@tonic-gate 	byte_seq_min = (unsigned char *)(map_hdr + 1);
838*7c478bd9Sstevel@tonic-gate 	byte_seq_max = byte_seq_min + map_hdr->source_len;
839*7c478bd9Sstevel@tonic-gate 
840*7c478bd9Sstevel@tonic-gate 	if ((standalone) &&
841*7c478bd9Sstevel@tonic-gate 	    (0 == tbl_hdr->name.itm_ptr) &&
842*7c478bd9Sstevel@tonic-gate 	    (map_place.itm_ptr != itm_hdr->direc_init_tbl.itm_ptr)) {
843*7c478bd9Sstevel@tonic-gate 		return;
844*7c478bd9Sstevel@tonic-gate 	}
845*7c478bd9Sstevel@tonic-gate 
846*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)map=%ld ", map_place.itm_ptr));
847*7c478bd9Sstevel@tonic-gate 
848*7c478bd9Sstevel@tonic-gate 	if (0 == tbl_hdr->name.itm_ptr) {
849*7c478bd9Sstevel@tonic-gate 		name = NULL;
850*7c478bd9Sstevel@tonic-gate 	} else {
851*7c478bd9Sstevel@tonic-gate 		name = tbl_name(itm_hdr, tbl_hdr);
852*7c478bd9Sstevel@tonic-gate 	}
853*7c478bd9Sstevel@tonic-gate 
854*7c478bd9Sstevel@tonic-gate 	if ((0 == standalone) && (0 != tbl_hdr->name.itm_ptr)) {
855*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
856*7c478bd9Sstevel@tonic-gate 			printi(0, "%s;\n", name);
857*7c478bd9Sstevel@tonic-gate 		} else {
858*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF "unknown;\n", name);
859*7c478bd9Sstevel@tonic-gate 		}
860*7c478bd9Sstevel@tonic-gate 		return;
861*7c478bd9Sstevel@tonic-gate 	} else {
862*7c478bd9Sstevel@tonic-gate 		printi(1, RNPREF "map");
863*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
864*7c478bd9Sstevel@tonic-gate 			printi(0, " %s", name);
865*7c478bd9Sstevel@tonic-gate 		}
866*7c478bd9Sstevel@tonic-gate 		printi(0, " {\n");
867*7c478bd9Sstevel@tonic-gate 	}
868*7c478bd9Sstevel@tonic-gate 
869*7c478bd9Sstevel@tonic-gate 	printi(0, "//  dense encoded map\n");
870*7c478bd9Sstevel@tonic-gate 	printi(0, "//  entry_number=%ld\n", tbl_hdr->number);
871*7c478bd9Sstevel@tonic-gate 	printi(0, "//  source_len=%ld result_len=%ld\n",
872*7c478bd9Sstevel@tonic-gate 		map_hdr->source_len, map_hdr->result_len);
873*7c478bd9Sstevel@tonic-gate 	printi(0, "//  byte_seq_min=0x");
874*7c478bd9Sstevel@tonic-gate 	p = byte_seq_min;
875*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < map_hdr->source_len; i++, p++) {
876*7c478bd9Sstevel@tonic-gate 		printi(0, "%02x", *p);
877*7c478bd9Sstevel@tonic-gate 	}
878*7c478bd9Sstevel@tonic-gate 	printi(0, "\n");
879*7c478bd9Sstevel@tonic-gate 	printi(0, "//  byte_seq_max=0x");
880*7c478bd9Sstevel@tonic-gate 	p = byte_seq_max;
881*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < map_hdr->source_len; i++, p++) {
882*7c478bd9Sstevel@tonic-gate 		printi(0, "%02x", *p);
883*7c478bd9Sstevel@tonic-gate 	}
884*7c478bd9Sstevel@tonic-gate 	printi(0, "\n");
885*7c478bd9Sstevel@tonic-gate 	if (0 < map_hdr->error_num) {
886*7c478bd9Sstevel@tonic-gate 		printi(0, "//  error_num=%ld\n",
887*7c478bd9Sstevel@tonic-gate 			map_hdr->error_num);
888*7c478bd9Sstevel@tonic-gate 	}
889*7c478bd9Sstevel@tonic-gate 	if (0 == map_hdr->default_error) {
890*7c478bd9Sstevel@tonic-gate 		p = (map_ptr + (tbl_hdr->number * map_hdr->result_len));
891*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default 0x");
892*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < map_hdr->result_len; j++) {
893*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *(p + j));
894*7c478bd9Sstevel@tonic-gate 		}
895*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
896*7c478bd9Sstevel@tonic-gate 	} else if (-1 == map_hdr->default_error) {
897*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "default\t" RNPREF "default\n");
898*7c478bd9Sstevel@tonic-gate 	}
899*7c478bd9Sstevel@tonic-gate 
900*7c478bd9Sstevel@tonic-gate 	error_flag = 0;
901*7c478bd9Sstevel@tonic-gate 	for (i = 0, p = map_ptr; i < tbl_hdr->number;
902*7c478bd9Sstevel@tonic-gate 	    i++, p += map_hdr->result_len) {
903*7c478bd9Sstevel@tonic-gate 		if ((NULL == map_error) || (0 == *(map_error + i))) {
904*7c478bd9Sstevel@tonic-gate 			printi(0, "%s\t",
905*7c478bd9Sstevel@tonic-gate 				dense_enc_index_to_byte_seq(
906*7c478bd9Sstevel@tonic-gate 					i, map_hdr->source_len,
907*7c478bd9Sstevel@tonic-gate 					byte_seq_min, byte_seq_max));
908*7c478bd9Sstevel@tonic-gate 			printi(0, "0x");
909*7c478bd9Sstevel@tonic-gate 			for (j = 0; j < map_hdr->result_len; j++) {
910*7c478bd9Sstevel@tonic-gate 				printi(0, "%02x", *(p + j));
911*7c478bd9Sstevel@tonic-gate 			}
912*7c478bd9Sstevel@tonic-gate 			printi(0, "\n");
913*7c478bd9Sstevel@tonic-gate 			error_flag = 0;
914*7c478bd9Sstevel@tonic-gate 		} else	if (0 >= map_hdr->default_error) {
915*7c478bd9Sstevel@tonic-gate 			if (0 == error_flag) {
916*7c478bd9Sstevel@tonic-gate 				printi(0, "%s\t",
917*7c478bd9Sstevel@tonic-gate 					dense_enc_index_to_byte_seq(
918*7c478bd9Sstevel@tonic-gate 					i, map_hdr->source_len,
919*7c478bd9Sstevel@tonic-gate 					byte_seq_min, byte_seq_max));
920*7c478bd9Sstevel@tonic-gate 				printi(0, "error\n");
921*7c478bd9Sstevel@tonic-gate 				error_flag = 1;
922*7c478bd9Sstevel@tonic-gate 			} else if (error_flag == 1) {
923*7c478bd9Sstevel@tonic-gate 				printi(0, " :\t:\n");
924*7c478bd9Sstevel@tonic-gate 				error_flag = 2;
925*7c478bd9Sstevel@tonic-gate 			}
926*7c478bd9Sstevel@tonic-gate 		}
927*7c478bd9Sstevel@tonic-gate 	}
928*7c478bd9Sstevel@tonic-gate 	printi(-1, "};\n");
929*7c478bd9Sstevel@tonic-gate }
930*7c478bd9Sstevel@tonic-gate 
931*7c478bd9Sstevel@tonic-gate 
932*7c478bd9Sstevel@tonic-gate /*
933*7c478bd9Sstevel@tonic-gate  * Evaluate condition table
934*7c478bd9Sstevel@tonic-gate  */
935*7c478bd9Sstevel@tonic-gate static void
dump_cond_tbl(itm_hdr_t * itm_hdr,itm_place_t cond_place,int standalone)936*7c478bd9Sstevel@tonic-gate dump_cond_tbl(itm_hdr_t *itm_hdr, itm_place_t cond_place, int standalone)
937*7c478bd9Sstevel@tonic-gate {
938*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*cond_hdr;
939*7c478bd9Sstevel@tonic-gate 	itm_cond_t	*cond;
940*7c478bd9Sstevel@tonic-gate 	long		i;
941*7c478bd9Sstevel@tonic-gate 	char		*name;
942*7c478bd9Sstevel@tonic-gate 
943*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)cond_tbl=%ld ", cond_place.itm_ptr));
944*7c478bd9Sstevel@tonic-gate 	cond_hdr = (itm_tbl_hdr_t *)(ADDR(cond_place));
945*7c478bd9Sstevel@tonic-gate 	cond = (itm_cond_t *)(cond_hdr + 1);
946*7c478bd9Sstevel@tonic-gate 
947*7c478bd9Sstevel@tonic-gate 	if ((standalone) && (0 == cond_hdr->name.itm_ptr)) {
948*7c478bd9Sstevel@tonic-gate 		TRACE_MESSAGE('t', ("skip condition(%d, %ld)\n",
949*7c478bd9Sstevel@tonic-gate 		standalone, cond_hdr->name.itm_ptr));
950*7c478bd9Sstevel@tonic-gate 		return;
951*7c478bd9Sstevel@tonic-gate 	}
952*7c478bd9Sstevel@tonic-gate 
953*7c478bd9Sstevel@tonic-gate 	if (0 == cond_place.itm_ptr) {
954*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "true");
955*7c478bd9Sstevel@tonic-gate 		return;
956*7c478bd9Sstevel@tonic-gate 	}
957*7c478bd9Sstevel@tonic-gate 
958*7c478bd9Sstevel@tonic-gate 	if (0 == cond_hdr->name.itm_ptr) {
959*7c478bd9Sstevel@tonic-gate 		name = NULL;
960*7c478bd9Sstevel@tonic-gate 	} else {
961*7c478bd9Sstevel@tonic-gate 		name = tbl_name(itm_hdr, cond_hdr);
962*7c478bd9Sstevel@tonic-gate 	}
963*7c478bd9Sstevel@tonic-gate 
964*7c478bd9Sstevel@tonic-gate 	if ((0 == standalone) && (0 != cond_hdr->name.itm_ptr)) {
965*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
966*7c478bd9Sstevel@tonic-gate 			printi(0, "%s", name);
967*7c478bd9Sstevel@tonic-gate 		} else {
968*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF "unknown");
969*7c478bd9Sstevel@tonic-gate 		}
970*7c478bd9Sstevel@tonic-gate 		return;
971*7c478bd9Sstevel@tonic-gate 	} else {
972*7c478bd9Sstevel@tonic-gate 		printi(1, RNPREF "condition");
973*7c478bd9Sstevel@tonic-gate 		if (NULL != name) {
974*7c478bd9Sstevel@tonic-gate 			printi(0, " %s", name);
975*7c478bd9Sstevel@tonic-gate 		}
976*7c478bd9Sstevel@tonic-gate 		printi(0, " {\n");
977*7c478bd9Sstevel@tonic-gate 	}
978*7c478bd9Sstevel@tonic-gate 
979*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < cond_hdr->number; i++, cond++) {
980*7c478bd9Sstevel@tonic-gate 		switch (cond->type) {
981*7c478bd9Sstevel@tonic-gate 		case ITM_COND_BETWEEN:
982*7c478bd9Sstevel@tonic-gate 			dump_range(itm_hdr, cond->operand.place);
983*7c478bd9Sstevel@tonic-gate 			break;
984*7c478bd9Sstevel@tonic-gate 		case ITM_COND_EXPR:
985*7c478bd9Sstevel@tonic-gate 			dump_expr(itm_hdr, cond->operand.place);
986*7c478bd9Sstevel@tonic-gate 			printi(0, ";\n");
987*7c478bd9Sstevel@tonic-gate 			break;
988*7c478bd9Sstevel@tonic-gate 		case ITM_COND_ESCAPESEQ:
989*7c478bd9Sstevel@tonic-gate 			dump_escapeseq(itm_hdr, cond->operand.place);
990*7c478bd9Sstevel@tonic-gate 			break;
991*7c478bd9Sstevel@tonic-gate 		default:
992*7c478bd9Sstevel@tonic-gate 			printi(0, "// unknown %d\n", cond->type);
993*7c478bd9Sstevel@tonic-gate 			break;
994*7c478bd9Sstevel@tonic-gate 		}
995*7c478bd9Sstevel@tonic-gate 	}
996*7c478bd9Sstevel@tonic-gate 
997*7c478bd9Sstevel@tonic-gate 	if (standalone) {
998*7c478bd9Sstevel@tonic-gate 		printi(-1, "};\n");
999*7c478bd9Sstevel@tonic-gate 	} else {
1000*7c478bd9Sstevel@tonic-gate 		printi(-1, "}");
1001*7c478bd9Sstevel@tonic-gate 	}
1002*7c478bd9Sstevel@tonic-gate }
1003*7c478bd9Sstevel@tonic-gate 
1004*7c478bd9Sstevel@tonic-gate 
1005*7c478bd9Sstevel@tonic-gate /*
1006*7c478bd9Sstevel@tonic-gate  * Dump operation table
1007*7c478bd9Sstevel@tonic-gate  */
1008*7c478bd9Sstevel@tonic-gate static void
dump_op_tbl(itm_hdr_t * itm_hdr,itm_place_t op_tbl_place,int standalone)1009*7c478bd9Sstevel@tonic-gate dump_op_tbl(itm_hdr_t	*itm_hdr, itm_place_t op_tbl_place, int standalone)
1010*7c478bd9Sstevel@tonic-gate {
1011*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*op_hdr;
1012*7c478bd9Sstevel@tonic-gate 	itm_op_t	*operation;
1013*7c478bd9Sstevel@tonic-gate 	itm_place2_t	op_place;
1014*7c478bd9Sstevel@tonic-gate 	long		i;
1015*7c478bd9Sstevel@tonic-gate 	char		*name;
1016*7c478bd9Sstevel@tonic-gate 	static int	op_tbl_level;
1017*7c478bd9Sstevel@tonic-gate 
1018*7c478bd9Sstevel@tonic-gate 	op_hdr = (itm_tbl_hdr_t *)(ADDR(op_tbl_place));
1019*7c478bd9Sstevel@tonic-gate 	operation = (itm_op_t *)(op_hdr + 1);
1020*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)op_tbl=%ld ", op_tbl_place));
1021*7c478bd9Sstevel@tonic-gate 
1022*7c478bd9Sstevel@tonic-gate 	name = tbl_name(itm_hdr, op_hdr);
1023*7c478bd9Sstevel@tonic-gate 
1024*7c478bd9Sstevel@tonic-gate 	if ((standalone) && (NULL == name))
1025*7c478bd9Sstevel@tonic-gate 		return;
1026*7c478bd9Sstevel@tonic-gate 
1027*7c478bd9Sstevel@tonic-gate 	if (0 == op_tbl_level) {
1028*7c478bd9Sstevel@tonic-gate 		if ((0 == standalone) && (0 != op_hdr->name.itm_ptr)) {
1029*7c478bd9Sstevel@tonic-gate 			if (NULL != name) {
1030*7c478bd9Sstevel@tonic-gate 				printi(0, "%s;\n", name);
1031*7c478bd9Sstevel@tonic-gate 			} else {
1032*7c478bd9Sstevel@tonic-gate 				printi(0, RNPREF "unknown;", name);
1033*7c478bd9Sstevel@tonic-gate 			}
1034*7c478bd9Sstevel@tonic-gate 			return;
1035*7c478bd9Sstevel@tonic-gate 		} else {
1036*7c478bd9Sstevel@tonic-gate 			printi(1, RNPREF "operation");
1037*7c478bd9Sstevel@tonic-gate 			if (NULL != name) {
1038*7c478bd9Sstevel@tonic-gate 				printi(0, " %s", name);
1039*7c478bd9Sstevel@tonic-gate 			}
1040*7c478bd9Sstevel@tonic-gate 			printi(0, " {\n");
1041*7c478bd9Sstevel@tonic-gate 		}
1042*7c478bd9Sstevel@tonic-gate 	}
1043*7c478bd9Sstevel@tonic-gate 
1044*7c478bd9Sstevel@tonic-gate 	op_tbl_level += 1;
1045*7c478bd9Sstevel@tonic-gate 
1046*7c478bd9Sstevel@tonic-gate 	op_place = op_tbl_place.itm_ptr + (sizeof (itm_tbl_hdr_t));
1047*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < op_hdr->number;
1048*7c478bd9Sstevel@tonic-gate 	    i++, operation++, op_place += (sizeof (itm_op_t))) {
1049*7c478bd9Sstevel@tonic-gate 		dump_op(itm_hdr, op_place);
1050*7c478bd9Sstevel@tonic-gate 	}
1051*7c478bd9Sstevel@tonic-gate 
1052*7c478bd9Sstevel@tonic-gate 	op_tbl_level -= 1;
1053*7c478bd9Sstevel@tonic-gate 
1054*7c478bd9Sstevel@tonic-gate 	if (0 == op_tbl_level) {
1055*7c478bd9Sstevel@tonic-gate 		printi(-1, "};\n");
1056*7c478bd9Sstevel@tonic-gate 	}
1057*7c478bd9Sstevel@tonic-gate }
1058*7c478bd9Sstevel@tonic-gate 
1059*7c478bd9Sstevel@tonic-gate 
1060*7c478bd9Sstevel@tonic-gate /*
1061*7c478bd9Sstevel@tonic-gate  * Evaluate single operation
1062*7c478bd9Sstevel@tonic-gate  */
1063*7c478bd9Sstevel@tonic-gate static void
dump_op(itm_hdr_t * itm_hdr,itm_place2_t op_place)1064*7c478bd9Sstevel@tonic-gate dump_op(itm_hdr_t	*itm_hdr, itm_place2_t op_place)
1065*7c478bd9Sstevel@tonic-gate {
1066*7c478bd9Sstevel@tonic-gate 	itm_op_t	*operation;
1067*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*op_hdr;
1068*7c478bd9Sstevel@tonic-gate 
1069*7c478bd9Sstevel@tonic-gate 	operation = (itm_op_t *)ADDR2(op_place);
1070*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)op=%ld ", op_place));
1071*7c478bd9Sstevel@tonic-gate 
1072*7c478bd9Sstevel@tonic-gate 	switch (operation->type) {
1073*7c478bd9Sstevel@tonic-gate 	case ITM_OP_EXPR:
1074*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1075*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1076*7c478bd9Sstevel@tonic-gate 		break;
1077*7c478bd9Sstevel@tonic-gate 	case ITM_OP_ERROR:
1078*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "error ");
1079*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1080*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1081*7c478bd9Sstevel@tonic-gate 		break;
1082*7c478bd9Sstevel@tonic-gate 	case ITM_OP_ERROR_D:
1083*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "error %d;",
1084*7c478bd9Sstevel@tonic-gate 			operation->data.operand[0].itm_ptr);
1085*7c478bd9Sstevel@tonic-gate 		printi(0, "\n");
1086*7c478bd9Sstevel@tonic-gate 		break;
1087*7c478bd9Sstevel@tonic-gate 	case ITM_OP_DISCARD:
1088*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "discard ");
1089*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1090*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1091*7c478bd9Sstevel@tonic-gate 		break;
1092*7c478bd9Sstevel@tonic-gate 	case ITM_OP_DISCARD_D:
1093*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "discard %ld;\n",
1094*7c478bd9Sstevel@tonic-gate 			operation->data.operand[0].itm_ptr);
1095*7c478bd9Sstevel@tonic-gate 		break;
1096*7c478bd9Sstevel@tonic-gate 	case ITM_OP_OUT:
1097*7c478bd9Sstevel@tonic-gate 	case ITM_OP_OUT_D:
1098*7c478bd9Sstevel@tonic-gate 	case ITM_OP_OUT_R:
1099*7c478bd9Sstevel@tonic-gate 	case ITM_OP_OUT_S:
1100*7c478bd9Sstevel@tonic-gate 	case ITM_OP_OUT_INVD:
1101*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "out = ");
1102*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1103*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1104*7c478bd9Sstevel@tonic-gate 		break;
1105*7c478bd9Sstevel@tonic-gate 	case ITM_OP_IF:
1106*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "if ");
1107*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1108*7c478bd9Sstevel@tonic-gate 		printi(1, " {\n");
1109*7c478bd9Sstevel@tonic-gate 		dump_op_tbl(itm_hdr, operation->data.operand[1], 0);
1110*7c478bd9Sstevel@tonic-gate 		printi(-1, "}\n");
1111*7c478bd9Sstevel@tonic-gate 		break;
1112*7c478bd9Sstevel@tonic-gate 	case ITM_OP_IF_ELSE:
1113*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "if ");
1114*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1115*7c478bd9Sstevel@tonic-gate 		printi(1, " {\n");
1116*7c478bd9Sstevel@tonic-gate 		dump_op_tbl(itm_hdr, operation->data.operand[1], 0);
1117*7c478bd9Sstevel@tonic-gate 		printi(-1, "} ");
1118*7c478bd9Sstevel@tonic-gate 		op_hdr = ADDR(operation->data.operand[2]);
1119*7c478bd9Sstevel@tonic-gate 		if ((1 == op_hdr->number) &&
1120*7c478bd9Sstevel@tonic-gate 		    ((ITM_OP_IF_ELSE == ((itm_op_t *)(op_hdr + 1))->type) ||
1121*7c478bd9Sstevel@tonic-gate 		    (ITM_OP_IF == ((itm_op_t *)(op_hdr + 1))->type))) {
1122*7c478bd9Sstevel@tonic-gate 			printi(0, RNPREF "else ");
1123*7c478bd9Sstevel@tonic-gate 			dump_op_tbl(itm_hdr, operation->data.operand[2], 0);
1124*7c478bd9Sstevel@tonic-gate 		} else {
1125*7c478bd9Sstevel@tonic-gate 			printi(1, RNPREF "else {\n");
1126*7c478bd9Sstevel@tonic-gate 			dump_op_tbl(itm_hdr, operation->data.operand[2], 0);
1127*7c478bd9Sstevel@tonic-gate 			printi(-1, "}\n");
1128*7c478bd9Sstevel@tonic-gate 		}
1129*7c478bd9Sstevel@tonic-gate 		break;
1130*7c478bd9Sstevel@tonic-gate 	case ITM_OP_DIRECTION: /* switch direction */
1131*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "direction %1$s;\n", tbl_name(itm_hdr,
1132*7c478bd9Sstevel@tonic-gate 			(itm_tbl_hdr_t *)ADDR(operation->data.operand[0])));
1133*7c478bd9Sstevel@tonic-gate 		break;
1134*7c478bd9Sstevel@tonic-gate 	case ITM_OP_MAP:	/* use map */
1135*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "map %1$s", tbl_name(itm_hdr,
1136*7c478bd9Sstevel@tonic-gate 			(itm_tbl_hdr_t *)ADDR(operation->data.operand[0])));
1137*7c478bd9Sstevel@tonic-gate 		if (0 != operation->data.operand[1].itm_ptr) {
1138*7c478bd9Sstevel@tonic-gate 			printi(0, " ");
1139*7c478bd9Sstevel@tonic-gate 			dump_expr(itm_hdr, operation->data.operand[1]);
1140*7c478bd9Sstevel@tonic-gate 		}
1141*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1142*7c478bd9Sstevel@tonic-gate 		break;
1143*7c478bd9Sstevel@tonic-gate 	case ITM_OP_OPERATION: /* invoke operation */
1144*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "operation %1$s;\n",
1145*7c478bd9Sstevel@tonic-gate 			tbl_name(itm_hdr,
1146*7c478bd9Sstevel@tonic-gate 			(itm_tbl_hdr_t *)ADDR(operation->data.operand[0])));
1147*7c478bd9Sstevel@tonic-gate 		break;
1148*7c478bd9Sstevel@tonic-gate 	case ITM_OP_INIT: /* invoke init operation */
1149*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "operation " RNPREF "init;\n");
1150*7c478bd9Sstevel@tonic-gate 		break;
1151*7c478bd9Sstevel@tonic-gate 	case ITM_OP_RESET: /* invoke reset operation */
1152*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "operation " RNPREF "reset;\n");
1153*7c478bd9Sstevel@tonic-gate 		break;
1154*7c478bd9Sstevel@tonic-gate 	case ITM_OP_BREAK: /* break */
1155*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "break;\n");
1156*7c478bd9Sstevel@tonic-gate 		break;
1157*7c478bd9Sstevel@tonic-gate 	case ITM_OP_RETURN: /* return */
1158*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "return;\n");
1159*7c478bd9Sstevel@tonic-gate 		break;
1160*7c478bd9Sstevel@tonic-gate 	case ITM_OP_PRINTCHR:
1161*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "printchr ");
1162*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1163*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1164*7c478bd9Sstevel@tonic-gate 		break;
1165*7c478bd9Sstevel@tonic-gate 	case ITM_OP_PRINTHD:
1166*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "printhd ");
1167*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1168*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1169*7c478bd9Sstevel@tonic-gate 		break;
1170*7c478bd9Sstevel@tonic-gate 	case ITM_OP_PRINTINT:
1171*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "printint ");
1172*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, operation->data.operand[0]);
1173*7c478bd9Sstevel@tonic-gate 		printi(0, ";\n");
1174*7c478bd9Sstevel@tonic-gate 		break;
1175*7c478bd9Sstevel@tonic-gate 	default:
1176*7c478bd9Sstevel@tonic-gate 		printi(0, "// unknown operation: %lx\n", operation->type);
1177*7c478bd9Sstevel@tonic-gate 		break;
1178*7c478bd9Sstevel@tonic-gate 	}
1179*7c478bd9Sstevel@tonic-gate }
1180*7c478bd9Sstevel@tonic-gate 
1181*7c478bd9Sstevel@tonic-gate 
1182*7c478bd9Sstevel@tonic-gate /*
1183*7c478bd9Sstevel@tonic-gate  * Dump expression
1184*7c478bd9Sstevel@tonic-gate  */
1185*7c478bd9Sstevel@tonic-gate static void
dump_expr(itm_hdr_t * itm_hdr,itm_place_t expr_place)1186*7c478bd9Sstevel@tonic-gate dump_expr(itm_hdr_t	*itm_hdr, itm_place_t expr_place)
1187*7c478bd9Sstevel@tonic-gate {
1188*7c478bd9Sstevel@tonic-gate 	itm_expr_t	*expr;
1189*7c478bd9Sstevel@tonic-gate 	itm_data_t	data;
1190*7c478bd9Sstevel@tonic-gate 
1191*7c478bd9Sstevel@tonic-gate 	expr = (itm_expr_t *)ADDR(expr_place);
1192*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(*)ex=%ld ", expr_place.itm_ptr));
1193*7c478bd9Sstevel@tonic-gate 
1194*7c478bd9Sstevel@tonic-gate 	switch (expr->type) {
1195*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NONE:		/* not used */
1196*7c478bd9Sstevel@tonic-gate 		printi(0, "none");
1197*7c478bd9Sstevel@tonic-gate 		break;
1198*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NOP:		/* not used */
1199*7c478bd9Sstevel@tonic-gate 		printi(0, "NOP");
1200*7c478bd9Sstevel@tonic-gate 		break;
1201*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NAME:		/* not used */
1202*7c478bd9Sstevel@tonic-gate 		printi(0, "NAME");
1203*7c478bd9Sstevel@tonic-gate 		break;
1204*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_INT:		/* integer */
1205*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.itm_exnum);
1206*7c478bd9Sstevel@tonic-gate 		break;
1207*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SEQ:		/* byte sequence */
1208*7c478bd9Sstevel@tonic-gate 		data = expr->data.value;
1209*7c478bd9Sstevel@tonic-gate 		if ((sizeof (itm_place_t)) < data.size) {
1210*7c478bd9Sstevel@tonic-gate 			data.place.itm_ptr = (itm_place2_t)ADDR(data.place);
1211*7c478bd9Sstevel@tonic-gate 		}
1212*7c478bd9Sstevel@tonic-gate 		printi(0, "0x%s", data_to_hexadecimal(&data));
1213*7c478bd9Sstevel@tonic-gate 		break;
1214*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_REG:		/* register */
1215*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1216*7c478bd9Sstevel@tonic-gate 		break;
1217*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_IN_VECTOR:	/* in[expr] */
1218*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[");
1219*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1220*7c478bd9Sstevel@tonic-gate 		printi(0, "]");
1221*7c478bd9Sstevel@tonic-gate 		break;
1222*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_IN_VECTOR_D:	/* in[num] */
1223*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1224*7c478bd9Sstevel@tonic-gate 		if (0 == expr->data.operand[0].itm_ptr) {
1225*7c478bd9Sstevel@tonic-gate 			printi(0, " // inputsize");
1226*7c478bd9Sstevel@tonic-gate 		}
1227*7c478bd9Sstevel@tonic-gate 		break;
1228*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OUT:		/* out */
1229*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "out");
1230*7c478bd9Sstevel@tonic-gate 		break;
1231*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_TRUE:		/* true */
1232*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "true");
1233*7c478bd9Sstevel@tonic-gate 		break;
1234*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_FALSE:		/* false */
1235*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "false");
1236*7c478bd9Sstevel@tonic-gate 		break;
1237*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_UMINUS:		/* unary minus */
1238*7c478bd9Sstevel@tonic-gate 		printi(0, "-");
1239*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1240*7c478bd9Sstevel@tonic-gate 		break;
1241*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS:		/* A  + B */
1242*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1243*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1244*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1245*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1246*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1247*7c478bd9Sstevel@tonic-gate 		break;
1248*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_E_D:		/* exprA + B */
1249*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1250*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1251*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1252*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1253*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1254*7c478bd9Sstevel@tonic-gate 		break;
1255*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_E_R:		/* exprA + varB */
1256*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1257*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1258*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1259*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1260*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1261*7c478bd9Sstevel@tonic-gate 		break;
1262*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_E_INVD:	/* exprA + in[B] */
1263*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1264*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1265*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1266*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1267*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1268*7c478bd9Sstevel@tonic-gate 		break;
1269*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_D_E:		/* intA + exprB */
1270*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1271*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1272*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1273*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1274*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1275*7c478bd9Sstevel@tonic-gate 		break;
1276*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_D_D:		/* intA + B */
1277*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1278*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1279*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1280*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1281*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1282*7c478bd9Sstevel@tonic-gate 		break;
1283*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_D_R:		/* intA + varB */
1284*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1285*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1286*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1287*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1288*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1289*7c478bd9Sstevel@tonic-gate 		break;
1290*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_D_INVD:	/* intA + in[B] */
1291*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1292*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1293*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1294*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1295*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1296*7c478bd9Sstevel@tonic-gate 		break;
1297*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_R_E:		/* varA + exprB */
1298*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1299*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1300*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1301*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1302*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1303*7c478bd9Sstevel@tonic-gate 		break;
1304*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_R_D:		/* varA + B */
1305*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1306*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1307*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1308*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1309*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1310*7c478bd9Sstevel@tonic-gate 		break;
1311*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_R_R:		/* varA + varB */
1312*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1313*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1314*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1315*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1316*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1317*7c478bd9Sstevel@tonic-gate 		break;
1318*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_R_INVD:	/* varA + in[B] */
1319*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1320*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1321*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1322*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1323*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1324*7c478bd9Sstevel@tonic-gate 		break;
1325*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_INVD_E:	/* in[A] + exprB */
1326*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1327*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1328*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1329*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1330*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1331*7c478bd9Sstevel@tonic-gate 		break;
1332*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_INVD_D:	/* in[A] + B */
1333*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1334*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1335*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1336*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1337*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1338*7c478bd9Sstevel@tonic-gate 		break;
1339*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_INVD_R:	/* in[A] + varB */
1340*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1341*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1342*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1343*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1344*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1345*7c478bd9Sstevel@tonic-gate 		break;
1346*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_PLUS_INVD_INVD:	/* in[A] + in[B] */
1347*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1348*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1349*7c478bd9Sstevel@tonic-gate 		printi(0, " + ");
1350*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1351*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1352*7c478bd9Sstevel@tonic-gate 		break;
1353*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS:		/* A  - B */
1354*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1355*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1356*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1357*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1358*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1359*7c478bd9Sstevel@tonic-gate 		break;
1360*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_E_D:		/* exprA - B */
1361*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1362*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1363*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1364*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1365*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1366*7c478bd9Sstevel@tonic-gate 		break;
1367*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_E_R:		/* exprA - varB */
1368*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1369*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1370*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1371*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1372*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1373*7c478bd9Sstevel@tonic-gate 		break;
1374*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_E_INVD:	/* exprA - in[B] */
1375*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1376*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1377*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1378*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1379*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1380*7c478bd9Sstevel@tonic-gate 		break;
1381*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_D_E:		/* intA - exprB */
1382*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1383*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1384*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1385*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1386*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1387*7c478bd9Sstevel@tonic-gate 		break;
1388*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_D_D:		/* intA - B */
1389*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1390*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1391*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1392*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1393*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1394*7c478bd9Sstevel@tonic-gate 		break;
1395*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_D_R:		/* intA - varB */
1396*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1397*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1398*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1399*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1400*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1401*7c478bd9Sstevel@tonic-gate 		break;
1402*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_D_INVD:	/* intA - in[B] */
1403*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1404*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1405*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1406*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1407*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1408*7c478bd9Sstevel@tonic-gate 		break;
1409*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_R_E:		/* varA - exprB */
1410*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1411*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1412*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1413*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1414*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1415*7c478bd9Sstevel@tonic-gate 		break;
1416*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_R_D:		/* varA - B */
1417*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1418*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1419*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1420*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1421*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1422*7c478bd9Sstevel@tonic-gate 		break;
1423*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_R_R:		/* varA - varB */
1424*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1425*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1426*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1427*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1428*7c478bd9Sstevel@tonic-gate 		break;
1429*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_R_INVD:	/* varA - in[B] */
1430*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1431*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1432*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1433*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1434*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1435*7c478bd9Sstevel@tonic-gate 		break;
1436*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_INVD_E:	/* in[A] - exprB */
1437*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1438*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1439*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1440*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1441*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1442*7c478bd9Sstevel@tonic-gate 		break;
1443*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_INVD_D:	/* in[A] - B */
1444*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1445*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1446*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1447*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1448*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1449*7c478bd9Sstevel@tonic-gate 		break;
1450*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_INVD_R:	/* in[A] - varB */
1451*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1452*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1453*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1454*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1455*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1456*7c478bd9Sstevel@tonic-gate 		break;
1457*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MINUS_INVD_INVD:	/* in[A] - in[B] */
1458*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1459*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1460*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
1461*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1462*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1463*7c478bd9Sstevel@tonic-gate 		break;
1464*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL:		/* A  * B */
1465*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1466*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1467*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1468*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1469*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1470*7c478bd9Sstevel@tonic-gate 		break;
1471*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_E_D:		/* exprA * B */
1472*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1473*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1474*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1475*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1476*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1477*7c478bd9Sstevel@tonic-gate 		break;
1478*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_E_R:		/* exprA * varB */
1479*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1480*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1481*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1482*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1483*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1484*7c478bd9Sstevel@tonic-gate 		break;
1485*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_E_INVD:	/* exprA * in[B] */
1486*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1487*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1488*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1489*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1490*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1491*7c478bd9Sstevel@tonic-gate 		break;
1492*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_D_E:		/* intA * exprB */
1493*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1494*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1495*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1496*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1497*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1498*7c478bd9Sstevel@tonic-gate 		break;
1499*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_D_D:		/* intA * B */
1500*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1501*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1502*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1503*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1504*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1505*7c478bd9Sstevel@tonic-gate 		break;
1506*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_D_R:		/* intA * varB */
1507*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1508*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1509*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1510*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1511*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1512*7c478bd9Sstevel@tonic-gate 		break;
1513*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_D_INVD:	/* intA * in[B] */
1514*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1515*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1516*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1517*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1518*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1519*7c478bd9Sstevel@tonic-gate 		break;
1520*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_R_E:		/* varA * exprB */
1521*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1522*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1523*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1524*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1525*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1526*7c478bd9Sstevel@tonic-gate 		break;
1527*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_R_D:		/* varA * B */
1528*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1529*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1530*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1531*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1532*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1533*7c478bd9Sstevel@tonic-gate 		break;
1534*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_R_R:		/* varA * varB */
1535*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1536*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1537*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1538*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1539*7c478bd9Sstevel@tonic-gate 		break;
1540*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_R_INVD:	/* varA * in[B] */
1541*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1542*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1543*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1544*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1545*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1546*7c478bd9Sstevel@tonic-gate 		break;
1547*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_INVD_E:	/* in[A] * exprB */
1548*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1549*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1550*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1551*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1552*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1553*7c478bd9Sstevel@tonic-gate 		break;
1554*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_INVD_D:	/* in[A] * B */
1555*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1556*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1557*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1558*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1559*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1560*7c478bd9Sstevel@tonic-gate 		break;
1561*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_INVD_R:	/* in[A] * varB */
1562*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1563*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1564*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1565*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1566*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1567*7c478bd9Sstevel@tonic-gate 		break;
1568*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MUL_INVD_INVD:	/* in[A] * in[B] */
1569*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1570*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1571*7c478bd9Sstevel@tonic-gate 		printi(0, " * ");
1572*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1573*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1574*7c478bd9Sstevel@tonic-gate 		break;
1575*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV:		/* A  / B */
1576*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1577*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1578*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1579*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1580*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1581*7c478bd9Sstevel@tonic-gate 		break;
1582*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_E_D:		/* exprA / B */
1583*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1584*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1585*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1586*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1587*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1588*7c478bd9Sstevel@tonic-gate 		break;
1589*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_E_R:		/* exprA / varB */
1590*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1591*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1592*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1593*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1594*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1595*7c478bd9Sstevel@tonic-gate 		break;
1596*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_E_INVD:	/* exprA / in[B] */
1597*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1598*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1599*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1600*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1601*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1602*7c478bd9Sstevel@tonic-gate 		break;
1603*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_D_E:		/* intA / exprB */
1604*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1605*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1606*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1607*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1608*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1609*7c478bd9Sstevel@tonic-gate 		break;
1610*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_D_D:		/* intA / B */
1611*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1612*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1613*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1614*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1615*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1616*7c478bd9Sstevel@tonic-gate 		break;
1617*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_D_R:		/* intA / varB */
1618*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1619*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1620*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1621*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1622*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1623*7c478bd9Sstevel@tonic-gate 		break;
1624*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_D_INVD:	/* intA / in[B] */
1625*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1626*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1627*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1628*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1629*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1630*7c478bd9Sstevel@tonic-gate 		break;
1631*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_R_E:		/* varA / exprB */
1632*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1633*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1634*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1635*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1636*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1637*7c478bd9Sstevel@tonic-gate 		break;
1638*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_R_D:		/* varA / B */
1639*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1640*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1641*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1642*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1643*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1644*7c478bd9Sstevel@tonic-gate 		break;
1645*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_R_R:		/* varA / varB */
1646*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1647*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1648*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1649*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1650*7c478bd9Sstevel@tonic-gate 		break;
1651*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_R_INVD:	/* varA / in[B] */
1652*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1653*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1654*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1655*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1656*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1657*7c478bd9Sstevel@tonic-gate 		break;
1658*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_INVD_E:	/* in[A] / exprB */
1659*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1660*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1661*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1662*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1663*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1664*7c478bd9Sstevel@tonic-gate 		break;
1665*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_INVD_D:	/* in[A] / B */
1666*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1667*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1668*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1669*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1670*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1671*7c478bd9Sstevel@tonic-gate 		break;
1672*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_INVD_R:	/* in[A] / varB */
1673*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1674*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1675*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1676*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1677*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1678*7c478bd9Sstevel@tonic-gate 		break;
1679*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_DIV_INVD_INVD:	/* in[A] / in[B] */
1680*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1681*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1682*7c478bd9Sstevel@tonic-gate 		printi(0, " / ");
1683*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1684*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1685*7c478bd9Sstevel@tonic-gate 		break;
1686*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD:		/* A  % B */
1687*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1688*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1689*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1690*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1691*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1692*7c478bd9Sstevel@tonic-gate 		break;
1693*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_E_D:		/* exprA % B */
1694*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1695*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1696*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1697*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1698*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1699*7c478bd9Sstevel@tonic-gate 		break;
1700*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_E_R:		/* exprA % varB */
1701*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1702*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1703*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1704*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1705*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1706*7c478bd9Sstevel@tonic-gate 		break;
1707*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_E_INVD:	/* exprA % in[B] */
1708*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1709*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1710*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1711*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1712*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1713*7c478bd9Sstevel@tonic-gate 		break;
1714*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_D_E:		/* intA % exprB */
1715*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1716*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1717*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1718*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1719*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1720*7c478bd9Sstevel@tonic-gate 		break;
1721*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_D_D:		/* intA % B */
1722*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1723*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1724*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1725*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1726*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1727*7c478bd9Sstevel@tonic-gate 		break;
1728*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_D_R:		/* intA % varB */
1729*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1730*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1731*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1732*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1733*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1734*7c478bd9Sstevel@tonic-gate 		break;
1735*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_D_INVD:	/* intA % in[B] */
1736*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1737*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1738*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1739*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1740*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1741*7c478bd9Sstevel@tonic-gate 		break;
1742*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_R_E:		/* varA % exprB */
1743*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1744*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1745*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1746*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1747*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1748*7c478bd9Sstevel@tonic-gate 		break;
1749*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_R_D:		/* varA % B */
1750*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1751*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1752*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1753*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1754*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1755*7c478bd9Sstevel@tonic-gate 		break;
1756*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_R_R:		/* varA % varB */
1757*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1758*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1759*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1760*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1761*7c478bd9Sstevel@tonic-gate 		break;
1762*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_R_INVD:	/* varA % in[B] */
1763*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1764*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1765*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1766*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1767*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1768*7c478bd9Sstevel@tonic-gate 		break;
1769*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_INVD_E:	/* in[A] % exprB */
1770*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1771*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1772*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1773*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1774*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1775*7c478bd9Sstevel@tonic-gate 		break;
1776*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_INVD_D:	/* in[A] % B */
1777*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1778*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1779*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1780*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1781*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1782*7c478bd9Sstevel@tonic-gate 		break;
1783*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_INVD_R:	/* in[A] % varB */
1784*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1785*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1786*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1787*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1788*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1789*7c478bd9Sstevel@tonic-gate 		break;
1790*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_MOD_INVD_INVD:	/* in[A] % in[B] */
1791*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1792*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1793*7c478bd9Sstevel@tonic-gate 		printi(0, " %% ");
1794*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1795*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1796*7c478bd9Sstevel@tonic-gate 		break;
1797*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L:		/* A << B */
1798*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1799*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1800*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1801*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1802*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1803*7c478bd9Sstevel@tonic-gate 		break;
1804*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_E_D:		/* exprA << B */
1805*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1806*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1807*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1808*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1809*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1810*7c478bd9Sstevel@tonic-gate 		break;
1811*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_E_R:		/* exprA << varB */
1812*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1813*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1814*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1815*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1816*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1817*7c478bd9Sstevel@tonic-gate 		break;
1818*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_E_INVD:	/* exprA << in[B] */
1819*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1820*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1821*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1822*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1823*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1824*7c478bd9Sstevel@tonic-gate 		break;
1825*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_D_E:		/* intA << exprB */
1826*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1827*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1828*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1829*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1830*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1831*7c478bd9Sstevel@tonic-gate 		break;
1832*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_D_D:		/* intA << B */
1833*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1834*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1835*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1836*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1837*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1838*7c478bd9Sstevel@tonic-gate 		break;
1839*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_D_R:		/* intA << varB */
1840*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1841*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1842*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1843*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1844*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1845*7c478bd9Sstevel@tonic-gate 		break;
1846*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_D_INVD:	/* intA << in[B] */
1847*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1848*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1849*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1850*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1851*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1852*7c478bd9Sstevel@tonic-gate 		break;
1853*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_R_E:		/* varA << exprB */
1854*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1855*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1856*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1857*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1858*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1859*7c478bd9Sstevel@tonic-gate 		break;
1860*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_R_D:		/* varA << B */
1861*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1862*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1863*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1864*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1865*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1866*7c478bd9Sstevel@tonic-gate 		break;
1867*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_R_R:		/* varA << varB */
1868*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1869*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1870*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1871*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1872*7c478bd9Sstevel@tonic-gate 		break;
1873*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_R_INVD:	/* varA << in[B] */
1874*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1875*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1876*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1877*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1878*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1879*7c478bd9Sstevel@tonic-gate 		break;
1880*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_INVD_E:	/* in[A] << exprB */
1881*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1882*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1883*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1884*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1885*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1886*7c478bd9Sstevel@tonic-gate 		break;
1887*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_INVD_D:	/* in[A] << B */
1888*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1889*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1890*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1891*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1892*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1893*7c478bd9Sstevel@tonic-gate 		break;
1894*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_INVD_R:	/* in[A] << varB */
1895*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1896*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1897*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1898*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1899*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1900*7c478bd9Sstevel@tonic-gate 		break;
1901*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_L_INVD_INVD:	/* in[A] << in[B] */
1902*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1903*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1904*7c478bd9Sstevel@tonic-gate 		printi(0, " << ");
1905*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1906*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1907*7c478bd9Sstevel@tonic-gate 		break;
1908*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R:		/* A >> B */
1909*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1910*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1911*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1912*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1913*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1914*7c478bd9Sstevel@tonic-gate 		break;
1915*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_E_D:		/* exprA >> B */
1916*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1917*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1918*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1919*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1920*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1921*7c478bd9Sstevel@tonic-gate 		break;
1922*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_E_R:		/* exprA >> varB */
1923*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1924*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1925*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1926*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1927*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1928*7c478bd9Sstevel@tonic-gate 		break;
1929*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_E_INVD:	/* exprA >> in[B] */
1930*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1931*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
1932*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1933*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1934*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1935*7c478bd9Sstevel@tonic-gate 		break;
1936*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_D_E:		/* intA >> exprB */
1937*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1938*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1939*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1940*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1941*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1942*7c478bd9Sstevel@tonic-gate 		break;
1943*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_D_D:		/* intA >> B */
1944*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1945*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1946*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1947*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1948*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1949*7c478bd9Sstevel@tonic-gate 		break;
1950*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_D_R:		/* intA >> varB */
1951*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1952*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1953*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1954*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
1955*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1956*7c478bd9Sstevel@tonic-gate 		break;
1957*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_D_INVD:	/* intA >> in[B] */
1958*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1959*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
1960*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1961*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1962*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1963*7c478bd9Sstevel@tonic-gate 		break;
1964*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_R_E:		/* varA >> exprB */
1965*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1966*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1967*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1968*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1969*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1970*7c478bd9Sstevel@tonic-gate 		break;
1971*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_R_D:		/* varA >> B */
1972*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1973*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1974*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1975*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
1976*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1977*7c478bd9Sstevel@tonic-gate 		break;
1978*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_R_R:		/* varA >> varB */
1979*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1980*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1981*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1982*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1983*7c478bd9Sstevel@tonic-gate 		break;
1984*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_R_INVD:	/* varA >> in[B] */
1985*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1986*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
1987*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1988*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
1989*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1990*7c478bd9Sstevel@tonic-gate 		break;
1991*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_INVD_E:	/* in[A] >> exprB */
1992*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
1993*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
1994*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
1995*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
1996*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
1997*7c478bd9Sstevel@tonic-gate 		break;
1998*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_INVD_D:	/* in[A] >> B */
1999*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2000*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2001*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
2002*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2003*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2004*7c478bd9Sstevel@tonic-gate 		break;
2005*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_INVD_R:	/* in[A] >> varB */
2006*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2007*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2008*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
2009*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2010*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2011*7c478bd9Sstevel@tonic-gate 		break;
2012*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_SHIFT_R_INVD_INVD:	/* in[A] >> in[B] */
2013*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2014*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2015*7c478bd9Sstevel@tonic-gate 		printi(0, " >> ");
2016*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2017*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2018*7c478bd9Sstevel@tonic-gate 		break;
2019*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR:		/* A  | B */
2020*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2021*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2022*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2023*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2024*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2025*7c478bd9Sstevel@tonic-gate 		break;
2026*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_E_D:		/* exprA | B */
2027*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2028*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2029*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2030*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2031*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2032*7c478bd9Sstevel@tonic-gate 		break;
2033*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_E_R:		/* exprA | varB */
2034*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2035*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2036*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2037*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2038*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2039*7c478bd9Sstevel@tonic-gate 		break;
2040*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_E_INVD:	/* exprA | in[B] */
2041*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2042*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2043*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2044*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2045*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2046*7c478bd9Sstevel@tonic-gate 		break;
2047*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_D_E:		/* intA | exprB */
2048*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2049*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2050*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2051*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2052*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2053*7c478bd9Sstevel@tonic-gate 		break;
2054*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_D_D:		/* intA | B */
2055*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2056*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2057*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2058*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2059*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2060*7c478bd9Sstevel@tonic-gate 		break;
2061*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_D_R:		/* intA | varB */
2062*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2063*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2064*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2065*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2066*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2067*7c478bd9Sstevel@tonic-gate 		break;
2068*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_D_INVD:	/* intA | in[B] */
2069*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2070*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2071*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2072*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2073*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2074*7c478bd9Sstevel@tonic-gate 		break;
2075*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_R_E:		/* varA | exprB */
2076*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2077*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2078*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2079*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2080*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2081*7c478bd9Sstevel@tonic-gate 		break;
2082*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_R_D:		/* varA | B */
2083*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2084*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2085*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2086*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2087*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2088*7c478bd9Sstevel@tonic-gate 		break;
2089*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_R_R:		/* varA | varB */
2090*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2091*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2092*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2093*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2094*7c478bd9Sstevel@tonic-gate 		break;
2095*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_R_INVD:	/* varA | in[B] */
2096*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2097*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2098*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2099*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2100*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2101*7c478bd9Sstevel@tonic-gate 		break;
2102*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_INVD_E:	/* in[A] | exprB */
2103*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2104*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2105*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2106*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2107*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2108*7c478bd9Sstevel@tonic-gate 		break;
2109*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_INVD_D:	/* in[A] | B */
2110*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2111*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2112*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2113*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2114*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2115*7c478bd9Sstevel@tonic-gate 		break;
2116*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_INVD_R:	/* in[A] | varB */
2117*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2118*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2119*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2120*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2121*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2122*7c478bd9Sstevel@tonic-gate 		break;
2123*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_OR_INVD_INVD:	/* in[A] | in[B] */
2124*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2125*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2126*7c478bd9Sstevel@tonic-gate 		printi(0, " | ");
2127*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2128*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2129*7c478bd9Sstevel@tonic-gate 		break;
2130*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR:		/* A  ^ B */
2131*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2132*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2133*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2134*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2135*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2136*7c478bd9Sstevel@tonic-gate 		break;
2137*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_E_D:		/* exprA ^ B */
2138*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2139*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2140*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2141*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2142*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2143*7c478bd9Sstevel@tonic-gate 		break;
2144*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_E_R:		/* exprA ^ varB */
2145*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2146*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2147*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2148*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2149*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2150*7c478bd9Sstevel@tonic-gate 		break;
2151*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_E_INVD:	/* exprA ^ in[B] */
2152*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2153*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2154*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2155*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2156*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2157*7c478bd9Sstevel@tonic-gate 		break;
2158*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_D_E:		/* intA ^ exprB */
2159*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2160*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2161*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2162*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2163*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2164*7c478bd9Sstevel@tonic-gate 		break;
2165*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_D_D:		/* intA ^ B */
2166*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2167*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2168*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2169*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2170*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2171*7c478bd9Sstevel@tonic-gate 		break;
2172*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_D_R:		/* intA ^ varB */
2173*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2174*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2175*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2176*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2177*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2178*7c478bd9Sstevel@tonic-gate 		break;
2179*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_D_INVD:	/* intA ^ in[B] */
2180*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2181*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2182*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2183*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2184*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2185*7c478bd9Sstevel@tonic-gate 		break;
2186*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_R_E:		/* varA ^ exprB */
2187*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2188*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2189*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2190*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2191*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2192*7c478bd9Sstevel@tonic-gate 		break;
2193*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_R_D:		/* varA ^ B */
2194*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2195*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2196*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2197*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2198*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2199*7c478bd9Sstevel@tonic-gate 		break;
2200*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_R_R:		/* varA ^ varB */
2201*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2202*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2203*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2204*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2205*7c478bd9Sstevel@tonic-gate 		break;
2206*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_R_INVD:	/* varA ^ in[B] */
2207*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2208*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2209*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2210*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2211*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2212*7c478bd9Sstevel@tonic-gate 		break;
2213*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_INVD_E:	/* in[A] ^ exprB */
2214*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2215*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2216*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2217*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2218*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2219*7c478bd9Sstevel@tonic-gate 		break;
2220*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_INVD_D:	/* in[A] ^ B */
2221*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2222*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2223*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2224*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2225*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2226*7c478bd9Sstevel@tonic-gate 		break;
2227*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_INVD_R:	/* in[A] ^ varB */
2228*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2229*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2230*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2231*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2232*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2233*7c478bd9Sstevel@tonic-gate 		break;
2234*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_XOR_INVD_INVD:	/* in[A] ^ in[B] */
2235*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2236*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2237*7c478bd9Sstevel@tonic-gate 		printi(0, " ^ ");
2238*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2239*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2240*7c478bd9Sstevel@tonic-gate 		break;
2241*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND:		/* A  & B */
2242*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2243*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2244*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2245*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2246*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2247*7c478bd9Sstevel@tonic-gate 		break;
2248*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_E_D:		/* exprA & B */
2249*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2250*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2251*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2252*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2253*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2254*7c478bd9Sstevel@tonic-gate 		break;
2255*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_E_R:		/* exprA & varB */
2256*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2257*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2258*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2259*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2260*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2261*7c478bd9Sstevel@tonic-gate 		break;
2262*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_E_INVD:	/* exprA & in[B] */
2263*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2264*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2265*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2266*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2267*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2268*7c478bd9Sstevel@tonic-gate 		break;
2269*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_D_E:		/* intA & exprB */
2270*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2271*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2272*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2273*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2274*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2275*7c478bd9Sstevel@tonic-gate 		break;
2276*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_D_D:		/* intA & B */
2277*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2278*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2279*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2280*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2281*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2282*7c478bd9Sstevel@tonic-gate 		break;
2283*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_D_R:		/* intA & varB */
2284*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2285*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2286*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2287*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2288*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2289*7c478bd9Sstevel@tonic-gate 		break;
2290*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_D_INVD:	/* intA & in[B] */
2291*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2292*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2293*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2294*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2295*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2296*7c478bd9Sstevel@tonic-gate 		break;
2297*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_R_E:		/* varA & exprB */
2298*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2299*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2300*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2301*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2302*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2303*7c478bd9Sstevel@tonic-gate 		break;
2304*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_R_D:		/* varA & B */
2305*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2306*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2307*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2308*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2309*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2310*7c478bd9Sstevel@tonic-gate 		break;
2311*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_R_R:		/* varA & varB */
2312*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2313*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2314*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2315*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2316*7c478bd9Sstevel@tonic-gate 		break;
2317*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_R_INVD:	/* varA & in[B] */
2318*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2319*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2320*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2321*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2322*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2323*7c478bd9Sstevel@tonic-gate 		break;
2324*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_INVD_E:	/* in[A] & exprB */
2325*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2326*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2327*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2328*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2329*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2330*7c478bd9Sstevel@tonic-gate 		break;
2331*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_INVD_D:	/* in[A] & B */
2332*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2333*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2334*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2335*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2336*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2337*7c478bd9Sstevel@tonic-gate 		break;
2338*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_INVD_R:	/* in[A] & varB */
2339*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2340*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2341*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2342*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2343*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2344*7c478bd9Sstevel@tonic-gate 		break;
2345*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_AND_INVD_INVD:	/* in[A] & in[B] */
2346*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2347*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2348*7c478bd9Sstevel@tonic-gate 		printi(0, " & ");
2349*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2350*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2351*7c478bd9Sstevel@tonic-gate 		break;
2352*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ:		/* A == B */
2353*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2354*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2355*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2356*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2357*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2358*7c478bd9Sstevel@tonic-gate 		break;
2359*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_E_D:		/* exprA == B */
2360*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2361*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2362*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2363*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2364*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2365*7c478bd9Sstevel@tonic-gate 		break;
2366*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_E_R:		/* exprA == varB */
2367*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2368*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2369*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2370*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2371*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2372*7c478bd9Sstevel@tonic-gate 		break;
2373*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_E_INVD:	/* exprA == in[B] */
2374*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2375*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2376*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2377*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2378*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2379*7c478bd9Sstevel@tonic-gate 		break;
2380*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_D_E:		/* intA == exprB */
2381*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2382*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2383*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2384*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2385*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2386*7c478bd9Sstevel@tonic-gate 		break;
2387*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_D_D:		/* intA == B */
2388*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2389*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2390*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2391*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2392*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2393*7c478bd9Sstevel@tonic-gate 		break;
2394*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_D_R:		/* intA == varB */
2395*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2396*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2397*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2398*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2399*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2400*7c478bd9Sstevel@tonic-gate 		break;
2401*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_D_INVD:	/* intA == in[B] */
2402*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2403*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2404*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2405*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2406*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2407*7c478bd9Sstevel@tonic-gate 		break;
2408*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_R_E:		/* varA == exprB */
2409*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2410*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2411*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2412*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2413*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2414*7c478bd9Sstevel@tonic-gate 		break;
2415*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_R_D:		/* varA == B */
2416*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2417*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2418*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2419*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2420*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2421*7c478bd9Sstevel@tonic-gate 		break;
2422*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_R_R:		/* varA == varB */
2423*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2424*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2425*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2426*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2427*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2428*7c478bd9Sstevel@tonic-gate 		break;
2429*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_R_INVD:	/* varA == in[B] */
2430*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2431*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2432*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2433*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2434*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2435*7c478bd9Sstevel@tonic-gate 		break;
2436*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_INVD_E:	/* in[A] == exprB */
2437*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2438*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2439*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2440*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2441*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2442*7c478bd9Sstevel@tonic-gate 		break;
2443*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_INVD_D:	/* in[A] == B */
2444*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2445*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2446*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2447*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2448*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2449*7c478bd9Sstevel@tonic-gate 		break;
2450*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_INVD_R:	/* in[A] == varB */
2451*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2452*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2453*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2454*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2455*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2456*7c478bd9Sstevel@tonic-gate 		break;
2457*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_EQ_INVD_INVD:	/* in[A] == in[B] */
2458*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2459*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2460*7c478bd9Sstevel@tonic-gate 		printi(0, " == ");
2461*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2462*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2463*7c478bd9Sstevel@tonic-gate 		break;
2464*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE:		/* A != B */
2465*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2466*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2467*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2468*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2469*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2470*7c478bd9Sstevel@tonic-gate 		break;
2471*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_E_D:		/* exprA != B */
2472*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2473*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2474*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2475*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2476*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2477*7c478bd9Sstevel@tonic-gate 		break;
2478*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_E_R:		/* exprA != varB */
2479*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2480*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2481*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2482*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2483*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2484*7c478bd9Sstevel@tonic-gate 		break;
2485*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_E_INVD:	/* exprA != in[B] */
2486*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2487*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2488*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2489*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2490*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2491*7c478bd9Sstevel@tonic-gate 		break;
2492*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_D_E:		/* intA != exprB */
2493*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2494*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2495*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2496*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2497*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2498*7c478bd9Sstevel@tonic-gate 		break;
2499*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_D_D:		/* intA != B */
2500*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2501*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2502*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2503*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2504*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2505*7c478bd9Sstevel@tonic-gate 		break;
2506*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_D_R:		/* intA != varB */
2507*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2508*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2509*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2510*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2511*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2512*7c478bd9Sstevel@tonic-gate 		break;
2513*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_D_INVD:	/* intA != in[B] */
2514*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2515*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2516*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2517*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2518*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2519*7c478bd9Sstevel@tonic-gate 		break;
2520*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_R_E:		/* varA != exprB */
2521*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2522*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2523*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2524*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2525*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2526*7c478bd9Sstevel@tonic-gate 		break;
2527*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_R_D:		/* varA != B */
2528*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2529*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2530*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2531*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2532*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2533*7c478bd9Sstevel@tonic-gate 		break;
2534*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_R_R:		/* varA != varB */
2535*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2536*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2537*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2538*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2539*7c478bd9Sstevel@tonic-gate 		break;
2540*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_R_INVD:	/* varA != in[B] */
2541*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2542*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2543*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2544*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2545*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2546*7c478bd9Sstevel@tonic-gate 		break;
2547*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_INVD_E:	/* in[A] != exprB */
2548*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2549*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2550*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2551*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2552*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2553*7c478bd9Sstevel@tonic-gate 		break;
2554*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_INVD_D:	/* in[A] != B */
2555*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2556*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2557*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2558*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2559*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2560*7c478bd9Sstevel@tonic-gate 		break;
2561*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_INVD_R:	/* in[A] != varB */
2562*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2563*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2564*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2565*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2566*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2567*7c478bd9Sstevel@tonic-gate 		break;
2568*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NE_INVD_INVD:	/* in[A] != in[B] */
2569*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2570*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2571*7c478bd9Sstevel@tonic-gate 		printi(0, " != ");
2572*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2573*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2574*7c478bd9Sstevel@tonic-gate 		break;
2575*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT:		/* A  > B */
2576*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2577*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2578*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2579*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2580*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2581*7c478bd9Sstevel@tonic-gate 		break;
2582*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_E_D:		/* exprA > B */
2583*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2584*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2585*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2586*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2587*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2588*7c478bd9Sstevel@tonic-gate 		break;
2589*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_E_R:		/* exprA > varB */
2590*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2591*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2592*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2593*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2594*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2595*7c478bd9Sstevel@tonic-gate 		break;
2596*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_E_INVD:	/* exprA > in[B] */
2597*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2598*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2599*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2600*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2601*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2602*7c478bd9Sstevel@tonic-gate 		break;
2603*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_D_E:		/* intA > exprB */
2604*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2605*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2606*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2607*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2608*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2609*7c478bd9Sstevel@tonic-gate 		break;
2610*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_D_D:		/* intA > B */
2611*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2612*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2613*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2614*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2615*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2616*7c478bd9Sstevel@tonic-gate 		break;
2617*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_D_R:		/* intA > varB */
2618*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2619*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2620*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2621*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2622*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2623*7c478bd9Sstevel@tonic-gate 		break;
2624*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_D_INVD:	/* intA > in[B] */
2625*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2626*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2627*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2628*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2629*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2630*7c478bd9Sstevel@tonic-gate 		break;
2631*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_R_E:		/* varA > exprB */
2632*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2633*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2634*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2635*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2636*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2637*7c478bd9Sstevel@tonic-gate 		break;
2638*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_R_D:		/* varA > B */
2639*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2640*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2641*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2642*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2643*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2644*7c478bd9Sstevel@tonic-gate 		break;
2645*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_R_R:		/* varA > varB */
2646*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2647*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2648*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2649*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2650*7c478bd9Sstevel@tonic-gate 		break;
2651*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_R_INVD:	/* varA > in[B] */
2652*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2653*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2654*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2655*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2656*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2657*7c478bd9Sstevel@tonic-gate 		break;
2658*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_INVD_E:	/* in[A] > exprB */
2659*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2660*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2661*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2662*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2663*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2664*7c478bd9Sstevel@tonic-gate 		break;
2665*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_INVD_D:	/* in[A] > B */
2666*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2667*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2668*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2669*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2670*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2671*7c478bd9Sstevel@tonic-gate 		break;
2672*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_INVD_R:	/* in[A] > varB */
2673*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2674*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2675*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2676*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2677*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2678*7c478bd9Sstevel@tonic-gate 		break;
2679*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GT_INVD_INVD:	/* in[A] > in[B] */
2680*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2681*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2682*7c478bd9Sstevel@tonic-gate 		printi(0, " > ");
2683*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2684*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2685*7c478bd9Sstevel@tonic-gate 		break;
2686*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE:		/* A >= B */
2687*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2688*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2689*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2690*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2691*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2692*7c478bd9Sstevel@tonic-gate 		break;
2693*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_E_D:		/* exprA >= B */
2694*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2695*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2696*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2697*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2698*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2699*7c478bd9Sstevel@tonic-gate 		break;
2700*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_E_R:		/* exprA >= varB */
2701*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2702*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2703*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2704*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2705*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2706*7c478bd9Sstevel@tonic-gate 		break;
2707*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_E_INVD:	/* exprA >= in[B] */
2708*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2709*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2710*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2711*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2712*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2713*7c478bd9Sstevel@tonic-gate 		break;
2714*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_D_E:		/* intA >= exprB */
2715*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2716*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2717*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2718*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2719*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2720*7c478bd9Sstevel@tonic-gate 		break;
2721*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_D_D:		/* intA >= B */
2722*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2723*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2724*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2725*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2726*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2727*7c478bd9Sstevel@tonic-gate 		break;
2728*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_D_R:		/* intA >= varB */
2729*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2730*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2731*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2732*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2733*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2734*7c478bd9Sstevel@tonic-gate 		break;
2735*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_D_INVD:	/* intA >= in[B] */
2736*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2737*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2738*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2739*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2740*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2741*7c478bd9Sstevel@tonic-gate 		break;
2742*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_R_E:		/* varA >= exprB */
2743*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2744*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2745*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2746*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2747*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2748*7c478bd9Sstevel@tonic-gate 		break;
2749*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_R_D:		/* varA >= B */
2750*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2751*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2752*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2753*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2754*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2755*7c478bd9Sstevel@tonic-gate 		break;
2756*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_R_R:		/* varA >= varB */
2757*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2758*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2759*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2760*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2761*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2762*7c478bd9Sstevel@tonic-gate 		break;
2763*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_R_INVD:	/* varA >= in[B] */
2764*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2765*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2766*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2767*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2768*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2769*7c478bd9Sstevel@tonic-gate 		break;
2770*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_INVD_E:	/* in[A] >= exprB */
2771*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2772*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2773*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2774*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2775*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2776*7c478bd9Sstevel@tonic-gate 		break;
2777*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_INVD_D:	/* in[A] >= B */
2778*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2779*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2780*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2781*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2782*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2783*7c478bd9Sstevel@tonic-gate 		break;
2784*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_INVD_R:	/* in[A] >= varB */
2785*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2786*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2787*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2788*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2789*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2790*7c478bd9Sstevel@tonic-gate 		break;
2791*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_GE_INVD_INVD:	/* in[A] >= in[B] */
2792*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2793*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2794*7c478bd9Sstevel@tonic-gate 		printi(0, " >= ");
2795*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2796*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2797*7c478bd9Sstevel@tonic-gate 		break;
2798*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT:		/* A  < B */
2799*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2800*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2801*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2802*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2803*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2804*7c478bd9Sstevel@tonic-gate 		break;
2805*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_E_D:		/* exprA < B */
2806*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2807*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2808*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2809*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2810*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2811*7c478bd9Sstevel@tonic-gate 		break;
2812*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_E_R:		/* exprA < varB */
2813*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2814*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2815*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2816*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2817*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2818*7c478bd9Sstevel@tonic-gate 		break;
2819*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_E_INVD:	/* exprA < in[B] */
2820*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2821*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2822*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2823*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2824*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2825*7c478bd9Sstevel@tonic-gate 		break;
2826*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_D_E:		/* intA < exprB */
2827*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2828*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2829*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2830*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2831*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2832*7c478bd9Sstevel@tonic-gate 		break;
2833*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_D_D:		/* intA < B */
2834*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2835*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2836*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2837*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2838*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2839*7c478bd9Sstevel@tonic-gate 		break;
2840*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_D_R:		/* intA < varB */
2841*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2842*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2843*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2844*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2845*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2846*7c478bd9Sstevel@tonic-gate 		break;
2847*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_D_INVD:	/* intA < in[B] */
2848*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2849*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2850*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2851*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2852*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2853*7c478bd9Sstevel@tonic-gate 		break;
2854*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_R_E:		/* varA < exprB */
2855*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2856*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2857*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2858*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2859*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2860*7c478bd9Sstevel@tonic-gate 		break;
2861*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_R_D:		/* varA < B */
2862*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2863*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2864*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2865*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2866*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2867*7c478bd9Sstevel@tonic-gate 		break;
2868*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_R_R:		/* varA < varB */
2869*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2870*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2871*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2872*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2873*7c478bd9Sstevel@tonic-gate 		break;
2874*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_R_INVD:	/* varA < in[B] */
2875*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2876*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2877*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2878*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2879*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2880*7c478bd9Sstevel@tonic-gate 		break;
2881*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_INVD_E:	/* in[A] < exprB */
2882*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2883*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2884*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2885*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2886*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2887*7c478bd9Sstevel@tonic-gate 		break;
2888*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_INVD_D:	/* in[A] < B */
2889*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2890*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2891*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2892*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2893*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2894*7c478bd9Sstevel@tonic-gate 		break;
2895*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_INVD_R:	/* in[A] < varB */
2896*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2897*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2898*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2899*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2900*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2901*7c478bd9Sstevel@tonic-gate 		break;
2902*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LT_INVD_INVD:	/* in[A] < in[B] */
2903*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2904*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2905*7c478bd9Sstevel@tonic-gate 		printi(0, " < ");
2906*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2907*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2908*7c478bd9Sstevel@tonic-gate 		break;
2909*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE:		/* A <= B */
2910*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2911*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2912*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2913*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2914*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2915*7c478bd9Sstevel@tonic-gate 		break;
2916*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_E_D:		/* exprA <= B */
2917*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2918*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2919*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2920*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2921*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2922*7c478bd9Sstevel@tonic-gate 		break;
2923*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_E_R:		/* exprA <= varB */
2924*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2925*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2926*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2927*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2928*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2929*7c478bd9Sstevel@tonic-gate 		break;
2930*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_E_INVD:	/* exprA <= in[B] */
2931*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2932*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
2933*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2934*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2935*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2936*7c478bd9Sstevel@tonic-gate 		break;
2937*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_D_E:		/* intA <= exprB */
2938*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2939*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2940*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2941*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2942*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2943*7c478bd9Sstevel@tonic-gate 		break;
2944*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_D_D:		/* intA <= B */
2945*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2946*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2947*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2948*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2949*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2950*7c478bd9Sstevel@tonic-gate 		break;
2951*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_D_R:		/* intA <= varB */
2952*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2953*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2954*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2955*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
2956*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2957*7c478bd9Sstevel@tonic-gate 		break;
2958*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_D_INVD:	/* intA <= in[B] */
2959*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2960*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[0].itm_ptr);
2961*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2962*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2963*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2964*7c478bd9Sstevel@tonic-gate 		break;
2965*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_R_E:		/* varA <= exprB */
2966*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2967*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2968*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2969*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2970*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2971*7c478bd9Sstevel@tonic-gate 		break;
2972*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_R_D:		/* varA <= B */
2973*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2974*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2975*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2976*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
2977*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2978*7c478bd9Sstevel@tonic-gate 		break;
2979*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_R_R:		/* varA <= varB */
2980*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2981*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2982*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2983*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2984*7c478bd9Sstevel@tonic-gate 		break;
2985*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_R_INVD:	/* varA <= in[B] */
2986*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2987*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[0]));
2988*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2989*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
2990*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2991*7c478bd9Sstevel@tonic-gate 		break;
2992*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_INVD_E:	/* in[A] <= exprB */
2993*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
2994*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
2995*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
2996*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
2997*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
2998*7c478bd9Sstevel@tonic-gate 		break;
2999*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_INVD_D:	/* in[A] <= B */
3000*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3001*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
3002*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
3003*7c478bd9Sstevel@tonic-gate 		printi(0, "%ld", expr->data.operand[1].itm_ptr);
3004*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3005*7c478bd9Sstevel@tonic-gate 		break;
3006*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_INVD_R:	/* in[A] <= varB */
3007*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3008*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
3009*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
3010*7c478bd9Sstevel@tonic-gate 		printi(0, "%s", reg_name(itm_hdr, expr->data.operand[1]));
3011*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3012*7c478bd9Sstevel@tonic-gate 		break;
3013*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LE_INVD_INVD:	/* in[A] <= in[B] */
3014*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3015*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[0].itm_ptr);
3016*7c478bd9Sstevel@tonic-gate 		printi(0, " <= ");
3017*7c478bd9Sstevel@tonic-gate 		printi(0, RNPREF "in[%ld]", expr->data.operand[1].itm_ptr);
3018*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3019*7c478bd9Sstevel@tonic-gate 		break;
3020*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NOT:		/*   !A	  */
3021*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3022*7c478bd9Sstevel@tonic-gate 		printi(0, "!");
3023*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
3024*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3025*7c478bd9Sstevel@tonic-gate 		break;
3026*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_NEG:		/*   ~A	  */
3027*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3028*7c478bd9Sstevel@tonic-gate 		printi(0, " ~");
3029*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
3030*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3031*7c478bd9Sstevel@tonic-gate 		break;
3032*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LOR:		/* A || B */
3033*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3034*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
3035*7c478bd9Sstevel@tonic-gate 		printi(0, " || ");
3036*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
3037*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3038*7c478bd9Sstevel@tonic-gate 		break;
3039*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_LAND:		/* A && B */
3040*7c478bd9Sstevel@tonic-gate 		printi(0, "(");
3041*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
3042*7c478bd9Sstevel@tonic-gate 		printi(0, " && ");
3043*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
3044*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3045*7c478bd9Sstevel@tonic-gate 		break;
3046*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_ASSIGN:		/* A  = B */
3047*7c478bd9Sstevel@tonic-gate 		printi(0, "%s = ", reg_name(itm_hdr, expr->data.operand[0]));
3048*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[1]);
3049*7c478bd9Sstevel@tonic-gate 		break;
3050*7c478bd9Sstevel@tonic-gate 	case ITM_EXPR_IN_EQ:		/* in == A */
3051*7c478bd9Sstevel@tonic-gate 		printi(0, "(" RNPREF "in == ", 0);
3052*7c478bd9Sstevel@tonic-gate 		dump_expr(itm_hdr, expr->data.operand[0]);
3053*7c478bd9Sstevel@tonic-gate 		printi(0, ")");
3054*7c478bd9Sstevel@tonic-gate 		break;
3055*7c478bd9Sstevel@tonic-gate 	default:
3056*7c478bd9Sstevel@tonic-gate 		break;
3057*7c478bd9Sstevel@tonic-gate 	}
3058*7c478bd9Sstevel@tonic-gate }
3059*7c478bd9Sstevel@tonic-gate 
3060*7c478bd9Sstevel@tonic-gate 
3061*7c478bd9Sstevel@tonic-gate /*
3062*7c478bd9Sstevel@tonic-gate  * Dump range (between)
3063*7c478bd9Sstevel@tonic-gate  */
3064*7c478bd9Sstevel@tonic-gate static void
dump_range(itm_hdr_t * itm_hdr,itm_place_t range_place)3065*7c478bd9Sstevel@tonic-gate dump_range(itm_hdr_t	*itm_hdr, itm_place_t range_place)
3066*7c478bd9Sstevel@tonic-gate {
3067*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t	*rth;
3068*7c478bd9Sstevel@tonic-gate 	itm_range_hdr_t	*rtsh;
3069*7c478bd9Sstevel@tonic-gate 	unsigned char	*p;
3070*7c478bd9Sstevel@tonic-gate 	long		i;
3071*7c478bd9Sstevel@tonic-gate 	long		j;
3072*7c478bd9Sstevel@tonic-gate 
3073*7c478bd9Sstevel@tonic-gate 	rth = (itm_tbl_hdr_t *)(ADDR(range_place));
3074*7c478bd9Sstevel@tonic-gate 	rtsh = (itm_range_hdr_t *)(rth + 1);
3075*7c478bd9Sstevel@tonic-gate 	p = (unsigned char *)(rtsh + 1);
3076*7c478bd9Sstevel@tonic-gate 
3077*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)between=%ld ", range_place.itm_ptr));
3078*7c478bd9Sstevel@tonic-gate 	printi(0, RNPREF "between ");
3079*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < rth->number; i++) {
3080*7c478bd9Sstevel@tonic-gate 		if (0 != i)	printi(0, "\t ");
3081*7c478bd9Sstevel@tonic-gate 		printi(0, "0x");
3082*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < rtsh->len; j++) {
3083*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *(p++));
3084*7c478bd9Sstevel@tonic-gate 		}
3085*7c478bd9Sstevel@tonic-gate 		printi(0, " - ");
3086*7c478bd9Sstevel@tonic-gate 		printi(0, "0x");
3087*7c478bd9Sstevel@tonic-gate 		for (j = 0; j < rtsh->len; j++) {
3088*7c478bd9Sstevel@tonic-gate 			printi(0, "%02x", *(p++));
3089*7c478bd9Sstevel@tonic-gate 		}
3090*7c478bd9Sstevel@tonic-gate 		if (i < (rth->number - 1)) {
3091*7c478bd9Sstevel@tonic-gate 			printi(0, ",\n");
3092*7c478bd9Sstevel@tonic-gate 		} else {
3093*7c478bd9Sstevel@tonic-gate 			printi(0, ";\n");
3094*7c478bd9Sstevel@tonic-gate 		}
3095*7c478bd9Sstevel@tonic-gate 	}
3096*7c478bd9Sstevel@tonic-gate }
3097*7c478bd9Sstevel@tonic-gate 
3098*7c478bd9Sstevel@tonic-gate 
3099*7c478bd9Sstevel@tonic-gate /*
3100*7c478bd9Sstevel@tonic-gate  * Dump escape sequence
3101*7c478bd9Sstevel@tonic-gate  */
3102*7c478bd9Sstevel@tonic-gate static void
dump_escapeseq(itm_hdr_t * itm_hdr,itm_place_t escapeseq_place)3103*7c478bd9Sstevel@tonic-gate dump_escapeseq(itm_hdr_t	*itm_hdr, itm_place_t escapeseq_place)
3104*7c478bd9Sstevel@tonic-gate {
3105*7c478bd9Sstevel@tonic-gate 	itm_tbl_hdr_t		*eth;
3106*7c478bd9Sstevel@tonic-gate 	itm_escapeseq_hdr_t	*eh;
3107*7c478bd9Sstevel@tonic-gate 	itm_data_t		*d;
3108*7c478bd9Sstevel@tonic-gate 	itm_data_t		data;
3109*7c478bd9Sstevel@tonic-gate 
3110*7c478bd9Sstevel@tonic-gate 	long			i;
3111*7c478bd9Sstevel@tonic-gate 
3112*7c478bd9Sstevel@tonic-gate 
3113*7c478bd9Sstevel@tonic-gate 	eth = (itm_tbl_hdr_t *)(ADDR(escapeseq_place));
3114*7c478bd9Sstevel@tonic-gate 	eh = (itm_escapeseq_hdr_t *)(eth + 1);
3115*7c478bd9Sstevel@tonic-gate 	d = (itm_data_t *)(eh + 1);
3116*7c478bd9Sstevel@tonic-gate 	TRACE_MESSAGE('p', ("(&)escseq=%ld ", escapeseq_place.itm_ptr));
3117*7c478bd9Sstevel@tonic-gate 	printi(1, RNPREF "escapceseq {");
3118*7c478bd9Sstevel@tonic-gate 
3119*7c478bd9Sstevel@tonic-gate 	for (i = 0; i < eth->number; i++, d++) {
3120*7c478bd9Sstevel@tonic-gate 		if (0 != i)	printi(0, " ");
3121*7c478bd9Sstevel@tonic-gate 		data = *d;
3122*7c478bd9Sstevel@tonic-gate 		if ((sizeof (itm_place_t)) < data.size) {
3123*7c478bd9Sstevel@tonic-gate 			data.place.itm_ptr = (itm_place2_t)ADDR(d->place);
3124*7c478bd9Sstevel@tonic-gate 		}
3125*7c478bd9Sstevel@tonic-gate 		printi(0, "0x%s;", data_to_hexadecimal(&data));
3126*7c478bd9Sstevel@tonic-gate 	}
3127*7c478bd9Sstevel@tonic-gate 	printi(-1, "}\n");
3128*7c478bd9Sstevel@tonic-gate }
3129*7c478bd9Sstevel@tonic-gate 
3130*7c478bd9Sstevel@tonic-gate 
3131*7c478bd9Sstevel@tonic-gate static void
printi(int c,char * format,...)3132*7c478bd9Sstevel@tonic-gate printi(int c, char	*format, ...)
3133*7c478bd9Sstevel@tonic-gate {
3134*7c478bd9Sstevel@tonic-gate 	static int	indent_level;
3135*7c478bd9Sstevel@tonic-gate 	static int	new_line = 1;
3136*7c478bd9Sstevel@tonic-gate 	int		i;
3137*7c478bd9Sstevel@tonic-gate 	va_list		ap;
3138*7c478bd9Sstevel@tonic-gate 	va_start(ap, format);
3139*7c478bd9Sstevel@tonic-gate 
3140*7c478bd9Sstevel@tonic-gate 	if (c < 0) {
3141*7c478bd9Sstevel@tonic-gate 		indent_level += c;
3142*7c478bd9Sstevel@tonic-gate 		if (indent_level < 0) {
3143*7c478bd9Sstevel@tonic-gate 			indent_level = 0;
3144*7c478bd9Sstevel@tonic-gate 		}
3145*7c478bd9Sstevel@tonic-gate 	}
3146*7c478bd9Sstevel@tonic-gate 	if (new_line) {
3147*7c478bd9Sstevel@tonic-gate 		for (i = indent_level; 0 < i; i -= 1) {
3148*7c478bd9Sstevel@tonic-gate 			(void) putchar('\t');
3149*7c478bd9Sstevel@tonic-gate 		}
3150*7c478bd9Sstevel@tonic-gate 	}
3151*7c478bd9Sstevel@tonic-gate 	if (0 < c) {
3152*7c478bd9Sstevel@tonic-gate 		indent_level += c;
3153*7c478bd9Sstevel@tonic-gate 		if (indent_level < 0) {
3154*7c478bd9Sstevel@tonic-gate 			indent_level = 0;
3155*7c478bd9Sstevel@tonic-gate 		}
3156*7c478bd9Sstevel@tonic-gate 	}
3157*7c478bd9Sstevel@tonic-gate 
3158*7c478bd9Sstevel@tonic-gate 	if (NULL == strchr(format, '\n')) {
3159*7c478bd9Sstevel@tonic-gate 		new_line = 0;
3160*7c478bd9Sstevel@tonic-gate 	} else {
3161*7c478bd9Sstevel@tonic-gate 		new_line = 1;
3162*7c478bd9Sstevel@tonic-gate 	}
3163*7c478bd9Sstevel@tonic-gate 
3164*7c478bd9Sstevel@tonic-gate 	(void) vfprintf(stdout, format, ap);
3165*7c478bd9Sstevel@tonic-gate 
3166*7c478bd9Sstevel@tonic-gate 	va_end(ap);
3167*7c478bd9Sstevel@tonic-gate }
3168*7c478bd9Sstevel@tonic-gate 
3169*7c478bd9Sstevel@tonic-gate 
3170*7c478bd9Sstevel@tonic-gate static char *
name_place_to_str(itm_hdr_t * itm_hdr,itm_place2_t place)3171*7c478bd9Sstevel@tonic-gate name_place_to_str(itm_hdr_t	*itm_hdr, itm_place2_t place)
3172*7c478bd9Sstevel@tonic-gate {
3173*7c478bd9Sstevel@tonic-gate 	itm_data_t	d;
3174*7c478bd9Sstevel@tonic-gate 
3175*7c478bd9Sstevel@tonic-gate 	if (0 != place) {
3176*7c478bd9Sstevel@tonic-gate 		d = *((itm_data_t *)ADDR2(place));
3177*7c478bd9Sstevel@tonic-gate 		if ((sizeof (itm_place_t)) < d.size) {
3178*7c478bd9Sstevel@tonic-gate 			d.place.itm_ptr = (itm_place2_t)ADDR(d.place);
3179*7c478bd9Sstevel@tonic-gate 		}
3180*7c478bd9Sstevel@tonic-gate 	} else {
3181*7c478bd9Sstevel@tonic-gate 		d.size = 0;
3182*7c478bd9Sstevel@tonic-gate 		d.place.itm_ptr = 0;
3183*7c478bd9Sstevel@tonic-gate 	}
3184*7c478bd9Sstevel@tonic-gate 	return (name_to_str(&d));
3185*7c478bd9Sstevel@tonic-gate }
3186*7c478bd9Sstevel@tonic-gate 
3187*7c478bd9Sstevel@tonic-gate static char *
tbl_name(itm_hdr_t * itm_hdr,itm_tbl_hdr_t * tbl_hdr)3188*7c478bd9Sstevel@tonic-gate tbl_name(itm_hdr_t	*itm_hdr, itm_tbl_hdr_t		*tbl_hdr)
3189*7c478bd9Sstevel@tonic-gate {
3190*7c478bd9Sstevel@tonic-gate 	if (ITM_TBL_OP_INIT == tbl_hdr->type) {
3191*7c478bd9Sstevel@tonic-gate 		return (RNPREF "init");
3192*7c478bd9Sstevel@tonic-gate 	} else if (ITM_TBL_OP_RESET == tbl_hdr->type) {
3193*7c478bd9Sstevel@tonic-gate 		return (RNPREF "reset");
3194*7c478bd9Sstevel@tonic-gate 	} else if (tbl_hdr->name.itm_ptr) {
3195*7c478bd9Sstevel@tonic-gate 		return (name_place_to_str(itm_hdr, tbl_hdr->name.itm_ptr));
3196*7c478bd9Sstevel@tonic-gate 	} else {
3197*7c478bd9Sstevel@tonic-gate 		return (NULL);
3198*7c478bd9Sstevel@tonic-gate 	}
3199*7c478bd9Sstevel@tonic-gate }
3200*7c478bd9Sstevel@tonic-gate 
3201*7c478bd9Sstevel@tonic-gate 
3202*7c478bd9Sstevel@tonic-gate static char *
reg_name(itm_hdr_t * itm_hdr,itm_place_t op)3203*7c478bd9Sstevel@tonic-gate reg_name(itm_hdr_t	*itm_hdr, itm_place_t op)
3204*7c478bd9Sstevel@tonic-gate {
3205*7c478bd9Sstevel@tonic-gate 	itm_info_hdr_t		*info_hdr;
3206*7c478bd9Sstevel@tonic-gate 	static char		sbuf[32];
3207*7c478bd9Sstevel@tonic-gate 	itm_num_t		reg_num;
3208*7c478bd9Sstevel@tonic-gate 
3209*7c478bd9Sstevel@tonic-gate 	reg_num = (itm_num_t)(op.itm_ptr);
3210*7c478bd9Sstevel@tonic-gate 	if (0 == itm_hdr->info_hdr.itm_ptr) {
3211*7c478bd9Sstevel@tonic-gate 		(void) sprintf(sbuf, "reg%ld\n", reg_num);
3212*7c478bd9Sstevel@tonic-gate 		return (sbuf);
3213*7c478bd9Sstevel@tonic-gate 	} else {
3214*7c478bd9Sstevel@tonic-gate 		info_hdr = INFO_HDR(itm_hdr);
3215*7c478bd9Sstevel@tonic-gate 		return (name_place_to_str(
3216*7c478bd9Sstevel@tonic-gate 			itm_hdr,
3217*7c478bd9Sstevel@tonic-gate 			info_hdr->reg_plc_tbl.place.itm_ptr +
3218*7c478bd9Sstevel@tonic-gate 			(reg_num	*sizeof (itm_data_t))));
3219*7c478bd9Sstevel@tonic-gate 	}
3220*7c478bd9Sstevel@tonic-gate }
3221*7c478bd9Sstevel@tonic-gate 
3222*7c478bd9Sstevel@tonic-gate static itm_hdr_t *
itm_attach(const char * itm_file)3223*7c478bd9Sstevel@tonic-gate itm_attach(const char	*itm_file)
3224*7c478bd9Sstevel@tonic-gate {
3225*7c478bd9Sstevel@tonic-gate 	itm_hdr_t	*itm_hdr;
3226*7c478bd9Sstevel@tonic-gate 	struct stat	st;
3227*7c478bd9Sstevel@tonic-gate 	int		fd;
3228*7c478bd9Sstevel@tonic-gate 
3229*7c478bd9Sstevel@tonic-gate 	fd = open(itm_file, O_RDONLY, 0);
3230*7c478bd9Sstevel@tonic-gate 	if (fd == -1) {
3231*7c478bd9Sstevel@tonic-gate 		PERROR(gettext("open()"));
3232*7c478bd9Sstevel@tonic-gate 		return	(NULL);
3233*7c478bd9Sstevel@tonic-gate 	}
3234*7c478bd9Sstevel@tonic-gate 
3235*7c478bd9Sstevel@tonic-gate 	if (fstat(fd, &st) == -1) {
3236*7c478bd9Sstevel@tonic-gate 		PERROR(gettext("fstat()"));
3237*7c478bd9Sstevel@tonic-gate 		return	(NULL);
3238*7c478bd9Sstevel@tonic-gate 	}
3239*7c478bd9Sstevel@tonic-gate 	itm_hdr = (void *) mmap(NULL, st.st_size,
3240*7c478bd9Sstevel@tonic-gate 				    PROT_READ, MAP_SHARED, fd, 0);
3241*7c478bd9Sstevel@tonic-gate 	if (MAP_FAILED == itm_hdr) {
3242*7c478bd9Sstevel@tonic-gate 		PERROR(gettext("mmap()"));
3243*7c478bd9Sstevel@tonic-gate 		return	(NULL);
3244*7c478bd9Sstevel@tonic-gate 	}
3245*7c478bd9Sstevel@tonic-gate 
3246*7c478bd9Sstevel@tonic-gate 	(void) close(fd);
3247*7c478bd9Sstevel@tonic-gate 
3248*7c478bd9Sstevel@tonic-gate 	if ((itm_hdr->ident[0] != ITM_IDENT_0) ||
3249*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->ident[1] != ITM_IDENT_1) ||
3250*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->ident[2] != ITM_IDENT_2) ||
3251*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->ident[3] != ITM_IDENT_3)) {
3252*7c478bd9Sstevel@tonic-gate 		itm_error(gettext("magic number error\n"));
3253*7c478bd9Sstevel@tonic-gate 		return	(NULL);
3254*7c478bd9Sstevel@tonic-gate 	}
3255*7c478bd9Sstevel@tonic-gate 	if ((itm_hdr->version[0] != ITM_VER_0) ||
3256*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->version[1] != ITM_VER_1) ||
3257*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->version[2] != ITM_VER_2) ||
3258*7c478bd9Sstevel@tonic-gate #if defined(_LITTLE_ENDIAN)
3259*7c478bd9Sstevel@tonic-gate #if defined(_LP64)
3260*7c478bd9Sstevel@tonic-gate 	    ((itm_hdr->spec[3] != ITM_SPEC_3_32_LITTLE_ENDIAN) &&
3261*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->spec[3] != ITM_SPEC_3_64_LITTLE_ENDIAN))) {
3262*7c478bd9Sstevel@tonic-gate #else
3263*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->spec[3] != ITM_SPEC_3_32_LITTLE_ENDIAN)) {
3264*7c478bd9Sstevel@tonic-gate #endif
3265*7c478bd9Sstevel@tonic-gate #else
3266*7c478bd9Sstevel@tonic-gate #if defined(_LP64)
3267*7c478bd9Sstevel@tonic-gate 	    ((itm_hdr->spec[3] != ITM_SPEC_3_32_BIG_ENDIAN) &&
3268*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->spec[3] != ITM_SPEC_3_64_BIG_ENDIAN))) {
3269*7c478bd9Sstevel@tonic-gate #else
3270*7c478bd9Sstevel@tonic-gate 	    (itm_hdr->spec[3] != ITM_SPEC_3_32_BIG_ENDIAN)) {
3271*7c478bd9Sstevel@tonic-gate #endif
3272*7c478bd9Sstevel@tonic-gate #endif
3273*7c478bd9Sstevel@tonic-gate 		itm_error(gettext("version number error\n"));
3274*7c478bd9Sstevel@tonic-gate 		return	(NULL);
3275*7c478bd9Sstevel@tonic-gate 	}
3276*7c478bd9Sstevel@tonic-gate 	if (itm_hdr->itm_size.itm_ptr != st.st_size) {
3277*7c478bd9Sstevel@tonic-gate 		itm_error(gettext(
3278*7c478bd9Sstevel@tonic-gate 			"size error: expected=%1$d current=%2$d\n"),
3279*7c478bd9Sstevel@tonic-gate 			(size_t)(itm_hdr->itm_size.itm_ptr), st.st_size);
3280*7c478bd9Sstevel@tonic-gate 		return (NULL);
3281*7c478bd9Sstevel@tonic-gate 	}
3282*7c478bd9Sstevel@tonic-gate 
3283*7c478bd9Sstevel@tonic-gate 	return (itm_hdr);
3284*7c478bd9Sstevel@tonic-gate }
3285