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