4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/types.h>
50 static itm_hdr_t
*itm_attach(const char *);
51 static void dump_tables(itm_hdr_t
*, itm_info_hdr_t
*);
52 static void dump_direc_tbl(itm_hdr_t
*, itm_place_t
);
53 static void dump_map(itm_hdr_t
*, itm_place_t
, int);
54 static void dump_map_i_f(itm_hdr_t
*, itm_place_t
, int);
55 static void dump_map_l_f(itm_hdr_t
*, itm_place_t
, int);
56 static void dump_map_hash(itm_hdr_t
*, itm_place_t
, int);
57 static void dump_map_dense_enc(itm_hdr_t
*, itm_place_t
, int);
58 static void dump_cond_tbl(itm_hdr_t
*, itm_place_t
, int);
59 static void dump_op_tbl(itm_hdr_t
*, itm_place_t
, int);
60 static void dump_op(itm_hdr_t
*, itm_place2_t
);
61 static void dump_expr(itm_hdr_t
*, itm_place_t
);
62 static void dump_range(itm_hdr_t
*, itm_place_t
);
63 static void dump_escapeseq(itm_hdr_t
*, itm_place_t
);
65 static char *tbl_name(itm_hdr_t
*, itm_tbl_hdr_t
*);
66 static char *reg_name(itm_hdr_t
*itm_hdr
, itm_place_t op
);
68 static void printi(int, char *, ...);
75 #define ADDR(place) ((void *)(((char *)(itm_hdr)) + \
76 ((itm_place2_t)((place).itm_ptr))))
77 #define DADDR(n) (((n)->size <= (sizeof ((n)->place))) ? \
78 ((char *)(&((n)->place))) :\
79 ((char *)(ADDR((n)->place))))
80 #define ADDR2(place2) ((void *)(((char *)(itm_hdr)) + \
81 ((itm_place2_t)(place2))))
82 #define INFO_HDR(pa) ((void *)(((char *)pa) + \
83 ((itm_hdr_t *)(pa))->info_hdr.itm_ptr))
86 #if defined(RESERVED_NAME_PREFIX)
87 #define RNPREF RESERVED_NAME_PREFIX
88 #else /* !defined(RESERVED_NAME_PREFIX) */
89 #define RNPREF /* null strings */
90 #endif /* !defined(RESERVED_NAME_PREFIX) */
94 disassemble(char *file
)
97 itm_info_hdr_t
*info_hdr
;
100 TRACE_MESSAGE('d', ("disassemble %s\n", file
));
102 itm_hdr
= itm_attach(file
);
104 if (NULL
== itm_hdr
) {
108 if (0 == itm_hdr
->info_hdr
.itm_ptr
) {
109 itm_error(gettext("binarytable is stripped\n"));
113 if (0 == itm_hdr
->info_hdr
.itm_ptr
) {
114 info_hdr
= malloc_vital(sizeof (itm_info_hdr_t
));
115 (void) memset(info_hdr
, 0, sizeof (itm_info_hdr_t
));
117 info_hdr
= INFO_HDR(itm_hdr
);
120 #if defined(ENABLE_TRACE)
121 dump_itm_header(itm_hdr
, info_hdr
);
123 printi(0, "//\n", file
);
124 printi(0, "// %s\n", file
);
125 printi(0, "//\n", file
);
127 type_id
= itm_hdr
->type_id
;
128 if ((NULL
!= cmd_opt
.disassemble
) &&
129 ((sizeof (itm_place_t
)) < type_id
.size
)) {
130 type_id
.place
.itm_ptr
+= (itm_place2_t
)itm_hdr
;
132 printi(1, "%s {\n", name_to_str(&type_id
));
133 dump_tables(itm_hdr
, info_hdr
);
137 #if defined(ENABLE_TRACE)
139 dump_itm_header(itm_hdr_t
*itm_header
, itm_info_hdr_t
*info_header
)
142 char *str_interpreter
;
145 itm_data_t interpreter
;
147 type_id
= itm_header
->type_id
;
148 str_type_id
= malloc_vital(itm_header
->type_id
.size
+ 1);
149 if ((NULL
!= cmd_opt
.disassemble
) &&
150 ((sizeof (itm_place_t
)) < type_id
.size
)) {
151 type_id
.place
.itm_ptr
+= (itm_place2_t
)itm_header
;
153 (void) memcpy(str_type_id
, name_to_str(&type_id
), type_id
.size
+ 1);
155 interpreter
= itm_header
->interpreter
;
156 str_interpreter
= malloc_vital(itm_header
->interpreter
.size
+ 1);
157 if ((NULL
!= cmd_opt
.disassemble
) &&
158 ((sizeof (itm_place_t
)) < interpreter
.size
)) {
159 interpreter
.place
.itm_ptr
+= (itm_place2_t
)itm_header
;
161 (void) memcpy(str_interpreter
, name_to_str(&interpreter
),
162 interpreter
.size
+ 1);
167 "Sizeof Data Structures \n"
168 " sizeof(int) = %ld\n"
169 " sizeof(long) = %ld\n"
170 " sizeof(uintptr_t) = %ld\n"
171 " sizeof(struct itm_place_t) = %ld\n"
172 " sizeof(struct itm_data_t) = %ld\n"
173 " sizeof(struct itm_hdr_t) = %ld\n"
174 " sizeof(struct itm_place_tbl_info_t) = %ld\n"
175 " sizeof(struct itm_section_info_t) = %ld\n"
176 " sizeof(struct itm_action_type_t) = %ld\n"
177 " sizeof(struct itm_direct_t) = %ld\n"
178 " sizeof(struct itm_cond_t) = %ld\n"
179 " sizeof(struct itm_range_hdr_t) = %ld\n"
180 " sizeof(struct itm_escapeseq_hdr_t) = %ld\n"
181 " sizeof(struct itm_map_idx_fix_hdr_t) = %ld\n"
182 " sizeof(struct itm_map_lookup_hdr_t) = %ld\n"
183 " sizeof(struct itm_map_hash_hdr_t) = %ld\n"
184 " sizeof(struct itm_map_dense_enc_hdr_t) = %ld\n"
185 " sizeof(struct itm_expr_t) = %ld\n"
186 " sizeof(enum itm_op_type_t) = %ld\n"
187 " sizeof(struct itm_op_t) u= %ld\n"
188 " sizeof(enum itm_expr_type_t)= %ld\n"
194 sizeof (itm_place_t
),
197 sizeof (itm_place_tbl_info_t
),
198 sizeof (itm_section_info_t
),
199 sizeof (itm_action_type_t
),
200 sizeof (itm_direc_t
),
202 sizeof (itm_range_hdr_t
),
203 sizeof (itm_escapeseq_hdr_t
),
204 sizeof (itm_map_idx_fix_hdr_t
),
205 sizeof (itm_map_lookup_hdr_t
),
206 sizeof (itm_map_hash_hdr_t
),
207 sizeof (itm_map_dense_enc_hdr_t
),
209 sizeof (itm_op_type_t
),
211 sizeof (itm_expr_type_t
)));
215 "spec = %02x%02x%02x%02x\n"
216 "version = %02x%02x%02x%02x\n"
220 "op_init_tbl = %ld\n"
221 "op_reset_tbl = %ld\n"
222 "direc_init_tbl = %ld\n"
224 "itm_hdr_size = %ld\n"
226 "info_hdr_size = %ld\n",
228 itm_header
->ident
[0],
229 itm_header
->ident
[1],
230 itm_header
->ident
[2],
231 /* itm_header->ident[3], */
236 itm_header
->version
[0],
237 itm_header
->version
[1],
238 itm_header
->version
[2],
239 itm_header
->version
[3],
240 itm_header
->itm_size
.itm_ptr
,
243 itm_header
->op_init_tbl
.itm_ptr
,
244 itm_header
->op_reset_tbl
.itm_ptr
,
245 itm_header
->direc_init_tbl
.itm_ptr
,
247 itm_header
->itm_hdr_size
,
248 itm_header
->info_hdr
.itm_ptr
,
249 (sizeof (itm_info_hdr_t
))));
252 (" str_sec = (%4ld %4ld %4ld) "
253 " str_plc_tbl = (%4ld %4ld %4ld)\n"
254 "direc_sec_tbl = (%4ld %4ld %4ld) "
255 "direc_plc_tbl = (%4ld %4ld %4ld)\n"
256 " cond_sec_tbl = (%4ld %4ld %4ld) "
257 " cond_plc_tbl = (%4ld %4ld %4ld)\n"
258 " map_sec_tbl = (%4ld %4ld %4ld) "
259 " map_plc_tbl = (%4ld %4ld %4ld)\n"
260 " op_sec_tbl = (%4ld %4ld %4ld) "
261 " op_plc_tbl = (%4ld %4ld %4ld)\n"
262 "range_sec_tbl = (%4ld %4ld %4ld) "
263 "range_plc_tbl = (%4ld %4ld %4ld)\n"
264 "escsq_sec_tbl = (%4ld %4ld %4ld) "
265 "escsq_plc_tbl = (%4ld %4ld %4ld)\n"
266 " data_sec = (%4ld %4ld %4ld) "
267 " data_plc_tbl = (%4ld %4ld %4ld)\n"
268 " name_sec = (%4ld %4ld %4ld) "
269 " name_plc_tbl = (%4ld %4ld %4ld)\n"
271 " reg_plc_tbl = (%4ld %4ld %4ld)\n"
273 info_header
->str_sec
.place
.itm_ptr
,
274 info_header
->str_sec
.size
,
275 info_header
->str_sec
.number
,
276 info_header
->str_plc_tbl
.place
.itm_ptr
,
277 info_header
->str_plc_tbl
.size
,
278 info_header
->str_plc_tbl
.number
,
279 info_header
->direc_tbl_sec
.place
.itm_ptr
,
280 info_header
->direc_tbl_sec
.size
,
281 info_header
->direc_tbl_sec
.number
,
282 info_header
->direc_plc_tbl
.place
.itm_ptr
,
283 info_header
->direc_plc_tbl
.size
,
284 info_header
->direc_plc_tbl
.number
,
285 info_header
->cond_tbl_sec
.place
.itm_ptr
,
286 info_header
->cond_tbl_sec
.size
,
287 info_header
->cond_tbl_sec
.number
,
288 info_header
->cond_plc_tbl
.place
.itm_ptr
,
289 info_header
->cond_plc_tbl
.size
,
290 info_header
->cond_plc_tbl
.number
,
291 info_header
->map_tbl_sec
.place
.itm_ptr
,
292 info_header
->map_tbl_sec
.size
,
293 info_header
->map_tbl_sec
.number
,
294 info_header
->map_plc_tbl
.place
.itm_ptr
,
295 info_header
->map_plc_tbl
.size
,
296 info_header
->map_plc_tbl
.number
,
297 info_header
->op_tbl_sec
.place
.itm_ptr
,
298 info_header
->op_tbl_sec
.size
,
299 info_header
->op_tbl_sec
.number
,
300 info_header
->op_plc_tbl
.place
.itm_ptr
,
301 info_header
->op_plc_tbl
.size
,
302 info_header
->op_plc_tbl
.number
,
303 info_header
->range_tbl_sec
.place
.itm_ptr
,
304 info_header
->range_tbl_sec
.size
,
305 info_header
->range_tbl_sec
.number
,
306 info_header
->range_plc_tbl
.place
.itm_ptr
,
307 info_header
->range_plc_tbl
.size
,
308 info_header
->range_plc_tbl
.number
,
309 info_header
->escapeseq_tbl_sec
.place
.itm_ptr
,
310 info_header
->escapeseq_tbl_sec
.size
,
311 info_header
->escapeseq_tbl_sec
.number
,
312 info_header
->escapeseq_plc_tbl
.place
.itm_ptr
,
313 info_header
->escapeseq_plc_tbl
.size
,
314 info_header
->escapeseq_plc_tbl
.number
,
315 info_header
->data_sec
.place
.itm_ptr
,
316 info_header
->data_sec
.size
,
317 info_header
->data_sec
.number
,
318 info_header
->data_plc_tbl
.place
.itm_ptr
,
319 info_header
->data_plc_tbl
.size
,
320 info_header
->data_plc_tbl
.number
,
321 info_header
->name_sec
.place
.itm_ptr
,
322 info_header
->name_sec
.size
,
323 info_header
->name_sec
.number
,
324 info_header
->name_plc_tbl
.place
.itm_ptr
,
325 info_header
->name_plc_tbl
.size
,
326 info_header
->name_plc_tbl
.number
,
327 info_header
->reg_plc_tbl
.place
.itm_ptr
,
328 info_header
->reg_plc_tbl
.size
,
329 info_header
->reg_plc_tbl
.number
,
338 dump_tables(itm_hdr_t
*itm_hdr
, itm_info_hdr_t
*info_hdr
)
346 data
= (itm_data_t
*)(ADDR(info_hdr
->reg_plc_tbl
.place
));
347 for (n
= 0; n
< info_hdr
->reg_plc_tbl
.number
; n
++, data
+= 1) {
349 if ((sizeof (itm_place_t
)) < d
.size
) {
350 d
.place
.itm_ptr
= (itm_place2_t
)ADDR(d
.place
);
352 printi(0, "// register: %s\n", name_to_str(&d
));
355 data
= (itm_data_t
*)(ADDR(info_hdr
->name_plc_tbl
.place
));
356 for (n
= 0, place2
= info_hdr
->name_plc_tbl
.place
.itm_ptr
;
357 n
< info_hdr
->name_plc_tbl
.number
;
358 n
++, data
+= 1, place2
+= sizeof (itm_data_t
)) {
361 if ((sizeof (itm_place_t
)) < d
.size
) {
362 d
.place
.itm_ptr
= (itm_place2_t
)ADDR(d
.place
);
364 TRACE_MESSAGE('p', ("(*)name=%ld",
365 ((sizeof (itm_place_t
)) < d
.size
) ?
367 (place2
+ offsetof(itm_data_t
, place
))));
368 printi(0, "// name: %s\n", name_to_str(&d
));
372 place
= (itm_place_t
*)(ADDR(info_hdr
->cond_plc_tbl
.place
));
373 for (n
= 0; n
< info_hdr
->cond_plc_tbl
.number
; n
++, place
+= 1) {
374 dump_cond_tbl(itm_hdr
, *place
, 1);
376 place
= (itm_place_t
*)(ADDR(info_hdr
->map_plc_tbl
.place
));
377 for (n
= 0; n
< info_hdr
->map_plc_tbl
.number
;
379 dump_map(itm_hdr
, *place
, 1);
381 place
= (itm_place_t
*)(ADDR(info_hdr
->op_plc_tbl
.place
));
382 for (n
= 0; n
< info_hdr
->op_plc_tbl
.number
;
384 dump_op_tbl(itm_hdr
, *place
, 1);
386 place
= (itm_place_t
*)(ADDR(info_hdr
->direc_plc_tbl
.place
));
387 for (n
= 0; n
< info_hdr
->direc_plc_tbl
.number
; n
++, place
+= 1) {
388 dump_direc_tbl(itm_hdr
, *place
);
397 dump_direc_tbl(itm_hdr_t
*itm_hdr
, itm_place_t direc_place
)
399 itm_tbl_hdr_t
*direc_hdr
;
405 direc_hdr
= (itm_tbl_hdr_t
*)ADDR(direc_place
);
406 direc
= (itm_direc_t
*)(direc_hdr
+ 1);
408 TRACE_MESSAGE('p', ("(&)direc=%ld ", direc_place
.itm_ptr
));
410 printi(1, RNPREF
"direction");
411 if (0 != direc_hdr
->name
.itm_ptr
) {
412 name
= tbl_name(itm_hdr
, direc_hdr
);
414 printi(0, " %s", name
);
419 for (i
= 0; i
< direc_hdr
->number
; i
++, direc
++) {
420 dump_cond_tbl(itm_hdr
, direc
->condition
, 0);
424 type
= (ITM_TBL_MASK
&
425 (((itm_tbl_hdr_t
*)(ADDR(direc
->action
)))->type
));
427 if (ITM_TBL_OP
== type
) {
428 dump_op_tbl(itm_hdr
, direc
->action
, 0);
429 } else if (ITM_TBL_DIREC
== type
) {
430 printi(0, "direction: action: %ld\n",
431 direc
->action
.itm_ptr
);
432 } else if (ITM_TBL_MAP
== type
) {
433 dump_map(itm_hdr
, direc
->action
, 0);
436 "error ELIBBAD // unknown operation (%lx)\n",
446 dump_map(itm_hdr_t
*itm_hdr
, itm_place_t map_place
, int standalone
)
448 itm_tbl_hdr_t
*tbl_hdr
;
450 tbl_hdr
= (itm_tbl_hdr_t
*)ADDR(map_place
);
452 switch (tbl_hdr
->type
) {
453 case ITM_TBL_MAP_INDEX_FIXED_1_1
:
454 case ITM_TBL_MAP_INDEX_FIXED
:
455 dump_map_i_f(itm_hdr
, map_place
, standalone
);
457 case ITM_TBL_MAP_LOOKUP
:
458 dump_map_l_f(itm_hdr
, map_place
, standalone
);
460 case ITM_TBL_MAP_HASH
:
461 dump_map_hash(itm_hdr
, map_place
, standalone
);
463 case ITM_TBL_MAP_DENSE_ENC
:
464 dump_map_dense_enc(itm_hdr
, map_place
, standalone
);
473 * Dump map-indexed-fixed
476 dump_map_i_f(itm_hdr_t
*itm_hdr
, itm_place_t map_place
, int standalone
)
478 itm_tbl_hdr_t
*tbl_hdr
;
479 itm_map_idx_fix_hdr_t
*map_hdr
;
483 unsigned char *map_error
;
487 TRACE_MESSAGE('d', ("dump_map_i_f\n"));
489 tbl_hdr
= (itm_tbl_hdr_t
*)ADDR(map_place
);
490 map_hdr
= (itm_map_idx_fix_hdr_t
*)(tbl_hdr
+ 1);
492 if (0 < map_hdr
->error_num
) {
493 p
= (unsigned char *)(map_hdr
+ 1);
494 map_error
= p
+ (map_hdr
->result_len
* (tbl_hdr
->number
));
495 if (0 == map_hdr
->default_error
) {
496 map_error
+= map_hdr
->result_len
;
498 } else if (1 == map_hdr
->default_error
) {
499 p
= (unsigned char *)(map_hdr
+ 1);
500 map_error
= p
+ (map_hdr
->result_len
* (tbl_hdr
->number
));
506 (0 == tbl_hdr
->name
.itm_ptr
) &&
507 (map_place
.itm_ptr
!= itm_hdr
->direc_init_tbl
.itm_ptr
)) {
511 TRACE_MESSAGE('p', ("(&)map=%ld ", map_place
.itm_ptr
));
513 if (0 == tbl_hdr
->name
.itm_ptr
) {
516 name
= tbl_name(itm_hdr
, tbl_hdr
);
519 if ((0 == standalone
) && (0 != tbl_hdr
->name
.itm_ptr
)) {
521 printi(0, "%s;\n", name
);
523 printi(0, RNPREF
"unknown;\n", name
);
527 printi(1, RNPREF
"map");
529 printi(0, " %s", name
);
534 printi(0, "// simple indexed map\n");
535 printi(0, "// source_len=%ld result_len=%ld\n",
536 map_hdr
->source_len
, map_hdr
->result_len
);
537 printi(0, "// start=0x%p end=0x%p\n", /* DO NOT CHANGE to %ld */
538 map_hdr
->start
.itm_ptr
, map_hdr
->end
.itm_ptr
);
539 if (0 < map_hdr
->error_num
) {
540 printi(0, "// error_num=%ld\n",
543 if (0 == map_hdr
->default_error
) {
544 p
= (((unsigned char *)(map_hdr
+ 1)) +
545 (map_hdr
->result_len
*
546 (map_hdr
->end
.itm_ptr
- map_hdr
->start
.itm_ptr
+ 1)));
547 printi(0, RNPREF
"default 0x");
548 for (j
= 0; j
< map_hdr
->result_len
; j
++) {
549 printi(0, "%02x", *(p
+ j
));
552 } else if (-1 == map_hdr
->default_error
) {
553 printi(0, RNPREF
"default\t" RNPREF
"default\n");
556 for (i
= 0; i
<= (map_hdr
->end
.itm_ptr
- map_hdr
->start
.itm_ptr
); i
++) {
557 p
= (((unsigned char *)(map_hdr
+ 1)) +
558 (map_hdr
->result_len
* i
));
559 if ((NULL
== map_error
) ||
560 (0 == *(map_error
+ i
))) {
561 printi(0, "0x%0*p\t",
562 (map_hdr
->source_len
* 2), i
+ map_hdr
->start
.itm_ptr
);
564 for (j
= 0; j
< map_hdr
->result_len
; j
++) {
565 printi(0, "%02x", *(p
+ j
));
569 } else if (0 >= map_hdr
->default_error
) {
570 if (0 == error_flag
) {
571 printi(0, "0x%0*p\t",
572 (map_hdr
->source_len
* 2),
573 i
+ map_hdr
->start
.itm_ptr
);
574 printi(0, "error\n");
576 } else if (error_flag
== 1) {
577 printi(0, " :\t:\n");
587 * Dump map-lookup-fixed
590 dump_map_l_f(itm_hdr_t
*itm_hdr
, itm_place_t map_place
, int standalone
)
592 itm_tbl_hdr_t
*tbl_hdr
;
593 itm_map_lookup_hdr_t
*map_hdr
;
599 TRACE_MESSAGE('d', ("dump_map_l_f\n"));
601 tbl_hdr
= (itm_tbl_hdr_t
*)ADDR(map_place
);
602 map_hdr
= (itm_map_lookup_hdr_t
*)(tbl_hdr
+ 1);
605 (0 == tbl_hdr
->name
.itm_ptr
) &&
606 (map_place
.itm_ptr
!= itm_hdr
->direc_init_tbl
.itm_ptr
)) {
610 TRACE_MESSAGE('p', ("(&)map=%ld ", map_place
.itm_ptr
));
612 if (0 == tbl_hdr
->name
.itm_ptr
) {
615 name
= tbl_name(itm_hdr
, tbl_hdr
);
618 if ((0 == standalone
) && (0 != tbl_hdr
->name
.itm_ptr
)) {
620 printi(0, "%s;\n", name
);
622 printi(0, RNPREF
"unknown;\n", name
);
626 printi(1, RNPREF
"map");
628 printi(0, " %s", name
);
633 printi(0, "// binary search map\n");
634 printi(0, "// source_len=%ld result_len=%ld\n",
635 map_hdr
->source_len
, map_hdr
->result_len
);
636 if (0 < map_hdr
->error_num
) {
637 printi(0, "// error_num=%ld\n",
641 if (0 == map_hdr
->default_error
) {
642 printi(0, RNPREF
"default\t0x");
643 p
= ((unsigned char *)(map_hdr
+ 1) +
645 (map_hdr
->source_len
+ map_hdr
->result_len
+ 1)) +
646 map_hdr
->source_len
+ 1);
647 for (j
= 0; j
< map_hdr
->result_len
; j
++, p
++) {
648 printi(0, "%02x", *p
);
651 } else if (-1 == map_hdr
->default_error
) {
652 printi(0, RNPREF
"default\t" RNPREF
"default\n");
654 p
= (unsigned char *)(map_hdr
+ 1);
655 for (i
= 0; i
< tbl_hdr
->number
; i
++) {
657 for (j
= 0; j
< map_hdr
->source_len
; j
++, p
++) {
658 printi(0, "%02x", *p
);
662 p
+= map_hdr
->result_len
+ 1;
663 printi(0, "\terror");
667 for (j
= 0; j
< map_hdr
->result_len
; j
++, p
++) {
668 printi(0, "%02x", *p
);
680 dump_map_hash(itm_hdr_t
*itm_hdr
, itm_place_t map_place
, int standalone
)
682 itm_tbl_hdr_t
*tbl_hdr
;
683 itm_map_hash_hdr_t
*map_hdr
;
687 unsigned char *map_hash
;
688 unsigned char *map_error
;
691 TRACE_MESSAGE('d', ("dump_map_hash\n"));
693 tbl_hdr
= (itm_tbl_hdr_t
*)ADDR(map_place
);
694 map_hdr
= (itm_map_hash_hdr_t
*)(tbl_hdr
+ 1);
695 map_error
= (unsigned char *)(map_hdr
+ 1);
696 map_hash
= (map_error
+ map_hdr
->hash_tbl_num
);
699 (0 == tbl_hdr
->name
.itm_ptr
) &&
700 (map_place
.itm_ptr
!= itm_hdr
->direc_init_tbl
.itm_ptr
)) {
704 TRACE_MESSAGE('p', ("(&)map=%ld ", map_place
.itm_ptr
));
706 if (0 == tbl_hdr
->name
.itm_ptr
) {
709 name
= tbl_name(itm_hdr
, tbl_hdr
);
712 if ((0 == standalone
) && (0 != tbl_hdr
->name
.itm_ptr
)) {
714 printi(0, "%s;\n", name
);
716 printi(0, RNPREF
"unknown;\n", name
);
720 printi(1, RNPREF
"map");
722 printi(0, " %s", name
);
727 printi(0, "// hashed map\n");
728 printi(0, "// number=%ld\n",
730 printi(0, "// source_len=%ld result_len=%ld\n",
731 map_hdr
->source_len
, map_hdr
->result_len
);
732 printi(0, "// hash_tbl_size=%ld hash_of_size=%ld hash_of_num=%ld\n",
733 map_hdr
->hash_tbl_size
,
734 map_hdr
->hash_of_size
, map_hdr
->hash_of_num
);
735 if (0 < map_hdr
->error_num
) {
736 printi(0, "// error_num=%ld\n",
741 if (0 == map_hdr
->default_error
) {
742 printi(0, RNPREF
"default\t0x");
743 p
= map_hash
+ map_hdr
->hash_tbl_size
+
744 map_hdr
->hash_of_size
;
745 for (j
= 0; j
< map_hdr
->result_len
; j
++, p
++) {
746 printi(0, "%02x", *p
);
749 } else if (-1 == map_hdr
->default_error
) {
750 printi(0, RNPREF
"default\t" RNPREF
"default\n");
753 TRACE_MESSAGE('d', ("dump_map_hash: %ld %ld\n",
754 tbl_hdr
->number
, map_hdr
->hash_of_num
));
755 for (i
= 0; i
< map_hdr
->hash_tbl_num
; i
++) {
756 TRACE_MESSAGE('d', ("dump_map_hash: %x (0x%08p)\n", *p
, p
));
757 if (0 == *(map_error
+ i
)) {
758 p
+= (map_hdr
->source_len
+ 1 + map_hdr
->result_len
);
762 for (j
= 0; j
< map_hdr
->source_len
; j
++, p
++) {
763 printi(0, "%02x", *p
);
767 p
+= map_hdr
->result_len
+ 1;
768 printi(0, "\terror");
772 for (j
= 0; j
< map_hdr
->result_len
; j
++, p
++) {
773 printi(0, "%02x", *p
);
778 printi(0, "// of table\n");
779 for (i
= 0; i
< map_hdr
->hash_of_num
; i
++) {
781 for (j
= 0; j
< map_hdr
->source_len
; j
++, p
++) {
782 printi(0, "%02x", *p
);
785 p
+= map_hdr
->result_len
+ 1;
786 printi(0, "\terror\n");
790 for (j
= 0; j
< map_hdr
->result_len
; j
++, p
++) {
791 printi(0, "%02x", *p
);
801 * Dump map-dense-encoding
804 dump_map_dense_enc(itm_hdr_t
*itm_hdr
, itm_place_t map_place
, int standalone
)
806 itm_tbl_hdr_t
*tbl_hdr
;
807 itm_map_dense_enc_hdr_t
*map_hdr
;
811 unsigned char *map_ptr
;
812 unsigned char *map_error
;
813 unsigned char *byte_seq_min
;
814 unsigned char *byte_seq_max
;
818 TRACE_MESSAGE('d', ("dump_map_dense_enc\n"));
820 tbl_hdr
= (itm_tbl_hdr_t
*)ADDR(map_place
);
821 map_hdr
= (itm_map_dense_enc_hdr_t
*)(tbl_hdr
+ 1);
822 map_ptr
= ((unsigned char *)(map_hdr
+ 1) +
823 map_hdr
->source_len
+ map_hdr
->source_len
);
825 if (0 < map_hdr
->error_num
) {
826 map_error
= (map_ptr
+
827 (tbl_hdr
->number
* map_hdr
->result_len
));
828 if (0 == map_hdr
->default_error
) {
829 map_error
+= map_hdr
->result_len
;
831 } else if (1 == map_hdr
->default_error
) {
832 map_error
= (map_ptr
+
833 (tbl_hdr
->number
* map_hdr
->result_len
));
837 byte_seq_min
= (unsigned char *)(map_hdr
+ 1);
838 byte_seq_max
= byte_seq_min
+ map_hdr
->source_len
;
841 (0 == tbl_hdr
->name
.itm_ptr
) &&
842 (map_place
.itm_ptr
!= itm_hdr
->direc_init_tbl
.itm_ptr
)) {
846 TRACE_MESSAGE('p', ("(&)map=%ld ", map_place
.itm_ptr
));
848 if (0 == tbl_hdr
->name
.itm_ptr
) {
851 name
= tbl_name(itm_hdr
, tbl_hdr
);
854 if ((0 == standalone
) && (0 != tbl_hdr
->name
.itm_ptr
)) {
856 printi(0, "%s;\n", name
);
858 printi(0, RNPREF
"unknown;\n", name
);
862 printi(1, RNPREF
"map");
864 printi(0, " %s", name
);
869 printi(0, "// dense encoded map\n");
870 printi(0, "// entry_number=%ld\n", tbl_hdr
->number
);
871 printi(0, "// source_len=%ld result_len=%ld\n",
872 map_hdr
->source_len
, map_hdr
->result_len
);
873 printi(0, "// byte_seq_min=0x");
875 for (i
= 0; i
< map_hdr
->source_len
; i
++, p
++) {
876 printi(0, "%02x", *p
);
879 printi(0, "// byte_seq_max=0x");
881 for (i
= 0; i
< map_hdr
->source_len
; i
++, p
++) {
882 printi(0, "%02x", *p
);
885 if (0 < map_hdr
->error_num
) {
886 printi(0, "// error_num=%ld\n",
889 if (0 == map_hdr
->default_error
) {
890 p
= (map_ptr
+ (tbl_hdr
->number
* map_hdr
->result_len
));
891 printi(0, RNPREF
"default 0x");
892 for (j
= 0; j
< map_hdr
->result_len
; j
++) {
893 printi(0, "%02x", *(p
+ j
));
896 } else if (-1 == map_hdr
->default_error
) {
897 printi(0, RNPREF
"default\t" RNPREF
"default\n");
901 for (i
= 0, p
= map_ptr
; i
< tbl_hdr
->number
;
902 i
++, p
+= map_hdr
->result_len
) {
903 if ((NULL
== map_error
) || (0 == *(map_error
+ i
))) {
905 dense_enc_index_to_byte_seq(
906 i
, map_hdr
->source_len
,
907 byte_seq_min
, byte_seq_max
));
909 for (j
= 0; j
< map_hdr
->result_len
; j
++) {
910 printi(0, "%02x", *(p
+ j
));
914 } else if (0 >= map_hdr
->default_error
) {
915 if (0 == error_flag
) {
917 dense_enc_index_to_byte_seq(
918 i
, map_hdr
->source_len
,
919 byte_seq_min
, byte_seq_max
));
920 printi(0, "error\n");
922 } else if (error_flag
== 1) {
923 printi(0, " :\t:\n");
933 * Evaluate condition table
936 dump_cond_tbl(itm_hdr_t
*itm_hdr
, itm_place_t cond_place
, int standalone
)
938 itm_tbl_hdr_t
*cond_hdr
;
943 TRACE_MESSAGE('p', ("(&)cond_tbl=%ld ", cond_place
.itm_ptr
));
944 cond_hdr
= (itm_tbl_hdr_t
*)(ADDR(cond_place
));
945 cond
= (itm_cond_t
*)(cond_hdr
+ 1);
947 if ((standalone
) && (0 == cond_hdr
->name
.itm_ptr
)) {
948 TRACE_MESSAGE('t', ("skip condition(%d, %ld)\n",
949 standalone
, cond_hdr
->name
.itm_ptr
));
953 if (0 == cond_place
.itm_ptr
) {
954 printi(0, RNPREF
"true");
958 if (0 == cond_hdr
->name
.itm_ptr
) {
961 name
= tbl_name(itm_hdr
, cond_hdr
);
964 if ((0 == standalone
) && (0 != cond_hdr
->name
.itm_ptr
)) {
966 printi(0, "%s", name
);
968 printi(0, RNPREF
"unknown");
972 printi(1, RNPREF
"condition");
974 printi(0, " %s", name
);
979 for (i
= 0; i
< cond_hdr
->number
; i
++, cond
++) {
980 switch (cond
->type
) {
981 case ITM_COND_BETWEEN
:
982 dump_range(itm_hdr
, cond
->operand
.place
);
985 dump_expr(itm_hdr
, cond
->operand
.place
);
988 case ITM_COND_ESCAPESEQ
:
989 dump_escapeseq(itm_hdr
, cond
->operand
.place
);
992 printi(0, "// unknown %d\n", cond
->type
);
1006 * Dump operation table
1009 dump_op_tbl(itm_hdr_t
*itm_hdr
, itm_place_t op_tbl_place
, int standalone
)
1011 itm_tbl_hdr_t
*op_hdr
;
1012 itm_op_t
*operation
;
1013 itm_place2_t op_place
;
1016 static int op_tbl_level
;
1018 op_hdr
= (itm_tbl_hdr_t
*)(ADDR(op_tbl_place
));
1019 operation
= (itm_op_t
*)(op_hdr
+ 1);
1020 TRACE_MESSAGE('p', ("(&)op_tbl=%ld ", op_tbl_place
));
1022 name
= tbl_name(itm_hdr
, op_hdr
);
1024 if ((standalone
) && (NULL
== name
))
1027 if (0 == op_tbl_level
) {
1028 if ((0 == standalone
) && (0 != op_hdr
->name
.itm_ptr
)) {
1030 printi(0, "%s;\n", name
);
1032 printi(0, RNPREF
"unknown;", name
);
1036 printi(1, RNPREF
"operation");
1038 printi(0, " %s", name
);
1046 op_place
= op_tbl_place
.itm_ptr
+ (sizeof (itm_tbl_hdr_t
));
1047 for (i
= 0; i
< op_hdr
->number
;
1048 i
++, operation
++, op_place
+= (sizeof (itm_op_t
))) {
1049 dump_op(itm_hdr
, op_place
);
1054 if (0 == op_tbl_level
) {
1061 * Evaluate single operation
1064 dump_op(itm_hdr_t
*itm_hdr
, itm_place2_t op_place
)
1066 itm_op_t
*operation
;
1067 itm_tbl_hdr_t
*op_hdr
;
1069 operation
= (itm_op_t
*)ADDR2(op_place
);
1070 TRACE_MESSAGE('p', ("(&)op=%ld ", op_place
));
1072 switch (operation
->type
) {
1074 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1078 printi(0, RNPREF
"error ");
1079 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1082 case ITM_OP_ERROR_D
:
1083 printi(0, RNPREF
"error %d;",
1084 operation
->data
.operand
[0].itm_ptr
);
1087 case ITM_OP_DISCARD
:
1088 printi(0, RNPREF
"discard ");
1089 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1092 case ITM_OP_DISCARD_D
:
1093 printi(0, RNPREF
"discard %ld;\n",
1094 operation
->data
.operand
[0].itm_ptr
);
1100 case ITM_OP_OUT_INVD
:
1101 printi(0, RNPREF
"out = ");
1102 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1106 printi(0, RNPREF
"if ");
1107 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1109 dump_op_tbl(itm_hdr
, operation
->data
.operand
[1], 0);
1112 case ITM_OP_IF_ELSE
:
1113 printi(0, RNPREF
"if ");
1114 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1116 dump_op_tbl(itm_hdr
, operation
->data
.operand
[1], 0);
1118 op_hdr
= ADDR(operation
->data
.operand
[2]);
1119 if ((1 == op_hdr
->number
) &&
1120 ((ITM_OP_IF_ELSE
== ((itm_op_t
*)(op_hdr
+ 1))->type
) ||
1121 (ITM_OP_IF
== ((itm_op_t
*)(op_hdr
+ 1))->type
))) {
1122 printi(0, RNPREF
"else ");
1123 dump_op_tbl(itm_hdr
, operation
->data
.operand
[2], 0);
1125 printi(1, RNPREF
"else {\n");
1126 dump_op_tbl(itm_hdr
, operation
->data
.operand
[2], 0);
1130 case ITM_OP_DIRECTION
: /* switch direction */
1131 printi(0, RNPREF
"direction %1$s;\n", tbl_name(itm_hdr
,
1132 (itm_tbl_hdr_t
*)ADDR(operation
->data
.operand
[0])));
1134 case ITM_OP_MAP
: /* use map */
1135 printi(0, RNPREF
"map %1$s", tbl_name(itm_hdr
,
1136 (itm_tbl_hdr_t
*)ADDR(operation
->data
.operand
[0])));
1137 if (0 != operation
->data
.operand
[1].itm_ptr
) {
1139 dump_expr(itm_hdr
, operation
->data
.operand
[1]);
1143 case ITM_OP_OPERATION
: /* invoke operation */
1144 printi(0, RNPREF
"operation %1$s;\n",
1146 (itm_tbl_hdr_t
*)ADDR(operation
->data
.operand
[0])));
1148 case ITM_OP_INIT
: /* invoke init operation */
1149 printi(0, RNPREF
"operation " RNPREF
"init;\n");
1151 case ITM_OP_RESET
: /* invoke reset operation */
1152 printi(0, RNPREF
"operation " RNPREF
"reset;\n");
1154 case ITM_OP_BREAK
: /* break */
1155 printi(0, RNPREF
"break;\n");
1157 case ITM_OP_RETURN
: /* return */
1158 printi(0, RNPREF
"return;\n");
1160 case ITM_OP_PRINTCHR
:
1161 printi(0, RNPREF
"printchr ");
1162 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1165 case ITM_OP_PRINTHD
:
1166 printi(0, RNPREF
"printhd ");
1167 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1170 case ITM_OP_PRINTINT
:
1171 printi(0, RNPREF
"printint ");
1172 dump_expr(itm_hdr
, operation
->data
.operand
[0]);
1176 printi(0, "// unknown operation: %lx\n", operation
->type
);
1186 dump_expr(itm_hdr_t
*itm_hdr
, itm_place_t expr_place
)
1191 expr
= (itm_expr_t
*)ADDR(expr_place
);
1192 TRACE_MESSAGE('p', ("(*)ex=%ld ", expr_place
.itm_ptr
));
1194 switch (expr
->type
) {
1195 case ITM_EXPR_NONE
: /* not used */
1198 case ITM_EXPR_NOP
: /* not used */
1201 case ITM_EXPR_NAME
: /* not used */
1204 case ITM_EXPR_INT
: /* integer */
1205 printi(0, "%ld", expr
->data
.itm_exnum
);
1207 case ITM_EXPR_SEQ
: /* byte sequence */
1208 data
= expr
->data
.value
;
1209 if ((sizeof (itm_place_t
)) < data
.size
) {
1210 data
.place
.itm_ptr
= (itm_place2_t
)ADDR(data
.place
);
1212 printi(0, "0x%s", data_to_hexadecimal(&data
));
1214 case ITM_EXPR_REG
: /* register */
1215 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1217 case ITM_EXPR_IN_VECTOR
: /* in[expr] */
1218 printi(0, RNPREF
"in[");
1219 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1222 case ITM_EXPR_IN_VECTOR_D
: /* in[num] */
1223 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1224 if (0 == expr
->data
.operand
[0].itm_ptr
) {
1225 printi(0, " // inputsize");
1228 case ITM_EXPR_OUT
: /* out */
1229 printi(0, RNPREF
"out");
1231 case ITM_EXPR_TRUE
: /* true */
1232 printi(0, RNPREF
"true");
1234 case ITM_EXPR_FALSE
: /* false */
1235 printi(0, RNPREF
"false");
1237 case ITM_EXPR_UMINUS
: /* unary minus */
1239 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1241 case ITM_EXPR_PLUS
: /* A + B */
1243 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1245 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1248 case ITM_EXPR_PLUS_E_D
: /* exprA + B */
1250 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1252 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1255 case ITM_EXPR_PLUS_E_R
: /* exprA + varB */
1257 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1259 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1262 case ITM_EXPR_PLUS_E_INVD
: /* exprA + in[B] */
1264 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1266 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1269 case ITM_EXPR_PLUS_D_E
: /* intA + exprB */
1271 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1273 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1276 case ITM_EXPR_PLUS_D_D
: /* intA + B */
1278 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1280 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1283 case ITM_EXPR_PLUS_D_R
: /* intA + varB */
1285 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1287 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1290 case ITM_EXPR_PLUS_D_INVD
: /* intA + in[B] */
1292 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1294 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1297 case ITM_EXPR_PLUS_R_E
: /* varA + exprB */
1299 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1301 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1304 case ITM_EXPR_PLUS_R_D
: /* varA + B */
1306 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1308 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1311 case ITM_EXPR_PLUS_R_R
: /* varA + varB */
1313 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1315 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1318 case ITM_EXPR_PLUS_R_INVD
: /* varA + in[B] */
1320 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1322 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1325 case ITM_EXPR_PLUS_INVD_E
: /* in[A] + exprB */
1327 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1329 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1332 case ITM_EXPR_PLUS_INVD_D
: /* in[A] + B */
1334 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1336 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1339 case ITM_EXPR_PLUS_INVD_R
: /* in[A] + varB */
1341 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1343 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1346 case ITM_EXPR_PLUS_INVD_INVD
: /* in[A] + in[B] */
1348 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1350 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1353 case ITM_EXPR_MINUS
: /* A - B */
1355 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1357 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1360 case ITM_EXPR_MINUS_E_D
: /* exprA - B */
1362 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1364 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1367 case ITM_EXPR_MINUS_E_R
: /* exprA - varB */
1369 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1371 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1374 case ITM_EXPR_MINUS_E_INVD
: /* exprA - in[B] */
1376 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1378 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1381 case ITM_EXPR_MINUS_D_E
: /* intA - exprB */
1383 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1385 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1388 case ITM_EXPR_MINUS_D_D
: /* intA - B */
1390 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1392 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1395 case ITM_EXPR_MINUS_D_R
: /* intA - varB */
1397 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1399 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1402 case ITM_EXPR_MINUS_D_INVD
: /* intA - in[B] */
1404 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1406 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1409 case ITM_EXPR_MINUS_R_E
: /* varA - exprB */
1411 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1413 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1416 case ITM_EXPR_MINUS_R_D
: /* varA - B */
1418 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1420 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1423 case ITM_EXPR_MINUS_R_R
: /* varA - varB */
1426 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1429 case ITM_EXPR_MINUS_R_INVD
: /* varA - in[B] */
1431 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1433 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1436 case ITM_EXPR_MINUS_INVD_E
: /* in[A] - exprB */
1438 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1440 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1443 case ITM_EXPR_MINUS_INVD_D
: /* in[A] - B */
1445 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1447 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1450 case ITM_EXPR_MINUS_INVD_R
: /* in[A] - varB */
1452 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1454 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1457 case ITM_EXPR_MINUS_INVD_INVD
: /* in[A] - in[B] */
1459 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1461 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1464 case ITM_EXPR_MUL
: /* A * B */
1466 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1468 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1471 case ITM_EXPR_MUL_E_D
: /* exprA * B */
1473 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1475 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1478 case ITM_EXPR_MUL_E_R
: /* exprA * varB */
1480 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1482 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1485 case ITM_EXPR_MUL_E_INVD
: /* exprA * in[B] */
1487 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1489 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1492 case ITM_EXPR_MUL_D_E
: /* intA * exprB */
1494 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1496 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1499 case ITM_EXPR_MUL_D_D
: /* intA * B */
1501 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1503 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1506 case ITM_EXPR_MUL_D_R
: /* intA * varB */
1508 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1510 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1513 case ITM_EXPR_MUL_D_INVD
: /* intA * in[B] */
1515 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1517 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1520 case ITM_EXPR_MUL_R_E
: /* varA * exprB */
1522 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1524 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1527 case ITM_EXPR_MUL_R_D
: /* varA * B */
1529 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1531 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1534 case ITM_EXPR_MUL_R_R
: /* varA * varB */
1537 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1540 case ITM_EXPR_MUL_R_INVD
: /* varA * in[B] */
1542 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1544 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1547 case ITM_EXPR_MUL_INVD_E
: /* in[A] * exprB */
1549 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1551 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1554 case ITM_EXPR_MUL_INVD_D
: /* in[A] * B */
1556 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1558 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1561 case ITM_EXPR_MUL_INVD_R
: /* in[A] * varB */
1563 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1565 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1568 case ITM_EXPR_MUL_INVD_INVD
: /* in[A] * in[B] */
1570 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1572 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1575 case ITM_EXPR_DIV
: /* A / B */
1577 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1579 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1582 case ITM_EXPR_DIV_E_D
: /* exprA / B */
1584 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1586 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1589 case ITM_EXPR_DIV_E_R
: /* exprA / varB */
1591 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1593 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1596 case ITM_EXPR_DIV_E_INVD
: /* exprA / in[B] */
1598 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1600 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1603 case ITM_EXPR_DIV_D_E
: /* intA / exprB */
1605 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1607 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1610 case ITM_EXPR_DIV_D_D
: /* intA / B */
1612 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1614 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1617 case ITM_EXPR_DIV_D_R
: /* intA / varB */
1619 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1621 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1624 case ITM_EXPR_DIV_D_INVD
: /* intA / in[B] */
1626 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1628 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1631 case ITM_EXPR_DIV_R_E
: /* varA / exprB */
1633 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1635 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1638 case ITM_EXPR_DIV_R_D
: /* varA / B */
1640 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1642 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1645 case ITM_EXPR_DIV_R_R
: /* varA / varB */
1648 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1651 case ITM_EXPR_DIV_R_INVD
: /* varA / in[B] */
1653 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1655 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1658 case ITM_EXPR_DIV_INVD_E
: /* in[A] / exprB */
1660 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1662 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1665 case ITM_EXPR_DIV_INVD_D
: /* in[A] / B */
1667 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1669 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1672 case ITM_EXPR_DIV_INVD_R
: /* in[A] / varB */
1674 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1676 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1679 case ITM_EXPR_DIV_INVD_INVD
: /* in[A] / in[B] */
1681 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1683 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1686 case ITM_EXPR_MOD
: /* A % B */
1688 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1690 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1693 case ITM_EXPR_MOD_E_D
: /* exprA % B */
1695 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1697 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1700 case ITM_EXPR_MOD_E_R
: /* exprA % varB */
1702 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1704 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1707 case ITM_EXPR_MOD_E_INVD
: /* exprA % in[B] */
1709 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1711 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1714 case ITM_EXPR_MOD_D_E
: /* intA % exprB */
1716 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1718 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1721 case ITM_EXPR_MOD_D_D
: /* intA % B */
1723 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1725 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1728 case ITM_EXPR_MOD_D_R
: /* intA % varB */
1730 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1732 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1735 case ITM_EXPR_MOD_D_INVD
: /* intA % in[B] */
1737 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1739 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1742 case ITM_EXPR_MOD_R_E
: /* varA % exprB */
1744 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1746 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1749 case ITM_EXPR_MOD_R_D
: /* varA % B */
1751 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1753 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1756 case ITM_EXPR_MOD_R_R
: /* varA % varB */
1759 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1762 case ITM_EXPR_MOD_R_INVD
: /* varA % in[B] */
1764 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1766 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1769 case ITM_EXPR_MOD_INVD_E
: /* in[A] % exprB */
1771 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1773 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1776 case ITM_EXPR_MOD_INVD_D
: /* in[A] % B */
1778 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1780 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1783 case ITM_EXPR_MOD_INVD_R
: /* in[A] % varB */
1785 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1787 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1790 case ITM_EXPR_MOD_INVD_INVD
: /* in[A] % in[B] */
1792 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1794 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1797 case ITM_EXPR_SHIFT_L
: /* A << B */
1799 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1801 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1804 case ITM_EXPR_SHIFT_L_E_D
: /* exprA << B */
1806 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1808 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1811 case ITM_EXPR_SHIFT_L_E_R
: /* exprA << varB */
1813 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1815 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1818 case ITM_EXPR_SHIFT_L_E_INVD
: /* exprA << in[B] */
1820 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1822 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1825 case ITM_EXPR_SHIFT_L_D_E
: /* intA << exprB */
1827 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1829 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1832 case ITM_EXPR_SHIFT_L_D_D
: /* intA << B */
1834 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1836 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1839 case ITM_EXPR_SHIFT_L_D_R
: /* intA << varB */
1841 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1843 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1846 case ITM_EXPR_SHIFT_L_D_INVD
: /* intA << in[B] */
1848 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1850 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1853 case ITM_EXPR_SHIFT_L_R_E
: /* varA << exprB */
1855 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1857 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1860 case ITM_EXPR_SHIFT_L_R_D
: /* varA << B */
1862 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1864 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1867 case ITM_EXPR_SHIFT_L_R_R
: /* varA << varB */
1870 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1873 case ITM_EXPR_SHIFT_L_R_INVD
: /* varA << in[B] */
1875 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1877 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1880 case ITM_EXPR_SHIFT_L_INVD_E
: /* in[A] << exprB */
1882 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1884 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1887 case ITM_EXPR_SHIFT_L_INVD_D
: /* in[A] << B */
1889 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1891 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1894 case ITM_EXPR_SHIFT_L_INVD_R
: /* in[A] << varB */
1896 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1898 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1901 case ITM_EXPR_SHIFT_L_INVD_INVD
: /* in[A] << in[B] */
1903 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1905 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1908 case ITM_EXPR_SHIFT_R
: /* A >> B */
1910 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1912 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1915 case ITM_EXPR_SHIFT_R_E_D
: /* exprA >> B */
1917 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1919 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1922 case ITM_EXPR_SHIFT_R_E_R
: /* exprA >> varB */
1924 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1926 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1929 case ITM_EXPR_SHIFT_R_E_INVD
: /* exprA >> in[B] */
1931 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
1933 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1936 case ITM_EXPR_SHIFT_R_D_E
: /* intA >> exprB */
1938 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1940 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1943 case ITM_EXPR_SHIFT_R_D_D
: /* intA >> B */
1945 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1947 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1950 case ITM_EXPR_SHIFT_R_D_R
: /* intA >> varB */
1952 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1954 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
1957 case ITM_EXPR_SHIFT_R_D_INVD
: /* intA >> in[B] */
1959 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
1961 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1964 case ITM_EXPR_SHIFT_R_R_E
: /* varA >> exprB */
1966 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1968 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1971 case ITM_EXPR_SHIFT_R_R_D
: /* varA >> B */
1973 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1975 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
1978 case ITM_EXPR_SHIFT_R_R_R
: /* varA >> varB */
1981 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1984 case ITM_EXPR_SHIFT_R_R_INVD
: /* varA >> in[B] */
1986 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
1988 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
1991 case ITM_EXPR_SHIFT_R_INVD_E
: /* in[A] >> exprB */
1993 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
1995 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
1998 case ITM_EXPR_SHIFT_R_INVD_D
: /* in[A] >> B */
2000 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2002 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2005 case ITM_EXPR_SHIFT_R_INVD_R
: /* in[A] >> varB */
2007 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2009 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2012 case ITM_EXPR_SHIFT_R_INVD_INVD
: /* in[A] >> in[B] */
2014 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2016 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2019 case ITM_EXPR_OR
: /* A | B */
2021 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2023 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2026 case ITM_EXPR_OR_E_D
: /* exprA | B */
2028 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2030 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2033 case ITM_EXPR_OR_E_R
: /* exprA | varB */
2035 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2037 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2040 case ITM_EXPR_OR_E_INVD
: /* exprA | in[B] */
2042 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2044 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2047 case ITM_EXPR_OR_D_E
: /* intA | exprB */
2049 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2051 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2054 case ITM_EXPR_OR_D_D
: /* intA | B */
2056 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2058 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2061 case ITM_EXPR_OR_D_R
: /* intA | varB */
2063 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2065 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2068 case ITM_EXPR_OR_D_INVD
: /* intA | in[B] */
2070 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2072 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2075 case ITM_EXPR_OR_R_E
: /* varA | exprB */
2077 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2079 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2082 case ITM_EXPR_OR_R_D
: /* varA | B */
2084 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2086 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2089 case ITM_EXPR_OR_R_R
: /* varA | varB */
2092 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2095 case ITM_EXPR_OR_R_INVD
: /* varA | in[B] */
2097 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2099 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2102 case ITM_EXPR_OR_INVD_E
: /* in[A] | exprB */
2104 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2106 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2109 case ITM_EXPR_OR_INVD_D
: /* in[A] | B */
2111 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2113 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2116 case ITM_EXPR_OR_INVD_R
: /* in[A] | varB */
2118 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2120 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2123 case ITM_EXPR_OR_INVD_INVD
: /* in[A] | in[B] */
2125 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2127 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2130 case ITM_EXPR_XOR
: /* A ^ B */
2132 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2134 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2137 case ITM_EXPR_XOR_E_D
: /* exprA ^ B */
2139 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2141 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2144 case ITM_EXPR_XOR_E_R
: /* exprA ^ varB */
2146 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2148 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2151 case ITM_EXPR_XOR_E_INVD
: /* exprA ^ in[B] */
2153 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2155 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2158 case ITM_EXPR_XOR_D_E
: /* intA ^ exprB */
2160 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2162 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2165 case ITM_EXPR_XOR_D_D
: /* intA ^ B */
2167 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2169 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2172 case ITM_EXPR_XOR_D_R
: /* intA ^ varB */
2174 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2176 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2179 case ITM_EXPR_XOR_D_INVD
: /* intA ^ in[B] */
2181 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2183 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2186 case ITM_EXPR_XOR_R_E
: /* varA ^ exprB */
2188 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2190 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2193 case ITM_EXPR_XOR_R_D
: /* varA ^ B */
2195 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2197 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2200 case ITM_EXPR_XOR_R_R
: /* varA ^ varB */
2203 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2206 case ITM_EXPR_XOR_R_INVD
: /* varA ^ in[B] */
2208 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2210 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2213 case ITM_EXPR_XOR_INVD_E
: /* in[A] ^ exprB */
2215 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2217 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2220 case ITM_EXPR_XOR_INVD_D
: /* in[A] ^ B */
2222 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2224 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2227 case ITM_EXPR_XOR_INVD_R
: /* in[A] ^ varB */
2229 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2231 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2234 case ITM_EXPR_XOR_INVD_INVD
: /* in[A] ^ in[B] */
2236 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2238 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2241 case ITM_EXPR_AND
: /* A & B */
2243 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2245 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2248 case ITM_EXPR_AND_E_D
: /* exprA & B */
2250 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2252 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2255 case ITM_EXPR_AND_E_R
: /* exprA & varB */
2257 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2259 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2262 case ITM_EXPR_AND_E_INVD
: /* exprA & in[B] */
2264 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2266 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2269 case ITM_EXPR_AND_D_E
: /* intA & exprB */
2271 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2273 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2276 case ITM_EXPR_AND_D_D
: /* intA & B */
2278 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2280 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2283 case ITM_EXPR_AND_D_R
: /* intA & varB */
2285 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2287 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2290 case ITM_EXPR_AND_D_INVD
: /* intA & in[B] */
2292 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2294 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2297 case ITM_EXPR_AND_R_E
: /* varA & exprB */
2299 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2301 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2304 case ITM_EXPR_AND_R_D
: /* varA & B */
2306 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2308 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2311 case ITM_EXPR_AND_R_R
: /* varA & varB */
2314 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2317 case ITM_EXPR_AND_R_INVD
: /* varA & in[B] */
2319 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2321 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2324 case ITM_EXPR_AND_INVD_E
: /* in[A] & exprB */
2326 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2328 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2331 case ITM_EXPR_AND_INVD_D
: /* in[A] & B */
2333 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2335 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2338 case ITM_EXPR_AND_INVD_R
: /* in[A] & varB */
2340 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2342 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2345 case ITM_EXPR_AND_INVD_INVD
: /* in[A] & in[B] */
2347 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2349 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2352 case ITM_EXPR_EQ
: /* A == B */
2354 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2356 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2359 case ITM_EXPR_EQ_E_D
: /* exprA == B */
2361 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2363 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2366 case ITM_EXPR_EQ_E_R
: /* exprA == varB */
2368 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2370 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2373 case ITM_EXPR_EQ_E_INVD
: /* exprA == in[B] */
2375 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2377 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2380 case ITM_EXPR_EQ_D_E
: /* intA == exprB */
2382 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2384 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2387 case ITM_EXPR_EQ_D_D
: /* intA == B */
2389 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2391 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2394 case ITM_EXPR_EQ_D_R
: /* intA == varB */
2396 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2398 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2401 case ITM_EXPR_EQ_D_INVD
: /* intA == in[B] */
2403 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2405 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2408 case ITM_EXPR_EQ_R_E
: /* varA == exprB */
2410 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2412 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2415 case ITM_EXPR_EQ_R_D
: /* varA == B */
2417 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2419 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2422 case ITM_EXPR_EQ_R_R
: /* varA == varB */
2424 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2426 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2429 case ITM_EXPR_EQ_R_INVD
: /* varA == in[B] */
2431 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2433 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2436 case ITM_EXPR_EQ_INVD_E
: /* in[A] == exprB */
2438 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2440 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2443 case ITM_EXPR_EQ_INVD_D
: /* in[A] == B */
2445 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2447 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2450 case ITM_EXPR_EQ_INVD_R
: /* in[A] == varB */
2452 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2454 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2457 case ITM_EXPR_EQ_INVD_INVD
: /* in[A] == in[B] */
2459 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2461 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2464 case ITM_EXPR_NE
: /* A != B */
2466 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2468 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2471 case ITM_EXPR_NE_E_D
: /* exprA != B */
2473 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2475 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2478 case ITM_EXPR_NE_E_R
: /* exprA != varB */
2480 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2482 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2485 case ITM_EXPR_NE_E_INVD
: /* exprA != in[B] */
2487 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2489 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2492 case ITM_EXPR_NE_D_E
: /* intA != exprB */
2494 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2496 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2499 case ITM_EXPR_NE_D_D
: /* intA != B */
2501 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2503 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2506 case ITM_EXPR_NE_D_R
: /* intA != varB */
2508 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2510 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2513 case ITM_EXPR_NE_D_INVD
: /* intA != in[B] */
2515 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2517 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2520 case ITM_EXPR_NE_R_E
: /* varA != exprB */
2522 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2524 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2527 case ITM_EXPR_NE_R_D
: /* varA != B */
2529 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2531 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2534 case ITM_EXPR_NE_R_R
: /* varA != varB */
2537 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2540 case ITM_EXPR_NE_R_INVD
: /* varA != in[B] */
2542 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2544 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2547 case ITM_EXPR_NE_INVD_E
: /* in[A] != exprB */
2549 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2551 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2554 case ITM_EXPR_NE_INVD_D
: /* in[A] != B */
2556 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2558 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2561 case ITM_EXPR_NE_INVD_R
: /* in[A] != varB */
2563 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2565 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2568 case ITM_EXPR_NE_INVD_INVD
: /* in[A] != in[B] */
2570 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2572 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2575 case ITM_EXPR_GT
: /* A > B */
2577 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2579 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2582 case ITM_EXPR_GT_E_D
: /* exprA > B */
2584 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2586 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2589 case ITM_EXPR_GT_E_R
: /* exprA > varB */
2591 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2593 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2596 case ITM_EXPR_GT_E_INVD
: /* exprA > in[B] */
2598 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2600 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2603 case ITM_EXPR_GT_D_E
: /* intA > exprB */
2605 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2607 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2610 case ITM_EXPR_GT_D_D
: /* intA > B */
2612 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2614 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2617 case ITM_EXPR_GT_D_R
: /* intA > varB */
2619 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2621 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2624 case ITM_EXPR_GT_D_INVD
: /* intA > in[B] */
2626 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2628 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2631 case ITM_EXPR_GT_R_E
: /* varA > exprB */
2633 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2635 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2638 case ITM_EXPR_GT_R_D
: /* varA > B */
2640 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2642 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2645 case ITM_EXPR_GT_R_R
: /* varA > varB */
2648 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2651 case ITM_EXPR_GT_R_INVD
: /* varA > in[B] */
2653 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2655 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2658 case ITM_EXPR_GT_INVD_E
: /* in[A] > exprB */
2660 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2662 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2665 case ITM_EXPR_GT_INVD_D
: /* in[A] > B */
2667 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2669 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2672 case ITM_EXPR_GT_INVD_R
: /* in[A] > varB */
2674 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2676 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2679 case ITM_EXPR_GT_INVD_INVD
: /* in[A] > in[B] */
2681 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2683 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2686 case ITM_EXPR_GE
: /* A >= B */
2688 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2690 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2693 case ITM_EXPR_GE_E_D
: /* exprA >= B */
2695 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2697 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2700 case ITM_EXPR_GE_E_R
: /* exprA >= varB */
2702 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2704 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2707 case ITM_EXPR_GE_E_INVD
: /* exprA >= in[B] */
2709 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2711 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2714 case ITM_EXPR_GE_D_E
: /* intA >= exprB */
2716 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2718 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2721 case ITM_EXPR_GE_D_D
: /* intA >= B */
2723 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2725 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2728 case ITM_EXPR_GE_D_R
: /* intA >= varB */
2730 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2732 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2735 case ITM_EXPR_GE_D_INVD
: /* intA >= in[B] */
2737 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2739 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2742 case ITM_EXPR_GE_R_E
: /* varA >= exprB */
2744 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2746 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2749 case ITM_EXPR_GE_R_D
: /* varA >= B */
2751 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2753 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2756 case ITM_EXPR_GE_R_R
: /* varA >= varB */
2758 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2760 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2763 case ITM_EXPR_GE_R_INVD
: /* varA >= in[B] */
2765 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2767 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2770 case ITM_EXPR_GE_INVD_E
: /* in[A] >= exprB */
2772 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2774 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2777 case ITM_EXPR_GE_INVD_D
: /* in[A] >= B */
2779 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2781 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2784 case ITM_EXPR_GE_INVD_R
: /* in[A] >= varB */
2786 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2788 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2791 case ITM_EXPR_GE_INVD_INVD
: /* in[A] >= in[B] */
2793 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2795 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2798 case ITM_EXPR_LT
: /* A < B */
2800 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2802 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2805 case ITM_EXPR_LT_E_D
: /* exprA < B */
2807 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2809 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2812 case ITM_EXPR_LT_E_R
: /* exprA < varB */
2814 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2816 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2819 case ITM_EXPR_LT_E_INVD
: /* exprA < in[B] */
2821 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2823 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2826 case ITM_EXPR_LT_D_E
: /* intA < exprB */
2828 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2830 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2833 case ITM_EXPR_LT_D_D
: /* intA < B */
2835 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2837 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2840 case ITM_EXPR_LT_D_R
: /* intA < varB */
2842 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2844 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2847 case ITM_EXPR_LT_D_INVD
: /* intA < in[B] */
2849 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2851 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2854 case ITM_EXPR_LT_R_E
: /* varA < exprB */
2856 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2858 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2861 case ITM_EXPR_LT_R_D
: /* varA < B */
2863 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2865 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2868 case ITM_EXPR_LT_R_R
: /* varA < varB */
2871 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2874 case ITM_EXPR_LT_R_INVD
: /* varA < in[B] */
2876 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2878 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2881 case ITM_EXPR_LT_INVD_E
: /* in[A] < exprB */
2883 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2885 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2888 case ITM_EXPR_LT_INVD_D
: /* in[A] < B */
2890 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2892 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2895 case ITM_EXPR_LT_INVD_R
: /* in[A] < varB */
2897 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2899 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2902 case ITM_EXPR_LT_INVD_INVD
: /* in[A] < in[B] */
2904 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2906 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2909 case ITM_EXPR_LE
: /* A <= B */
2911 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2913 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2916 case ITM_EXPR_LE_E_D
: /* exprA <= B */
2918 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2920 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2923 case ITM_EXPR_LE_E_R
: /* exprA <= varB */
2925 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2927 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2930 case ITM_EXPR_LE_E_INVD
: /* exprA <= in[B] */
2932 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
2934 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2937 case ITM_EXPR_LE_D_E
: /* intA <= exprB */
2939 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2941 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2944 case ITM_EXPR_LE_D_D
: /* intA <= B */
2946 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2948 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2951 case ITM_EXPR_LE_D_R
: /* intA <= varB */
2953 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2955 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
2958 case ITM_EXPR_LE_D_INVD
: /* intA <= in[B] */
2960 printi(0, "%ld", expr
->data
.operand
[0].itm_ptr
);
2962 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2965 case ITM_EXPR_LE_R_E
: /* varA <= exprB */
2967 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2969 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2972 case ITM_EXPR_LE_R_D
: /* varA <= B */
2974 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2976 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
2979 case ITM_EXPR_LE_R_R
: /* varA <= varB */
2982 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2985 case ITM_EXPR_LE_R_INVD
: /* varA <= in[B] */
2987 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[0]));
2989 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
2992 case ITM_EXPR_LE_INVD_E
: /* in[A] <= exprB */
2994 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
2996 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
2999 case ITM_EXPR_LE_INVD_D
: /* in[A] <= B */
3001 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
3003 printi(0, "%ld", expr
->data
.operand
[1].itm_ptr
);
3006 case ITM_EXPR_LE_INVD_R
: /* in[A] <= varB */
3008 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
3010 printi(0, "%s", reg_name(itm_hdr
, expr
->data
.operand
[1]));
3013 case ITM_EXPR_LE_INVD_INVD
: /* in[A] <= in[B] */
3015 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[0].itm_ptr
);
3017 printi(0, RNPREF
"in[%ld]", expr
->data
.operand
[1].itm_ptr
);
3020 case ITM_EXPR_NOT
: /* !A */
3023 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
3026 case ITM_EXPR_NEG
: /* ~A */
3029 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
3032 case ITM_EXPR_LOR
: /* A || B */
3034 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
3036 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
3039 case ITM_EXPR_LAND
: /* A && B */
3041 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
3043 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
3046 case ITM_EXPR_ASSIGN
: /* A = B */
3047 printi(0, "%s = ", reg_name(itm_hdr
, expr
->data
.operand
[0]));
3048 dump_expr(itm_hdr
, expr
->data
.operand
[1]);
3050 case ITM_EXPR_IN_EQ
: /* in == A */
3051 printi(0, "(" RNPREF
"in == ", 0);
3052 dump_expr(itm_hdr
, expr
->data
.operand
[0]);
3062 * Dump range (between)
3065 dump_range(itm_hdr_t
*itm_hdr
, itm_place_t range_place
)
3068 itm_range_hdr_t
*rtsh
;
3073 rth
= (itm_tbl_hdr_t
*)(ADDR(range_place
));
3074 rtsh
= (itm_range_hdr_t
*)(rth
+ 1);
3075 p
= (unsigned char *)(rtsh
+ 1);
3077 TRACE_MESSAGE('p', ("(&)between=%ld ", range_place
.itm_ptr
));
3078 printi(0, RNPREF
"between ");
3079 for (i
= 0; i
< rth
->number
; i
++) {
3080 if (0 != i
) printi(0, "\t ");
3082 for (j
= 0; j
< rtsh
->len
; j
++) {
3083 printi(0, "%02x", *(p
++));
3087 for (j
= 0; j
< rtsh
->len
; j
++) {
3088 printi(0, "%02x", *(p
++));
3090 if (i
< (rth
->number
- 1)) {
3100 * Dump escape sequence
3103 dump_escapeseq(itm_hdr_t
*itm_hdr
, itm_place_t escapeseq_place
)
3106 itm_escapeseq_hdr_t
*eh
;
3113 eth
= (itm_tbl_hdr_t
*)(ADDR(escapeseq_place
));
3114 eh
= (itm_escapeseq_hdr_t
*)(eth
+ 1);
3115 d
= (itm_data_t
*)(eh
+ 1);
3116 TRACE_MESSAGE('p', ("(&)escseq=%ld ", escapeseq_place
.itm_ptr
));
3117 printi(1, RNPREF
"escapceseq {");
3119 for (i
= 0; i
< eth
->number
; i
++, d
++) {
3120 if (0 != i
) printi(0, " ");
3122 if ((sizeof (itm_place_t
)) < data
.size
) {
3123 data
.place
.itm_ptr
= (itm_place2_t
)ADDR(d
->place
);
3125 printi(0, "0x%s;", data_to_hexadecimal(&data
));
3132 printi(int c
, char *format
, ...)
3134 static int indent_level
;
3135 static int new_line
= 1;
3138 va_start(ap
, format
);
3142 if (indent_level
< 0) {
3147 for (i
= indent_level
; 0 < i
; i
-= 1) {
3148 (void) putchar('\t');
3153 if (indent_level
< 0) {
3158 if (NULL
== strchr(format
, '\n')) {
3164 (void) vfprintf(stdout
, format
, ap
);
3171 name_place_to_str(itm_hdr_t
*itm_hdr
, itm_place2_t place
)
3176 d
= *((itm_data_t
*)ADDR2(place
));
3177 if ((sizeof (itm_place_t
)) < d
.size
) {
3178 d
.place
.itm_ptr
= (itm_place2_t
)ADDR(d
.place
);
3182 d
.place
.itm_ptr
= 0;
3184 return (name_to_str(&d
));
3188 tbl_name(itm_hdr_t
*itm_hdr
, itm_tbl_hdr_t
*tbl_hdr
)
3190 if (ITM_TBL_OP_INIT
== tbl_hdr
->type
) {
3191 return (RNPREF
"init");
3192 } else if (ITM_TBL_OP_RESET
== tbl_hdr
->type
) {
3193 return (RNPREF
"reset");
3194 } else if (tbl_hdr
->name
.itm_ptr
) {
3195 return (name_place_to_str(itm_hdr
, tbl_hdr
->name
.itm_ptr
));
3203 reg_name(itm_hdr_t
*itm_hdr
, itm_place_t op
)
3205 itm_info_hdr_t
*info_hdr
;
3206 static char sbuf
[32];
3209 reg_num
= (itm_num_t
)(op
.itm_ptr
);
3210 if (0 == itm_hdr
->info_hdr
.itm_ptr
) {
3211 (void) sprintf(sbuf
, "reg%ld\n", reg_num
);
3214 info_hdr
= INFO_HDR(itm_hdr
);
3215 return (name_place_to_str(
3217 info_hdr
->reg_plc_tbl
.place
.itm_ptr
+
3218 (reg_num
*sizeof (itm_data_t
))));
3223 itm_attach(const char *itm_file
)
3229 fd
= open(itm_file
, O_RDONLY
, 0);
3231 PERROR(gettext("open()"));
3235 if (fstat(fd
, &st
) == -1) {
3236 PERROR(gettext("fstat()"));
3239 itm_hdr
= (void *) mmap(NULL
, st
.st_size
,
3240 PROT_READ
, MAP_SHARED
, fd
, 0);
3241 if (MAP_FAILED
== itm_hdr
) {
3242 PERROR(gettext("mmap()"));
3248 if ((itm_hdr
->ident
[0] != ITM_IDENT_0
) ||
3249 (itm_hdr
->ident
[1] != ITM_IDENT_1
) ||
3250 (itm_hdr
->ident
[2] != ITM_IDENT_2
) ||
3251 (itm_hdr
->ident
[3] != ITM_IDENT_3
)) {
3252 itm_error(gettext("magic number error\n"));
3255 if ((itm_hdr
->version
[0] != ITM_VER_0
) ||
3256 (itm_hdr
->version
[1] != ITM_VER_1
) ||
3257 (itm_hdr
->version
[2] != ITM_VER_2
) ||
3258 #if defined(_LITTLE_ENDIAN)
3260 ((itm_hdr
->spec
[3] != ITM_SPEC_3_32_LITTLE_ENDIAN
) &&
3261 (itm_hdr
->spec
[3] != ITM_SPEC_3_64_LITTLE_ENDIAN
))) {
3263 (itm_hdr
->spec
[3] != ITM_SPEC_3_32_LITTLE_ENDIAN
)) {
3267 ((itm_hdr
->spec
[3] != ITM_SPEC_3_32_BIG_ENDIAN
) &&
3268 (itm_hdr
->spec
[3] != ITM_SPEC_3_64_BIG_ENDIAN
))) {
3270 (itm_hdr
->spec
[3] != ITM_SPEC_3_32_BIG_ENDIAN
)) {
3273 itm_error(gettext("version number error\n"));
3276 if (itm_hdr
->itm_size
.itm_ptr
!= st
.st_size
) {
3278 "size error: expected=%1$d current=%2$d\n"),
3279 (size_t)(itm_hdr
->itm_size
.itm_ptr
), st
.st_size
);