ir_defs.c revision b32f58018498ea2225959b0ba11c18f0c433deef
1ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- begin                                         ir_defs.c ---*/
4ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
5ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
6ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*
7ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   This file is part of Valgrind, a dynamic binary instrumentation
8ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   framework.
9ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
10b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   Copyright (C) 2004-2011 OpenWorks LLP
11ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      info@open-works.net
12ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
13ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   This program is free software; you can redistribute it and/or
14ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   modify it under the terms of the GNU General Public License as
15ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   published by the Free Software Foundation; either version 2 of the
16ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   License, or (at your option) any later version.
17ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
18ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   This program is distributed in the hope that it will be useful, but
19ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   WITHOUT ANY WARRANTY; without even the implied warranty of
20ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   General Public License for more details.
22ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
23ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   You should have received a copy of the GNU General Public License
24ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   along with this program; if not, write to the Free Software
25ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   02110-1301, USA.
27ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
28ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   The GNU General Public License is contained in the file COPYING.
29ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
30ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Neither the names of the U.S. Department of Energy nor the
31ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   University of California nor the names of its contributors may be
32ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   used to endorse or promote products derived from this software
33ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   without prior written permission.
34ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown*/
35ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
36ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#include "libvex_basictypes.h"
37ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#include "libvex_ir.h"
38ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#include "libvex.h"
39ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
40ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#include "main_util.h"
41ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
42ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
43ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
44ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Printing the IR                                         ---*/
45ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
46ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
47ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRType ( IRType ty )
48ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
49ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (ty) {
50ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_INVALID: vex_printf("Ity_INVALID"); break;
51ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I1:      vex_printf( "I1");   break;
52ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I8:      vex_printf( "I8");   break;
53ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I16:     vex_printf( "I16");  break;
54ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I32:     vex_printf( "I32");  break;
55ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I64:     vex_printf( "I64");  break;
56ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I128:    vex_printf( "I128"); break;
57ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_F32:     vex_printf( "F32");  break;
58ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_F64:     vex_printf( "F64");  break;
59b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ity_F128:    vex_printf( "F128"); break;
60ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_V128:    vex_printf( "V128"); break;
61ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vex_printf("ty = 0x%x\n", (Int)ty);
62ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               vpanic("ppIRType");
63ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
64ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
65ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
66ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRConst ( IRConst* con )
67ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
68b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   union { ULong i64; Double f64; UInt i32; Float f32; } u;
69ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(sizeof(ULong) == sizeof(Double));
70ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (con->tag) {
71ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:   vex_printf( "%d:I1",        con->Ico.U1 ? 1 : 0); break;
72ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:   vex_printf( "0x%x:I8",      (UInt)(con->Ico.U8)); break;
73ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16:  vex_printf( "0x%x:I16",     (UInt)(con->Ico.U16)); break;
74ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32:  vex_printf( "0x%x:I32",     (UInt)(con->Ico.U32)); break;
75ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64:  vex_printf( "0x%llx:I64",   (ULong)(con->Ico.U64)); break;
76b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32:  u.f32 = con->Ico.F32;
77b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     vex_printf( "F32{0x%x}",   u.i32);
78b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     break;
79b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i: vex_printf( "F32i{0x%x}",   con->Ico.F32i); break;
80ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64:  u.f64 = con->Ico.F64;
81ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                     vex_printf( "F64{0x%llx}",  u.i64);
82ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                     break;
83ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i: vex_printf( "F64i{0x%llx}", con->Ico.F64i); break;
84ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128: vex_printf( "V128{0x%04x}", (UInt)(con->Ico.V128)); break;
85ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIRConst");
86ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
87ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
88ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
89ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRCallee ( IRCallee* ce )
90ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
91ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("%s", ce->name);
92ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (ce->regparms > 0)
93ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("[rp=%d]", ce->regparms);
94ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (ce->mcx_mask > 0)
95ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("[mcx=0x%x]", ce->mcx_mask);
96ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("{%p}", (void*)ce->addr);
97ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
98ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
99ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRRegArray ( IRRegArray* arr )
100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("(%d:%dx", arr->base, arr->nElems);
102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRType(arr->elemTy);
103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(")");
104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRTemp ( IRTemp tmp )
107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (tmp == IRTemp_INVALID)
109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("IRTemp_INVALID");
110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   else
111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "t%d", (Int)tmp);
112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIROp ( IROp op )
115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   HChar* str = NULL;
117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IROp   base;
118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (op) {
119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8 ... Iop_Add64:
120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Add"; base = Iop_Add8; break;
121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8 ... Iop_Sub64:
122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Sub"; base = Iop_Sub8; break;
123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8 ... Iop_Mul64:
124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Mul"; base = Iop_Mul8; break;
125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or8 ... Iop_Or64:
126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Or"; base = Iop_Or8; break;
127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_And8 ... Iop_And64:
128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "And"; base = Iop_And8; break;
129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Xor8 ... Iop_Xor64:
130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Xor"; base = Iop_Xor8; break;
131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8 ... Iop_Shl64:
132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Shl"; base = Iop_Shl8; break;
133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8 ... Iop_Shr64:
134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Shr"; base = Iop_Shr8; break;
135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8 ... Iop_Sar64:
136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Sar"; base = Iop_Sar8; break;
137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8 ... Iop_CmpEQ64:
138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CmpEQ"; base = Iop_CmpEQ8; break;
139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNE8 ... Iop_CmpNE64:
140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CmpNE"; base = Iop_CmpNE8; break;
141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ8 ... Iop_CasCmpEQ64:
142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CasCmpEQ"; base = Iop_CasCmpEQ8; break;
143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpNE8 ... Iop_CasCmpNE64:
144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CasCmpNE"; base = Iop_CasCmpNE8; break;
145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not8 ... Iop_Not64:
146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Not"; base = Iop_Not8; break;
147ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* other cases must explicitly "return;" */
148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto16:   vex_printf("8Uto16");  return;
149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto32:   vex_printf("8Uto32");  return;
150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto32:  vex_printf("16Uto32"); return;
151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Sto16:   vex_printf("8Sto16");  return;
152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Sto32:   vex_printf("8Sto32");  return;
153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Sto32:  vex_printf("16Sto32"); return;
154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32Sto64:  vex_printf("32Sto64"); return;
155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32Uto64:  vex_printf("32Uto64"); return;
156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to8:    vex_printf("32to8");   return;
157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto64:  vex_printf("16Uto64"); return;
158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Sto64:  vex_printf("16Sto64"); return;
159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto64:   vex_printf("8Uto64"); return;
160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Sto64:   vex_printf("8Sto64"); return;
161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to16:   vex_printf("64to16"); return;
162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to8:    vex_printf("64to8");  return;
163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not1:     vex_printf("Not1");    return;
165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to1:    vex_printf("32to1");   return;
166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to1:    vex_printf("64to1");   return;
167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto8:    vex_printf("1Uto8");   return;
168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto32:   vex_printf("1Uto32");  return;
169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto64:   vex_printf("1Uto64");  return;
170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto8:    vex_printf("1Sto8");  return;
171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto16:   vex_printf("1Sto16");  return;
172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto32:   vex_printf("1Sto32");  return;
173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto64:   vex_printf("1Sto64");  return;
174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS8:   vex_printf("MullS8");  return;
176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS16:  vex_printf("MullS16"); return;
177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS32:  vex_printf("MullS32"); return;
178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS64:  vex_printf("MullS64"); return;
179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU8:   vex_printf("MullU8");  return;
180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU16:  vex_printf("MullU16"); return;
181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU32:  vex_printf("MullU32"); return;
182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU64:  vex_printf("MullU64"); return;
183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz64:    vex_printf("Clz64"); return;
185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32:    vex_printf("Clz32"); return;
186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Ctz64:    vex_printf("Ctz64"); return;
187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Ctz32:    vex_printf("Ctz32"); return;
188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32S: vex_printf("CmpLT32S"); return;
190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32S: vex_printf("CmpLE32S"); return;
191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32U: vex_printf("CmpLT32U"); return;
192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32U: vex_printf("CmpLE32U"); return;
193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64S: vex_printf("CmpLT64S"); return;
195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64S: vex_printf("CmpLE64S"); return;
196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64U: vex_printf("CmpLT64U"); return;
197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64U: vex_printf("CmpLE64U"); return;
198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8:  vex_printf("CmpNEZ8"); return;
200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16: vex_printf("CmpNEZ16"); return;
201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32: vex_printf("CmpNEZ32"); return;
202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ64: vex_printf("CmpNEZ64"); return;
203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
204ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ32: vex_printf("CmpwNEZ32"); return;
205ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ64: vex_printf("CmpwNEZ64"); return;
206ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
207ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left8:  vex_printf("Left8"); return;
208ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left16: vex_printf("Left16"); return;
209ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left32: vex_printf("Left32"); return;
210ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left64: vex_printf("Left64"); return;
211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32U: vex_printf("Max32U"); return;
212ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
213ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32U: vex_printf("CmpORD32U"); return;
214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32S: vex_printf("CmpORD32S"); return;
215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64U: vex_printf("CmpORD64U"); return;
217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64S: vex_printf("CmpORD64S"); return;
218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivU32: vex_printf("DivU32"); return;
220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivS32: vex_printf("DivS32"); return;
221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivU64: vex_printf("DivU64"); return;
222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivS64: vex_printf("DivS64"); return;
223b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU64E: vex_printf("DivU64E"); return;
224b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivS64E: vex_printf("DivS64E"); return;
225b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU32E: vex_printf("DivU32E"); return;
226b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivS32E: vex_printf("DivS32E"); return;
227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU64to32: vex_printf("DivModU64to32"); return;
229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModS64to32: vex_printf("DivModS64to32"); return;
230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU128to64: vex_printf("DivModU128to64"); return;
232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModS128to64: vex_printf("DivModS128to64"); return;
233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
234b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivModS64to64: vex_printf("DivModS64to64"); return;
235b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HIto8:  vex_printf("16HIto8"); return;
237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16to8:    vex_printf("16to8");   return;
238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8HLto16:  vex_printf("8HLto16"); return;
239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HIto16: vex_printf("32HIto16"); return;
241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to16:   vex_printf("32to16");   return;
242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HLto32: vex_printf("16HLto32"); return;
243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HIto32: vex_printf("64HIto32"); return;
245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to32:   vex_printf("64to32");   return;
246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HLto64: vex_printf("32HLto64"); return;
247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_128HIto64: vex_printf("128HIto64"); return;
249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_128to64:   vex_printf("128to64");   return;
250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HLto128: vex_printf("64HLto128"); return;
251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
252b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF32:    vex_printf("CmpF32");    return;
253b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI16S: vex_printf("F32toI16S");  return;
254b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI32S: vex_printf("F32toI32S");  return;
255b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI64S: vex_printf("F32toI64S");  return;
256b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I16StoF32: vex_printf("I16StoF32");  return;
257b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF32: vex_printf("I32StoF32");  return;
258b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF32: vex_printf("I64StoF32");  return;
259b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
260ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64:    vex_printf("AddF64"); return;
261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SubF64:    vex_printf("SubF64"); return;
262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64:    vex_printf("MulF64"); return;
263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivF64:    vex_printf("DivF64"); return;
264ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64r32: vex_printf("AddF64r32"); return;
265ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SubF64r32: vex_printf("SubF64r32"); return;
266ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64r32: vex_printf("MulF64r32"); return;
267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivF64r32: vex_printf("DivF64r32"); return;
268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF32:    vex_printf("AddF32"); return;
269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SubF32:    vex_printf("SubF32"); return;
270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF32:    vex_printf("MulF32"); return;
271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivF32:    vex_printf("DivF32"); return;
272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
273b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        /* 128 bit floating point */
274b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AddF128:   vex_printf("AddF128");  return;
275b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SubF128:   vex_printf("SubF128");  return;
276b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MulF128:   vex_printf("MulF128");  return;
277b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivF128:   vex_printf("DivF128");  return;
278b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AbsF128:   vex_printf("AbsF128");  return;
279b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NegF128:   vex_printf("NegF128");  return;
280b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SqrtF128:  vex_printf("SqrtF128"); return;
281b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF128:   vex_printf("CmpF128");  return;
282b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
283b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64HLtoF128: vex_printf("F64HLtoF128"); return;
284b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128HItoF64: vex_printf("F128HItoF64"); return;
285b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128LOtoF64: vex_printf("F128LOtoF64"); return;
286b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF128: vex_printf("I32StoF128"); return;
287b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF128: vex_printf("I64StoF128"); return;
288b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI32S: vex_printf("F128toI32S"); return;
289b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI64S: vex_printf("F128toI64S"); return;
290b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toF128:  vex_printf("F32toF128");  return;
291b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toF128:  vex_printf("F64toF128");  return;
292b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF64:  vex_printf("F128toF64");  return;
293b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF32:  vex_printf("F128toF32");  return;
294b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
295b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        /* s390 specific */
296b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MAddF32:    vex_printf("s390_MAddF32"); return;
297b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MSubF32:    vex_printf("s390_MSubF32"); return;
298b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
299ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ScaleF64:      vex_printf("ScaleF64"); return;
300ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AtanF64:       vex_printf("AtanF64"); return;
301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Yl2xF64:       vex_printf("Yl2xF64"); return;
302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Yl2xp1F64:     vex_printf("Yl2xp1F64"); return;
303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRemF64:       vex_printf("PRemF64"); return;
304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRemC3210F64:  vex_printf("PRemC3210F64"); return;
305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRem1F64:      vex_printf("PRem1F64"); return;
306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRem1C3210F64: vex_printf("PRem1C3210F64"); return;
307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF64:        vex_printf("NegF64"); return;
308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AbsF64:        vex_printf("AbsF64"); return;
309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF32:        vex_printf("NegF32"); return;
310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AbsF32:        vex_printf("AbsF32"); return;
311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF64:       vex_printf("SqrtF64"); return;
312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF32:       vex_printf("SqrtF32"); return;
313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SinF64:    vex_printf("SinF64"); return;
314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CosF64:    vex_printf("CosF64"); return;
315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_TanF64:    vex_printf("TanF64"); return;
316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_2xm1F64:   vex_printf("2xm1F64"); return;
317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64:    vex_printf("MAddF64"); return;
319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MSubF64:    vex_printf("MSubF64"); return;
320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64r32: vex_printf("MAddF64r32"); return;
321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MSubF64r32: vex_printf("MSubF64r32"); return;
322ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
323ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Est5FRSqrt:    vex_printf("Est5FRSqrt"); return;
324ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_NEAREST: vex_printf("RoundF64toF64_NEAREST"); return;
325ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_NegINF: vex_printf("RoundF64toF64_NegINF"); return;
326ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_PosINF: vex_printf("RoundF64toF64_PosINF"); return;
327ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_ZERO: vex_printf("RoundF64toF64_ZERO"); return;
328ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
329ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_TruncF64asF32: vex_printf("TruncF64asF32"); return;
330ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CalcFPRF:      vex_printf("CalcFPRF"); return;
331ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
332ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x2:   vex_printf("Add16x2"); return;
333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub16x2:   vex_printf("Sub16x2"); return;
334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx2: vex_printf("QAdd16Sx2"); return;
335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Ux2: vex_printf("QAdd16Ux2"); return;
336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx2: vex_printf("QSub16Sx2"); return;
337ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Ux2: vex_printf("QSub16Ux2"); return;
338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd16Ux2: vex_printf("HAdd16Ux2"); return;
339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd16Sx2: vex_printf("HAdd16Sx2"); return;
340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub16Ux2: vex_printf("HSub16Ux2"); return;
341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub16Sx2: vex_printf("HSub16Sx2"); return;
342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x4:   vex_printf("Add8x4"); return;
344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x4:   vex_printf("Sub8x4"); return;
345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx4: vex_printf("QAdd8Sx4"); return;
346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux4: vex_printf("QAdd8Ux4"); return;
347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx4: vex_printf("QSub8Sx4"); return;
348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux4: vex_printf("QSub8Ux4"); return;
349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd8Ux4: vex_printf("HAdd8Ux4"); return;
350ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd8Sx4: vex_printf("HAdd8Sx4"); return;
351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub8Ux4: vex_printf("HSub8Ux4"); return;
352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub8Sx4: vex_printf("HSub8Sx4"); return;
353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sad8Ux4:  vex_printf("Sad8Ux4"); return;
354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x2: vex_printf("CmpNEZ16x2"); return;
356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x4:  vex_printf("CmpNEZ8x4"); return;
357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpF64:    vex_printf("CmpF64"); return;
359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI16S: vex_printf("F64toI16S"); return;
361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32S: vex_printf("F64toI32S"); return;
362ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI64S: vex_printf("F64toI64S"); return;
363b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toI64U: vex_printf("F64toI64U"); return;
364ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
365ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32U: vex_printf("F64toI32U"); return;
366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I16StoF64: vex_printf("I16StoF64"); return;
368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoF64: vex_printf("I32StoF64"); return;
369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I64StoF64: vex_printf("I64StoF64"); return;
370b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF64: vex_printf("I64UtoF64"); return;
371b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF32: vex_printf("I64UtoF32"); return;
372ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoF64: vex_printf("I32UtoF64"); return;
374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF64: vex_printf("F32toF64"); return;
376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toF32: vex_printf("F64toF32"); return;
377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toInt: vex_printf("RoundF64toInt"); return;
379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32toInt: vex_printf("RoundF32toInt"); return;
380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF32: vex_printf("RoundF64toF32"); return;
381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF64asI64: vex_printf("ReinterpF64asI64"); return;
383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI64asF64: vex_printf("ReinterpI64asF64"); return;
384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF32asI32: vex_printf("ReinterpF32asI32"); return;
385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI32asF32: vex_printf("ReinterpI32asF32"); return;
386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoFx4: vex_printf("I32UtoFx4"); return;
388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx4: vex_printf("I32StoFx4"); return;
389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF16x4: vex_printf("F32toF16x4"); return;
391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F16toF32x4: vex_printf("F16toF32x4"); return;
392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx4: vex_printf("VRsqrte32Fx4"); return;
394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x4:  vex_printf("VRsqrte32x4"); return;
395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx2: vex_printf("VRsqrte32Fx2"); return;
396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x2:  vex_printf("VRsqrte32x2"); return;
397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Ux4_RZ: vex_printf("QFtoI32Ux4_RZ"); return;
399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Sx4_RZ: vex_printf("QFtoI32Sx4_RZ"); return;
400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Ux4_RZ: vex_printf("FtoI32Ux4_RZ"); return;
402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx4_RZ: vex_printf("FtoI32Sx4_RZ"); return;
403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoFx2: vex_printf("I32UtoFx2"); return;
405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx2: vex_printf("I32StoFx2"); return;
406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Ux2_RZ: vex_printf("FtoI32Ux2_RZ"); return;
408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx2_RZ: vex_printf("FtoI32Sx2_RZ"); return;
409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RM: vex_printf("RoundF32x4_RM"); return;
411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RP: vex_printf("RoundF32x4_RP"); return;
412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RN: vex_printf("RoundF32x4_RN"); return;
413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RZ: vex_printf("RoundF32x4_RZ"); return;
414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x8: vex_printf("Abs8x8"); return;
416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs16x4: vex_printf("Abs16x4"); return;
417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32x2: vex_printf("Abs32x2"); return;
418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x8: vex_printf("Add8x8"); return;
419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x4: vex_printf("Add16x4"); return;
420ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32x2: vex_printf("Add32x2"); return;
421ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux8: vex_printf("QAdd8Ux8"); return;
422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Ux4: vex_printf("QAdd16Ux4"); return;
423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux2: vex_printf("QAdd32Ux2"); return;
424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Ux1: vex_printf("QAdd64Ux1"); return;
425ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx8: vex_printf("QAdd8Sx8"); return;
426ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx4: vex_printf("QAdd16Sx4"); return;
427ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx2: vex_printf("QAdd32Sx2"); return;
428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Sx1: vex_printf("QAdd64Sx1"); return;
429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x8: vex_printf("PwAdd8x8"); return;
430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd16x4: vex_printf("PwAdd16x4"); return;
431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32x2: vex_printf("PwAdd32x2"); return;
432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32Fx2: vex_printf("PwAdd32Fx2"); return;
433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux8: vex_printf("PwAddL8Ux8"); return;
434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Ux4: vex_printf("PwAddL16Ux4"); return;
435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Ux2: vex_printf("PwAddL32Ux2"); return;
436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx8: vex_printf("PwAddL8Sx8"); return;
437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Sx4: vex_printf("PwAddL16Sx4"); return;
438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Sx2: vex_printf("PwAddL32Sx2"); return;
439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x8: vex_printf("Sub8x8"); return;
440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub16x4: vex_printf("Sub16x4"); return;
441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32x2: vex_printf("Sub32x2"); return;
442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux8: vex_printf("QSub8Ux8"); return;
443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Ux4: vex_printf("QSub16Ux4"); return;
444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux2: vex_printf("QSub32Ux2"); return;
445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Ux1: vex_printf("QSub64Ux1"); return;
446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx8: vex_printf("QSub8Sx8"); return;
447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx4: vex_printf("QSub16Sx4"); return;
448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx2: vex_printf("QSub32Sx2"); return;
449ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Sx1: vex_printf("QSub64Sx1"); return;
450ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x8: vex_printf("Mul8x8"); return;
451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul16x4: vex_printf("Mul16x4"); return;
452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32x2: vex_printf("Mul32x2"); return;
453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx2: vex_printf("Mul32Fx2"); return;
454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x8: vex_printf("PolynomialMul8x8"); return;
455ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Ux4: vex_printf("MulHi16Ux4"); return;
456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx4: vex_printf("MulHi16Sx4"); return;
457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx4: vex_printf("QDMulHi16Sx4"); return;
458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi32Sx2: vex_printf("QDMulHi32Sx2"); return;
459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx4: vex_printf("QRDMulHi16Sx4"); return;
460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi32Sx2: vex_printf("QRDMulHi32Sx2"); return;
461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulLong16Sx4: vex_printf("QDMulLong16Sx4"); return;
462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulLong32Sx2: vex_printf("QDMulLong32Sx2"); return;
463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux8: vex_printf("Avg8Ux8"); return;
464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg16Ux4: vex_printf("Avg16Ux4"); return;
465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx8: vex_printf("Max8Sx8"); return;
466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Sx4: vex_printf("Max16Sx4"); return;
467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Sx2: vex_printf("Max32Sx2"); return;
468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux8: vex_printf("Max8Ux8"); return;
469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Ux4: vex_printf("Max16Ux4"); return;
470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Ux2: vex_printf("Max32Ux2"); return;
471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx8: vex_printf("Min8Sx8"); return;
472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Sx4: vex_printf("Min16Sx4"); return;
473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Sx2: vex_printf("Min32Sx2"); return;
474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux8: vex_printf("Min8Ux8"); return;
475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Ux4: vex_printf("Min16Ux4"); return;
476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Ux2: vex_printf("Min32Ux2"); return;
477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Sx8: vex_printf("PwMax8Sx8"); return;
478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax16Sx4: vex_printf("PwMax16Sx4"); return;
479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Sx2: vex_printf("PwMax32Sx2"); return;
480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Ux8: vex_printf("PwMax8Ux8"); return;
481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax16Ux4: vex_printf("PwMax16Ux4"); return;
482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Ux2: vex_printf("PwMax32Ux2"); return;
483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Sx8: vex_printf("PwMin8Sx8"); return;
484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin16Sx4: vex_printf("PwMin16Sx4"); return;
485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Sx2: vex_printf("PwMin32Sx2"); return;
486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Ux8: vex_printf("PwMin8Ux8"); return;
487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin16Ux4: vex_printf("PwMin16Ux4"); return;
488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Ux2: vex_printf("PwMin32Ux2"); return;
489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x8: vex_printf("CmpEQ8x8"); return;
490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ16x4: vex_printf("CmpEQ16x4"); return;
491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32x2: vex_printf("CmpEQ32x2"); return;
492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux8: vex_printf("CmpGT8Ux8"); return;
493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Ux4: vex_printf("CmpGT16Ux4"); return;
494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Ux2: vex_printf("CmpGT32Ux2"); return;
495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx8: vex_printf("CmpGT8Sx8"); return;
496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Sx4: vex_printf("CmpGT16Sx4"); return;
497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Sx2: vex_printf("CmpGT32Sx2"); return;
498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x8: vex_printf("Cnt8x8"); return;
499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx8: vex_printf("Clz8Sx8"); return;
500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz16Sx4: vex_printf("Clz16Sx4"); return;
501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32Sx2: vex_printf("Clz32Sx2"); return;
502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx8: vex_printf("Cls8Sx8"); return;
503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls16Sx4: vex_printf("Cls16Sx4"); return;
504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls32Sx2: vex_printf("Cls32Sx2"); return;
505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN8x8: vex_printf("ShlN8x8"); return;
506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN16x4: vex_printf("ShlN16x4"); return;
507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x2: vex_printf("ShlN32x2"); return;
508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN8x8: vex_printf("ShrN8x8"); return;
509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN16x4: vex_printf("ShrN16x4"); return;
510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x2: vex_printf("ShrN32x2"); return;
511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN8x8: vex_printf("SarN8x8"); return;
512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN16x4: vex_printf("SarN16x4"); return;
513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x2: vex_printf("SarN32x2"); return;
514b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Ux8: vex_printf("QNarrowBin16Sto8Ux8"); return;
515b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx8: vex_printf("QNarrowBin16Sto8Sx8"); return;
516b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Sx4: vex_printf("QNarrowBin32Sto16Sx4"); return;
517b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x8: vex_printf("NarrowBin16to8x8"); return;
518b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin32to16x4: vex_printf("NarrowBin32to16x4"); return;
519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x8: vex_printf("InterleaveHI8x8"); return;
520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI16x4: vex_printf("InterleaveHI16x4"); return;
521ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x2: vex_printf("InterleaveHI32x2"); return;
522ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO8x8: vex_printf("InterleaveLO8x8"); return;
523ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO16x4: vex_printf("InterleaveLO16x4"); return;
524ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO32x2: vex_printf("InterleaveLO32x2"); return;
525ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x8: vex_printf("CatOddLanes8x8"); return;
526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x4: vex_printf("CatOddLanes16x4"); return;
527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes8x8: vex_printf("CatEvenLanes8x8"); return;
528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes16x4: vex_printf("CatEvenLanes16x4"); return;
529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x8: vex_printf("InterleaveOddLanes8x8"); return;
530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x4: vex_printf("InterleaveOddLanes16x4"); return;
531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes8x8: vex_printf("InterleaveEvenLanes8x8"); return;
532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes16x4: vex_printf("InterleaveEvenLanes16x4"); return;
533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x8: vex_printf("Shl8x8"); return;
534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl16x4: vex_printf("Shl16x4"); return;
535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl32x2: vex_printf("Shl32x2"); return;
536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x8: vex_printf("Shr8x8"); return;
537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr16x4: vex_printf("Shr16x4"); return;
538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr32x2: vex_printf("Shr32x2"); return;
539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl8x8: vex_printf("QShl8x8"); return;
540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl16x4: vex_printf("QShl16x4"); return;
541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl32x2: vex_printf("QShl32x2"); return;
542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl64x1: vex_printf("QShl64x1"); return;
543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal8x8: vex_printf("QSal8x8"); return;
544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal16x4: vex_printf("QSal16x4"); return;
545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal32x2: vex_printf("QSal32x2"); return;
546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal64x1: vex_printf("QSal64x1"); return;
547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x8: vex_printf("QShlN8x8"); return;
548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16x4: vex_printf("QShlN16x4"); return;
549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x2: vex_printf("QShlN32x2"); return;
550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64x1: vex_printf("QShlN64x1"); return;
551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx8: vex_printf("QShlN8Sx8"); return;
552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16Sx4: vex_printf("QShlN16Sx4"); return;
553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx2: vex_printf("QShlN32Sx2"); return;
554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64Sx1: vex_printf("QShlN64Sx1"); return;
555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x8: vex_printf("QSalN8x8"); return;
556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN16x4: vex_printf("QSalN16x4"); return;
557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x2: vex_printf("QSalN32x2"); return;
558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN64x1: vex_printf("QSalN64x1"); return;
559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x8: vex_printf("Sar8x8"); return;
560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar16x4: vex_printf("Sar16x4"); return;
561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar32x2: vex_printf("Sar32x2"); return;
562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x8: vex_printf("Sal8x8"); return;
563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal16x4: vex_printf("Sal16x4"); return;
564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal32x2: vex_printf("Sal32x2"); return;
565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal64x1: vex_printf("Sal64x1"); return;
566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x8: vex_printf("Perm8x8"); return;
567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x8: vex_printf("Reverse16_8x8"); return;
568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x8: vex_printf("Reverse32_8x8"); return;
569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_16x4: vex_printf("Reverse32_16x4"); return;
570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x8: vex_printf("Reverse64_8x8"); return;
571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_16x4: vex_printf("Reverse64_16x4"); return;
572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_32x2: vex_printf("Reverse64_32x2"); return;
573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx2: vex_printf("Abs32Fx2"); return;
574ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x2: vex_printf("CmpNEZ32x2"); return;
576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x4: vex_printf("CmpNEZ16x4"); return;
577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x8:  vex_printf("CmpNEZ8x8"); return;
578ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
579ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx4:  vex_printf("Add32Fx4"); return;
580ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx2:  vex_printf("Add32Fx2"); return;
581ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32F0x4: vex_printf("Add32F0x4"); return;
582ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64Fx2:  vex_printf("Add64Fx2"); return;
583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64F0x2: vex_printf("Add64F0x2"); return;
584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div32Fx4:  vex_printf("Div32Fx4"); return;
586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div32F0x4: vex_printf("Div32F0x4"); return;
587ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div64Fx2:  vex_printf("Div64Fx2"); return;
588ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div64F0x2: vex_printf("Div64F0x2"); return;
589ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
590ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx4:  vex_printf("Max32Fx4"); return;
591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx2:  vex_printf("Max32Fx2"); return;
592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx4:  vex_printf("PwMax32Fx4"); return;
593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx2:  vex_printf("PwMax32Fx2"); return;
594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32F0x4: vex_printf("Max32F0x4"); return;
595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max64Fx2:  vex_printf("Max64Fx2"); return;
596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max64F0x2: vex_printf("Max64F0x2"); return;
597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Fx4:  vex_printf("Min32Fx4"); return;
599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Fx2:  vex_printf("Min32Fx2"); return;
600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Fx4:  vex_printf("PwMin32Fx4"); return;
601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Fx2:  vex_printf("PwMin32Fx2"); return;
602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32F0x4: vex_printf("Min32F0x4"); return;
603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min64Fx2:  vex_printf("Min64Fx2"); return;
604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min64F0x2: vex_printf("Min64F0x2"); return;
605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx4:  vex_printf("Mul32Fx4"); return;
607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32F0x4: vex_printf("Mul32F0x4"); return;
608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul64Fx2:  vex_printf("Mul64Fx2"); return;
609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul64F0x2: vex_printf("Mul64F0x2"); return;
610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x2: vex_printf("Recip32x2"); return;
612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32Fx2:  vex_printf("Recip32Fx2"); return;
613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32Fx4:  vex_printf("Recip32Fx4"); return;
614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x4:  vex_printf("Recip32x4"); return;
615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32F0x4: vex_printf("Recip32F0x4"); return;
616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip64Fx2:  vex_printf("Recip64Fx2"); return;
617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip64F0x2: vex_printf("Recip64F0x2"); return;
618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx2:  vex_printf("VRecps32Fx2"); return;
619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx4:  vex_printf("VRecps32Fx4"); return;
620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx4:  vex_printf("Abs32Fx4"); return;
621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx4:  vex_printf("VRsqrts32Fx4"); return;
622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx2:  vex_printf("VRsqrts32Fx2"); return;
623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt32Fx4:  vex_printf("RSqrt32Fx4"); return;
625ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt32F0x4: vex_printf("RSqrt32F0x4"); return;
626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt64Fx2:  vex_printf("RSqrt64Fx2"); return;
627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt64F0x2: vex_printf("RSqrt64F0x2"); return;
628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt32Fx4:  vex_printf("Sqrt32Fx4"); return;
630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt32F0x4: vex_printf("Sqrt32F0x4"); return;
631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt64Fx2:  vex_printf("Sqrt64Fx2"); return;
632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt64F0x2: vex_printf("Sqrt64F0x2"); return;
633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32Fx4:  vex_printf("Sub32Fx4"); return;
635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32Fx2:  vex_printf("Sub32Fx2"); return;
636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32F0x4: vex_printf("Sub32F0x4"); return;
637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64Fx2:  vex_printf("Sub64Fx2"); return;
638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64F0x2: vex_printf("Sub64F0x2"); return;
639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32Fx4: vex_printf("CmpEQ32Fx4"); return;
641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32Fx4: vex_printf("CmpLT32Fx4"); return;
642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32Fx4: vex_printf("CmpLE32Fx4"); return;
643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx4: vex_printf("CmpGT32Fx4"); return;
644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGE32Fx4: vex_printf("CmpGE32Fx4"); return;
645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN32Fx4: vex_printf("CmpUN32Fx4"); return;
646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64Fx2: vex_printf("CmpEQ64Fx2"); return;
647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64Fx2: vex_printf("CmpLT64Fx2"); return;
648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64Fx2: vex_printf("CmpLE64Fx2"); return;
649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN64Fx2: vex_printf("CmpUN64Fx2"); return;
650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx2: vex_printf("CmpGT32Fx2"); return;
651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32Fx2: vex_printf("CmpEQ32Fx2"); return;
652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGE32Fx2: vex_printf("CmpGE32Fx2"); return;
653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32F0x4: vex_printf("CmpEQ32F0x4"); return;
655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32F0x4: vex_printf("CmpLT32F0x4"); return;
656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32F0x4: vex_printf("CmpLE32F0x4"); return;
657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN32F0x4: vex_printf("CmpUN32F0x4"); return;
658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64F0x2: vex_printf("CmpEQ64F0x2"); return;
659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64F0x2: vex_printf("CmpLT64F0x2"); return;
660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64F0x2: vex_printf("CmpLE64F0x2"); return;
661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN64F0x2: vex_printf("CmpUN64F0x2"); return;
662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx4: vex_printf("Neg32Fx4"); return;
664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx2: vex_printf("Neg32Fx2"); return;
665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to64:   vex_printf("V128to64");   return;
667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128HIto64: vex_printf("V128HIto64"); return;
668ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HLtoV128: vex_printf("64HLtoV128"); return;
669ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
670ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64UtoV128:   vex_printf("64UtoV128"); return;
671ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo64: vex_printf("SetV128lo64"); return;
672ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
673ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32UtoV128:   vex_printf("32UtoV128"); return;
674ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to32:    vex_printf("V128to32"); return;
675ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo32: vex_printf("SetV128lo32"); return;
676ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
677ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x16: vex_printf("Dup8x16"); return;
678ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x8: vex_printf("Dup16x8"); return;
679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x4: vex_printf("Dup32x4"); return;
680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x8: vex_printf("Dup8x8"); return;
681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x4: vex_printf("Dup16x4"); return;
682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x2: vex_printf("Dup32x2"); return;
683ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
684ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NotV128:    vex_printf("NotV128"); return;
685ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AndV128:    vex_printf("AndV128"); return;
686ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_OrV128:     vex_printf("OrV128");  return;
687ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_XorV128:    vex_printf("XorV128"); return;
688ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
689ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x16: vex_printf("CmpNEZ8x16"); return;
690ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x8: vex_printf("CmpNEZ16x8"); return;
691ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x4: vex_printf("CmpNEZ32x4"); return;
692ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ64x2: vex_printf("CmpNEZ64x2"); return;
693ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
694ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x16: vex_printf("Abs8x16"); return;
695ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs16x8: vex_printf("Abs16x8"); return;
696ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32x4: vex_printf("Abs32x4"); return;
697ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
698ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x16:   vex_printf("Add8x16"); return;
699ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x8:   vex_printf("Add16x8"); return;
700ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32x4:   vex_printf("Add32x4"); return;
701ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64x2:   vex_printf("Add64x2"); return;
702ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux16: vex_printf("QAdd8Ux16"); return;
703ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Ux8: vex_printf("QAdd16Ux8"); return;
704ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux4: vex_printf("QAdd32Ux4"); return;
705ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx16: vex_printf("QAdd8Sx16"); return;
706ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx8: vex_printf("QAdd16Sx8"); return;
707ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx4: vex_printf("QAdd32Sx4"); return;
708ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Ux2: vex_printf("QAdd64Ux2"); return;
709ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Sx2: vex_printf("QAdd64Sx2"); return;
710ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x16: vex_printf("PwAdd8x16"); return;
711ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd16x8: vex_printf("PwAdd16x8"); return;
712ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32x4: vex_printf("PwAdd32x4"); return;
713ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux16: vex_printf("PwAddL8Ux16"); return;
714ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Ux8: vex_printf("PwAddL16Ux8"); return;
715ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Ux4: vex_printf("PwAddL32Ux4"); return;
716ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx16: vex_printf("PwAddL8Sx16"); return;
717ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Sx8: vex_printf("PwAddL16Sx8"); return;
718ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Sx4: vex_printf("PwAddL32Sx4"); return;
719ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
720ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x16:   vex_printf("Sub8x16"); return;
721ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub16x8:   vex_printf("Sub16x8"); return;
722ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32x4:   vex_printf("Sub32x4"); return;
723ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64x2:   vex_printf("Sub64x2"); return;
724ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux16: vex_printf("QSub8Ux16"); return;
725ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Ux8: vex_printf("QSub16Ux8"); return;
726ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux4: vex_printf("QSub32Ux4"); return;
727ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx16: vex_printf("QSub8Sx16"); return;
728ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx8: vex_printf("QSub16Sx8"); return;
729ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx4: vex_printf("QSub32Sx4"); return;
730ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Ux2: vex_printf("QSub64Ux2"); return;
731ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Sx2: vex_printf("QSub64Sx2"); return;
732ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
733ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x16:    vex_printf("Mul8x16"); return;
734ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul16x8:    vex_printf("Mul16x8"); return;
735ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32x4:    vex_printf("Mul32x4"); return;
736ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull8Ux8:    vex_printf("Mull8Ux8"); return;
737ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull8Sx8:    vex_printf("Mull8Sx8"); return;
738ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull16Ux4:    vex_printf("Mull16Ux4"); return;
739ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull16Sx4:    vex_printf("Mull16Sx4"); return;
740ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull32Ux2:    vex_printf("Mull32Ux2"); return;
741ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull32Sx2:    vex_printf("Mull32Sx2"); return;
742ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x16: vex_printf("PolynomialMul8x16"); return;
743ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMull8x8: vex_printf("PolynomialMull8x8"); return;
744ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Ux8: vex_printf("MulHi16Ux8"); return;
745ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi32Ux4: vex_printf("MulHi32Ux4"); return;
746ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx8: vex_printf("MulHi16Sx8"); return;
747ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi32Sx4: vex_printf("MulHi32Sx4"); return;
748ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx8: vex_printf("QDMulHi16Sx8"); return;
749ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi32Sx4: vex_printf("QDMulHi32Sx4"); return;
750ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx8: vex_printf("QRDMulHi16Sx8"); return;
751ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi32Sx4: vex_printf("QRDMulHi32Sx4"); return;
752ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
753ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Ux16: vex_printf("MullEven8Ux16"); return;
754ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven16Ux8: vex_printf("MullEven16Ux8"); return;
755ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Sx16: vex_printf("MullEven8Sx16"); return;
756ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven16Sx8: vex_printf("MullEven16Sx8"); return;
757ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
758ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux16: vex_printf("Avg8Ux16"); return;
759ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg16Ux8: vex_printf("Avg16Ux8"); return;
760ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg32Ux4: vex_printf("Avg32Ux4"); return;
761ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Sx16: vex_printf("Avg8Sx16"); return;
762ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg16Sx8: vex_printf("Avg16Sx8"); return;
763ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg32Sx4: vex_printf("Avg32Sx4"); return;
764ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
765ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx16: vex_printf("Max8Sx16"); return;
766ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Sx8: vex_printf("Max16Sx8"); return;
767ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Sx4: vex_printf("Max32Sx4"); return;
768ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux16: vex_printf("Max8Ux16"); return;
769ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Ux8: vex_printf("Max16Ux8"); return;
770ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Ux4: vex_printf("Max32Ux4"); return;
771ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
772ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx16: vex_printf("Min8Sx16"); return;
773ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Sx8: vex_printf("Min16Sx8"); return;
774ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Sx4: vex_printf("Min32Sx4"); return;
775ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux16: vex_printf("Min8Ux16"); return;
776ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Ux8: vex_printf("Min16Ux8"); return;
777ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Ux4: vex_printf("Min32Ux4"); return;
778ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
779ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x16:  vex_printf("CmpEQ8x16"); return;
780ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ16x8:  vex_printf("CmpEQ16x8"); return;
781ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32x4:  vex_printf("CmpEQ32x4"); return;
782b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpEQ64x2:  vex_printf("CmpEQ64x2"); return;
783ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx16: vex_printf("CmpGT8Sx16"); return;
784ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Sx8: vex_printf("CmpGT16Sx8"); return;
785ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Sx4: vex_printf("CmpGT32Sx4"); return;
786ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT64Sx2: vex_printf("CmpGT64Sx2"); return;
787ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux16: vex_printf("CmpGT8Ux16"); return;
788ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Ux8: vex_printf("CmpGT16Ux8"); return;
789ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Ux4: vex_printf("CmpGT32Ux4"); return;
790ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
791ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x16: vex_printf("Cnt8x16"); return;
792ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx16: vex_printf("Clz8Sx16"); return;
793ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz16Sx8: vex_printf("Clz16Sx8"); return;
794ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32Sx4: vex_printf("Clz32Sx4"); return;
795ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx16: vex_printf("Cls8Sx16"); return;
796ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls16Sx8: vex_printf("Cls16Sx8"); return;
797ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls32Sx4: vex_printf("Cls32Sx4"); return;
798ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
799ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlV128: vex_printf("ShlV128"); return;
800ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrV128: vex_printf("ShrV128"); return;
801ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
802ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN8x16: vex_printf("ShlN8x16"); return;
803ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN16x8: vex_printf("ShlN16x8"); return;
804ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x4: vex_printf("ShlN32x4"); return;
805ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN64x2: vex_printf("ShlN64x2"); return;
806ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN8x16: vex_printf("ShrN8x16"); return;
807ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN16x8: vex_printf("ShrN16x8"); return;
808ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x4: vex_printf("ShrN32x4"); return;
809ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN64x2: vex_printf("ShrN64x2"); return;
810ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN8x16: vex_printf("SarN8x16"); return;
811ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN16x8: vex_printf("SarN16x8"); return;
812ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x4: vex_printf("SarN32x4"); return;
813ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN64x2: vex_printf("SarN64x2"); return;
814ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
815ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x16: vex_printf("Shl8x16"); return;
816ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl16x8: vex_printf("Shl16x8"); return;
817ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl32x4: vex_printf("Shl32x4"); return;
818ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl64x2: vex_printf("Shl64x2"); return;
819ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal8x16: vex_printf("QSal8x16"); return;
820ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal16x8: vex_printf("QSal16x8"); return;
821ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal32x4: vex_printf("QSal32x4"); return;
822ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal64x2: vex_printf("QSal64x2"); return;
823ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl8x16: vex_printf("QShl8x16"); return;
824ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl16x8: vex_printf("QShl16x8"); return;
825ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl32x4: vex_printf("QShl32x4"); return;
826ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl64x2: vex_printf("QShl64x2"); return;
827ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x16: vex_printf("QSalN8x16"); return;
828ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN16x8: vex_printf("QSalN16x8"); return;
829ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x4: vex_printf("QSalN32x4"); return;
830ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN64x2: vex_printf("QSalN64x2"); return;
831ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x16: vex_printf("QShlN8x16"); return;
832ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16x8: vex_printf("QShlN16x8"); return;
833ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x4: vex_printf("QShlN32x4"); return;
834ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64x2: vex_printf("QShlN64x2"); return;
835ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx16: vex_printf("QShlN8Sx16"); return;
836ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16Sx8: vex_printf("QShlN16Sx8"); return;
837ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx4: vex_printf("QShlN32Sx4"); return;
838ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64Sx2: vex_printf("QShlN64Sx2"); return;
839ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x16: vex_printf("Shr8x16"); return;
840ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr16x8: vex_printf("Shr16x8"); return;
841ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr32x4: vex_printf("Shr32x4"); return;
842ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr64x2: vex_printf("Shr64x2"); return;
843ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x16: vex_printf("Sar8x16"); return;
844ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar16x8: vex_printf("Sar16x8"); return;
845ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar32x4: vex_printf("Sar32x4"); return;
846ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar64x2: vex_printf("Sar64x2"); return;
847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x16: vex_printf("Sal8x16"); return;
848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal16x8: vex_printf("Sal16x8"); return;
849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal32x4: vex_printf("Sal32x4"); return;
850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal64x2: vex_printf("Sal64x2"); return;
851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol8x16: vex_printf("Rol8x16"); return;
852ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol16x8: vex_printf("Rol16x8"); return;
853ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol32x4: vex_printf("Rol32x4"); return;
854ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
855b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x16:    vex_printf("NarrowBin16to8x16"); return;
856b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin32to16x8:    vex_printf("NarrowBin32to16x8"); return;
857b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Uto8Ux16: vex_printf("QNarrowBin16Uto8Ux16"); return;
858b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Ux8: vex_printf("QNarrowBin32Sto16Ux8"); return;
859b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Ux16: vex_printf("QNarrowBin16Sto8Ux16"); return;
860b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Uto16Ux8: vex_printf("QNarrowBin32Uto16Ux8"); return;
861b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx16: vex_printf("QNarrowBin16Sto8Sx16"); return;
862b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Sx8: vex_printf("QNarrowBin32Sto16Sx8"); return;
863b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn16to8x8:     vex_printf("NarrowUn16to8x8");  return;
864b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn32to16x4:    vex_printf("NarrowUn32to16x4"); return;
865b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn64to32x2:    vex_printf("NarrowUn64to32x2"); return;
866b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Uto8Ux8:  vex_printf("QNarrowUn16Uto8Ux8");  return;
867b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Uto16Ux4: vex_printf("QNarrowUn32Uto16Ux4"); return;
868b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Uto32Ux2: vex_printf("QNarrowUn64Uto32Ux2"); return;
869b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Sx8:  vex_printf("QNarrowUn16Sto8Sx8");  return;
870b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Sx4: vex_printf("QNarrowUn32Sto16Sx4"); return;
871b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Sx2: vex_printf("QNarrowUn64Sto32Sx2"); return;
872b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Ux8:  vex_printf("QNarrowUn16Sto8Ux8");  return;
873b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Ux4: vex_printf("QNarrowUn32Sto16Ux4"); return;
874b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Ux2: vex_printf("QNarrowUn64Sto32Ux2"); return;
875b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Uto16x8:  vex_printf("Widen8Uto16x8");  return;
876b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Uto32x4: vex_printf("Widen16Uto32x4"); return;
877b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Uto64x2: vex_printf("Widen32Uto64x2"); return;
878b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Sto16x8:  vex_printf("Widen8Sto16x8");  return;
879b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Sto32x4: vex_printf("Widen16Sto32x4"); return;
880b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Sto64x2: vex_printf("Widen32Sto64x2"); return;
881ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
882ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x16: vex_printf("InterleaveHI8x16"); return;
883ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI16x8: vex_printf("InterleaveHI16x8"); return;
884ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x4: vex_printf("InterleaveHI32x4"); return;
885ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI64x2: vex_printf("InterleaveHI64x2"); return;
886ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO8x16: vex_printf("InterleaveLO8x16"); return;
887ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO16x8: vex_printf("InterleaveLO16x8"); return;
888ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO32x4: vex_printf("InterleaveLO32x4"); return;
889ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO64x2: vex_printf("InterleaveLO64x2"); return;
890ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
891ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x16: vex_printf("CatOddLanes8x16"); return;
892ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x8: vex_printf("CatOddLanes16x8"); return;
893ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes32x4: vex_printf("CatOddLanes32x4"); return;
894ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes8x16: vex_printf("CatEvenLanes8x16"); return;
895ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes16x8: vex_printf("CatEvenLanes16x8"); return;
896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes32x4: vex_printf("CatEvenLanes32x4"); return;
897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x16: vex_printf("InterleaveOddLanes8x16"); return;
899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x8: vex_printf("InterleaveOddLanes16x8"); return;
900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes32x4: vex_printf("InterleaveOddLanes32x4"); return;
901ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes8x16: vex_printf("InterleaveEvenLanes8x16"); return;
902ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes16x8: vex_printf("InterleaveEvenLanes16x8"); return;
903ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes32x4: vex_printf("InterleaveEvenLanes32x4"); return;
904ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x16: vex_printf("GetElem8x16"); return;
906ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x8: vex_printf("GetElem16x8"); return;
907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x4: vex_printf("GetElem32x4"); return;
908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem64x2: vex_printf("GetElem64x2"); return;
909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x8: vex_printf("GetElem8x8"); return;
911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x4: vex_printf("GetElem16x4"); return;
912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x2: vex_printf("GetElem32x2"); return;
913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem8x8: vex_printf("SetElem8x8"); return;
914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem16x4: vex_printf("SetElem16x4"); return;
915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem32x2: vex_printf("SetElem32x2"); return;
916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Extract64: vex_printf("Extract64"); return;
918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ExtractV128: vex_printf("ExtractV128"); return;
919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x16: vex_printf("Perm8x16"); return;
921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x16: vex_printf("Reverse16_8x16"); return;
922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x16: vex_printf("Reverse32_8x16"); return;
923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_16x8: vex_printf("Reverse32_16x8"); return;
924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x16: vex_printf("Reverse64_8x16"); return;
925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_16x8: vex_printf("Reverse64_16x8"); return;
926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_32x4: vex_printf("Reverse64_32x4"); return;
927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux4_RZ: vex_printf("F32ToFixed32Ux4_RZ"); return;
929ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx4_RZ: vex_printf("F32ToFixed32Sx4_RZ"); return;
930ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x4_RN: vex_printf("Fixed32UToF32x4_RN"); return;
931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x4_RN: vex_printf("Fixed32SToF32x4_RN"); return;
932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux2_RZ: vex_printf("F32ToFixed32Ux2_RZ"); return;
933ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx2_RZ: vex_printf("F32ToFixed32Sx2_RZ"); return;
934ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x2_RN: vex_printf("Fixed32UToF32x2_RN"); return;
935ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x2_RN: vex_printf("Fixed32SToF32x2_RN"); return;
936ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
937ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIROp(1)");
938ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
939ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
940ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(str);
941ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (op - base) {
942ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 0: vex_printf("%s",str); vex_printf("8"); break;
943ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 1: vex_printf("%s",str); vex_printf("16"); break;
944ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 2: vex_printf("%s",str); vex_printf("32"); break;
945ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 3: vex_printf("%s",str); vex_printf("64"); break;
946ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIROp(2)");
947ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
948ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
949ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRExpr ( IRExpr* e )
951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown  Int i;
953ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown  switch (e->tag) {
954ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Binder:
955ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("BIND-%d", e->Iex.Binder.binder);
956ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
957ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Get:
958ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "GET:" );
959ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(e->Iex.Get.ty);
960ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("(%d)", e->Iex.Get.offset);
961ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
962ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_GetI:
963ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "GETI" );
964ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRRegArray(e->Iex.GetI.descr);
965ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("[");
966ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.GetI.ix);
967ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",%d]", e->Iex.GetI.bias);
968ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
969ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_RdTmp:
970ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(e->Iex.RdTmp.tmp);
971ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
972ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Qop:
973ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIROp(e->Iex.Qop.op);
974ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
975ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Qop.arg1);
976ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
977ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Qop.arg2);
978ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
979ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Qop.arg3);
980ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
981ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Qop.arg4);
982ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
983ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
984ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Triop:
985ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIROp(e->Iex.Triop.op);
986ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
987ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Triop.arg1);
988ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
989ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Triop.arg2);
990ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
991ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Triop.arg3);
992ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
993ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
994ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Binop:
995ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIROp(e->Iex.Binop.op);
996ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
997ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Binop.arg1);
998ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
999ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Binop.arg2);
1000ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1001ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1002ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Unop:
1003ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIROp(e->Iex.Unop.op);
1004ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1005ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Unop.arg);
1006ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1007ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1008ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Load:
1009ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "LD%s:", e->Iex.Load.end==Iend_LE ? "le" : "be" );
1010ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(e->Iex.Load.ty);
1011ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1012ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Load.addr);
1013ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1014ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1015ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Const:
1016ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRConst(e->Iex.Const.con);
1017ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1018ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_CCall:
1019ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRCallee(e->Iex.CCall.cee);
1020ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("(");
1021ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; e->Iex.CCall.args[i] != NULL; i++) {
1022ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown        ppIRExpr(e->Iex.CCall.args[i]);
1023ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown        if (e->Iex.CCall.args[i+1] != NULL)
1024ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown          vex_printf(",");
1025ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
1026ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("):");
1027ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(e->Iex.CCall.retty);
1028ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1029ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Mux0X:
1030ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("Mux0X(");
1031ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Mux0X.cond);
1032ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1033ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Mux0X.expr0);
1034ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1035ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Mux0X.exprX);
1036ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(")");
1037ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1038ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    default:
1039ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vpanic("ppIRExpr");
1040ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown  }
1041ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1042ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1043ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIREffect ( IREffect fx )
1044ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1045ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (fx) {
1046ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_None:   vex_printf("noFX"); return;
1047ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_Read:   vex_printf("RdFX"); return;
1048ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_Write:  vex_printf("WrFX"); return;
1049ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_Modify: vex_printf("MoFX"); return;
1050ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIREffect");
1051ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1052ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1053ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1054ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRDirty ( IRDirty* d )
1055ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1056ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
1057ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (d->tmp != IRTemp_INVALID) {
1058ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(d->tmp);
1059ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" = ");
1060ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1061ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("DIRTY ");
1062ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(d->guard);
1063ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (d->needsBBP)
1064ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" NeedsBBP");
1065ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (d->mFx != Ifx_None) {
1066ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" ");
1067ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIREffect(d->mFx);
1068ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("-mem(");
1069ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(d->mAddr);
1070ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",%d)", d->mSize);
1071ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1072ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < d->nFxState; i++) {
1073ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" ");
1074ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIREffect(d->fxState[i].fx);
1075ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("-gst(%d,%d)", d->fxState[i].offset, d->fxState[i].size);
1076ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1077ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(" ::: ");
1078ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRCallee(d->cee);
1079ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("(");
1080ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; d->args[i] != NULL; i++) {
1081ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(d->args[i]);
1082ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (d->args[i+1] != NULL) {
1083ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(",");
1084ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
1085ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1086ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(")");
1087ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1088ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1089ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRCAS ( IRCAS* cas )
1090ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1091ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Print even structurally invalid constructions, as an aid to
1092ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      debugging. */
1093ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cas->oldHi != IRTemp_INVALID) {
1094ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(cas->oldHi);
1095ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1096ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1097ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRTemp(cas->oldLo);
1098ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(" = CAS%s(", cas->end==Iend_LE ? "le" : "be" );
1099ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(cas->addr);
1100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("::");
1101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cas->expdHi) {
1102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(cas->expdHi);
1103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(cas->expdLo);
1106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("->");
1107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cas->dataHi) {
1108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(cas->dataHi);
1109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(cas->dataLo);
1112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(")");
1113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRJumpKind ( IRJumpKind kind )
1116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (kind) {
1118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Boring:       vex_printf("Boring"); break;
1119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Call:         vex_printf("Call"); break;
1120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Ret:          vex_printf("Return"); break;
1121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_ClientReq:    vex_printf("ClientReq"); break;
1122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Yield:        vex_printf("Yield"); break;
1123f0cb39bc6abe181a0abdd1f6c778521ae8497277Evgeniy Stepanov      case Ijk_YieldNoRedir: vex_printf("YieldNoRedir"); break;
1124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_EmWarn:       vex_printf("EmWarn"); break;
1125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_EmFail:       vex_printf("EmFail"); break;
1126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_NoDecode:     vex_printf("NoDecode"); break;
1127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_MapFail:      vex_printf("MapFail"); break;
1128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_TInval:       vex_printf("Invalidate"); break;
1129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_NoRedir:      vex_printf("NoRedir"); break;
1130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_SigTRAP:      vex_printf("SigTRAP"); break;
1131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_SigSEGV:      vex_printf("SigSEGV"); break;
1132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_SigBUS:       vex_printf("SigBUS"); break;
1133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_syscall:  vex_printf("Sys_syscall"); break;
1134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int32:    vex_printf("Sys_int32"); break;
1135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int128:   vex_printf("Sys_int128"); break;
1136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int129:   vex_printf("Sys_int129"); break;
1137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int130:   vex_printf("Sys_int130"); break;
1138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_sysenter: vex_printf("Sys_sysenter"); break;
1139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:               vpanic("ppIRJumpKind");
1140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRMBusEvent ( IRMBusEvent event )
1144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (event) {
1146b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Imbe_Fence:
1147b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vex_printf("Fence"); break;
1148b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Imbe_CancelReservation:
1149b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vex_printf("CancelReservation"); break;
1150b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      default:
1151b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vpanic("ppIRMBusEvent");
1152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRStmt ( IRStmt* s )
1156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (!s) {
1158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("!!! IRStmt* which is NULL !!!");
1159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return;
1160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (s->tag) {
1162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
1163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("IR-NoOp");
1164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
1166b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vex_printf( "------ IMark(0x%llx, %d, %u) ------",
1167b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     s->Ist.IMark.addr, s->Ist.IMark.len,
1168b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     (UInt)s->Ist.IMark.delta);
1169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
1171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("====== AbiHint(");
1172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.AbiHint.base);
1173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(", %d, ", s->Ist.AbiHint.len);
1174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.AbiHint.nia);
1175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(") ======");
1176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
1178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "PUT(%d) = ", s->Ist.Put.offset);
1179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Put.data);
1180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
1182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "PUTI" );
1183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRRegArray(s->Ist.PutI.descr);
1184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("[");
1185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.PutI.ix);
1186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(",%d] = ", s->Ist.PutI.bias);
1187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.PutI.data);
1188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
1190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRTemp(s->Ist.WrTmp.tmp);
1191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( " = " );
1192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.WrTmp.data);
1193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
1195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "ST%s(", s->Ist.Store.end==Iend_LE ? "le" : "be" );
1196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Store.addr);
1197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( ") = ");
1198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Store.data);
1199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
1201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRCAS(s->Ist.CAS.details);
1202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
1204ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (s->Ist.LLSC.storedata == NULL) {
1205ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRTemp(s->Ist.LLSC.result);
1206ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" = LD%s-Linked(",
1207ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                       s->Ist.LLSC.end==Iend_LE ? "le" : "be");
1208ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRExpr(s->Ist.LLSC.addr);
1209ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")");
1210ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
1211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRTemp(s->Ist.LLSC.result);
1212ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" = ( ST%s-Cond(",
1213ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                       s->Ist.LLSC.end==Iend_LE ? "le" : "be");
1214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRExpr(s->Ist.LLSC.addr);
1215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") = ");
1216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRExpr(s->Ist.LLSC.storedata);
1217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" )");
1218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
1219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
1221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRDirty(s->Ist.Dirty.details);
1222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
1224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("IR-");
1225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRMBusEvent(s->Ist.MBE.event);
1226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
1228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "if (" );
1229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Exit.guard);
1230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( ") goto {");
1231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRJumpKind(s->Ist.Exit.jk);
1232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("} ");
1233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRConst(s->Ist.Exit.dst);
1234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
1236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("ppIRStmt");
1237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRTypeEnv ( IRTypeEnv* env ) {
1241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   UInt i;
1242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < env->types_used; i++) {
1243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (i % 8 == 0)
1244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "   ");
1245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(i);
1246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ":");
1247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(env->types[i]);
1248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (i % 8 == 7)
1249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "\n");
1250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      else
1251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "   ");
1252ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (env->types_used > 0 && env->types_used % 8 != 7)
1254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "\n");
1255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1256ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1257ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRSB ( IRSB* bb )
1258ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1259ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
1260ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("IRSB {\n");
1261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRTypeEnv(bb->tyenv);
1262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("\n");
1263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb->stmts_used; i++) {
1264ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "   ");
1265ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRStmt(bb->stmts[i]);
1266ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "\n");
1267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf( "   goto {");
1269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRJumpKind(bb->jumpkind);
1270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf( "} ");
1271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr( bb->next );
1272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf( "\n}\n");
1273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1275ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1276ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1277ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Constructors                                            ---*/
1278ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1279ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1280ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1281ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRConst */
1282ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1283ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U1 ( Bool bit )
1284ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1285ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1286ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U1;
1287ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U1  = bit;
1288ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* call me paranoid; I don't care :-) */
1289ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(bit == False || bit == True);
1290ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1291ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1292ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U8 ( UChar u8 )
1293ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1294ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1295ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U8;
1296ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U8  = u8;
1297ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1298ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1299ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U16 ( UShort u16 )
1300ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U16;
1303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U16 = u16;
1304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U32 ( UInt u32 )
1307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U32;
1310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U32 = u32;
1311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U64 ( ULong u64 )
1314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U64;
1317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U64 = u64;
1318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1320b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy StepanovIRConst* IRConst_F32 ( Float f32 )
1321b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov{
1322b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1323b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->tag     = Ico_F32;
1324b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->Ico.F32 = f32;
1325b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   return c;
1326b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov}
1327b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy StepanovIRConst* IRConst_F32i ( UInt f32i )
1328b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov{
1329b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1330b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->tag      = Ico_F32i;
1331b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->Ico.F32i = f32i;
1332b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   return c;
1333b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov}
1334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_F64 ( Double f64 )
1335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1337ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_F64;
1338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.F64 = f64;
1339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_F64i ( ULong f64i )
1342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag      = Ico_F64i;
1345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.F64i = f64i;
1346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_V128 ( UShort con )
1349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1350ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag      = Ico_V128;
1352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.V128 = con;
1353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRCallee */
1357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCallee* mkIRCallee ( Int regparms, HChar* name, void* addr )
1359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCallee* ce = LibVEX_Alloc(sizeof(IRCallee));
1361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->regparms = regparms;
1362ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->name     = name;
1363ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->addr     = addr;
1364ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->mcx_mask = 0;
1365ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(regparms >= 0 && regparms <= 3);
1366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(name != NULL);
1367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(addr != 0);
1368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return ce;
1369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1370ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1371ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1372ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRRegArray */
1373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRRegArray* mkIRRegArray ( Int base, IRType elemTy, Int nElems )
1375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRRegArray* arr = LibVEX_Alloc(sizeof(IRRegArray));
1377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   arr->base       = base;
1378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   arr->elemTy     = elemTy;
1379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   arr->nElems     = nElems;
1380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(!(arr->base < 0 || arr->base > 10000 /* somewhat arbitrary */));
1381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(!(arr->elemTy == Ity_I1));
1382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(!(arr->nElems <= 0 || arr->nElems > 500 /* somewhat arbitrary */));
1383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return arr;
1384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRExpr */
1388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Binder ( Int binder ) {
1390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e            = LibVEX_Alloc(sizeof(IRExpr));
1391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag               = Iex_Binder;
1392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binder.binder = binder;
1393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Get ( Int off, IRType ty ) {
1396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_Get;
1398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Get.offset = off;
1399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Get.ty     = ty;
1400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_GetI ( IRRegArray* descr, IRExpr* ix, Int bias ) {
1403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_GetI;
1405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.GetI.descr = descr;
1406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.GetI.ix    = ix;
1407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.GetI.bias  = bias;
1408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_RdTmp ( IRTemp tmp ) {
1411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e        = LibVEX_Alloc(sizeof(IRExpr));
1412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag           = Iex_RdTmp;
1413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.RdTmp.tmp = tmp;
1414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Qop ( IROp op, IRExpr* arg1, IRExpr* arg2,
1417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                              IRExpr* arg3, IRExpr* arg4 ) {
1418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e       = LibVEX_Alloc(sizeof(IRExpr));
1419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag          = Iex_Qop;
1420ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Qop.op   = op;
1421ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Qop.arg1 = arg1;
1422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Qop.arg2 = arg2;
1423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Qop.arg3 = arg3;
1424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Qop.arg4 = arg4;
1425ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1426ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1427ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Triop  ( IROp op, IRExpr* arg1,
1428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                 IRExpr* arg2, IRExpr* arg3 ) {
1429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_Triop;
1431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Triop.op   = op;
1432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Triop.arg1 = arg1;
1433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Triop.arg2 = arg2;
1434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Triop.arg3 = arg3;
1435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Binop ( IROp op, IRExpr* arg1, IRExpr* arg2 ) {
1438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_Binop;
1440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binop.op   = op;
1441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binop.arg1 = arg1;
1442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binop.arg2 = arg2;
1443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Unop ( IROp op, IRExpr* arg ) {
1446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e       = LibVEX_Alloc(sizeof(IRExpr));
1447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag          = Iex_Unop;
1448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Unop.op  = op;
1449ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Unop.arg = arg;
1450ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Load ( IREndness end, IRType ty, IRExpr* addr ) {
1453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e        = LibVEX_Alloc(sizeof(IRExpr));
1454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag           = Iex_Load;
1455ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Load.end  = end;
1456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Load.ty   = ty;
1457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Load.addr = addr;
1458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(end == Iend_LE || end == Iend_BE);
1459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Const ( IRConst* con ) {
1462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e        = LibVEX_Alloc(sizeof(IRExpr));
1463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag           = Iex_Const;
1464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Const.con = con;
1465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_CCall ( IRCallee* cee, IRType retty, IRExpr** args ) {
1468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e          = LibVEX_Alloc(sizeof(IRExpr));
1469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag             = Iex_CCall;
1470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.CCall.cee   = cee;
1471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.CCall.retty = retty;
1472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.CCall.args  = args;
1473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Mux0X ( IRExpr* cond, IRExpr* expr0, IRExpr* exprX ) {
1476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e          = LibVEX_Alloc(sizeof(IRExpr));
1477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag             = Iex_Mux0X;
1478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Mux0X.cond  = cond;
1479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Mux0X.expr0 = expr0;
1480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Mux0X.exprX = exprX;
1481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors for NULL-terminated IRExpr expression vectors,
1486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   suitable for use as arg lists in clean/dirty helper calls. */
1487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_0 ( void ) {
1489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(1 * sizeof(IRExpr*));
1490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = NULL;
1491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_1 ( IRExpr* arg1 ) {
1494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(2 * sizeof(IRExpr*));
1495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = NULL;
1497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_2 ( IRExpr* arg1, IRExpr* arg2 ) {
1500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(3 * sizeof(IRExpr*));
1501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = NULL;
1504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_3 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3 ) {
1507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(4 * sizeof(IRExpr*));
1508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = NULL;
1512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_4 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4 ) {
1516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(5 * sizeof(IRExpr*));
1517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1521ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = NULL;
1522ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1523ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1524ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_5 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1525ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5 ) {
1526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(6 * sizeof(IRExpr*));
1527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = NULL;
1533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_6 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5, IRExpr* arg6 ) {
1537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(7 * sizeof(IRExpr*));
1538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = arg6;
1544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[6] = NULL;
1545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_7 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5, IRExpr* arg6,
1549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg7 ) {
1550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(8 * sizeof(IRExpr*));
1551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = arg6;
1557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[6] = arg7;
1558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[7] = NULL;
1559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_8 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5, IRExpr* arg6,
1563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg7, IRExpr* arg8 ) {
1564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(9 * sizeof(IRExpr*));
1565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = arg6;
1571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[6] = arg7;
1572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[7] = arg8;
1573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[8] = NULL;
1574ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1578ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRDirty */
1579ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1580ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* emptyIRDirty ( void ) {
1581ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d = LibVEX_Alloc(sizeof(IRDirty));
1582ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->cee      = NULL;
1583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->guard    = NULL;
1584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->args     = NULL;
1585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->tmp      = IRTemp_INVALID;
1586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->mFx      = Ifx_None;
1587ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->mAddr    = NULL;
1588ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->mSize    = 0;
1589ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->needsBBP = False;
1590ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->nFxState = 0;
1591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d;
1592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRCAS */
1596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCAS* mkIRCAS ( IRTemp oldHi, IRTemp oldLo,
1598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                 IREndness end, IRExpr* addr,
1599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                 IRExpr* expdHi, IRExpr* expdLo,
1600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                 IRExpr* dataHi, IRExpr* dataLo ) {
1601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS* cas = LibVEX_Alloc(sizeof(IRCAS));
1602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->oldHi  = oldHi;
1603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->oldLo  = oldLo;
1604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->end    = end;
1605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->addr   = addr;
1606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->expdHi = expdHi;
1607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->expdLo = expdLo;
1608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->dataHi = dataHi;
1609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->dataLo = dataLo;
1610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return cas;
1611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRStmt */
1615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_NoOp ( void )
1617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Just use a single static closure. */
1619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   static IRStmt static_closure;
1620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   static_closure.tag = Ist_NoOp;
1621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return &static_closure;
1622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1623b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy StepanovIRStmt* IRStmt_IMark ( Addr64 addr, Int len, UChar delta ) {
1624b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   IRStmt* s          = LibVEX_Alloc(sizeof(IRStmt));
1625b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->tag             = Ist_IMark;
1626b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->Ist.IMark.addr  = addr;
1627b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->Ist.IMark.len   = len;
1628b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->Ist.IMark.delta = delta;
1629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_AbiHint ( IRExpr* base, Int len, IRExpr* nia ) {
1632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s           = LibVEX_Alloc(sizeof(IRStmt));
1633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag              = Ist_AbiHint;
1634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.AbiHint.base = base;
1635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.AbiHint.len  = len;
1636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.AbiHint.nia  = nia;
1637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Put ( Int off, IRExpr* data ) {
1640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_Put;
1642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Put.offset = off;
1643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Put.data   = data;
1644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_PutI ( IRRegArray* descr, IRExpr* ix,
1647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      Int bias, IRExpr* data ) {
1648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_PutI;
1650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.PutI.descr = descr;
1651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.PutI.ix    = ix;
1652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.PutI.bias  = bias;
1653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.PutI.data  = data;
1654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_WrTmp ( IRTemp tmp, IRExpr* data ) {
1657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_WrTmp;
1659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.WrTmp.tmp  = tmp;
1660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.WrTmp.data = data;
1661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Store ( IREndness end, IRExpr* addr, IRExpr* data ) {
1664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_Store;
1666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Store.end  = end;
1667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Store.addr = addr;
1668ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Store.data = data;
1669ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(end == Iend_LE || end == Iend_BE);
1670ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1671ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1672ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_CAS ( IRCAS* cas ) {
1673ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s          = LibVEX_Alloc(sizeof(IRStmt));
1674ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag             = Ist_CAS;
1675ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.CAS.details = cas;
1676ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1677ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1678ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_LLSC ( IREndness end,
1679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      IRTemp result, IRExpr* addr, IRExpr* storedata ) {
1680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s = LibVEX_Alloc(sizeof(IRStmt));
1681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag                = Ist_LLSC;
1682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.end       = end;
1683ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.result    = result;
1684ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.addr      = addr;
1685ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.storedata = storedata;
1686ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1687ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1688ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Dirty ( IRDirty* d )
1689ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1690ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s            = LibVEX_Alloc(sizeof(IRStmt));
1691ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag               = Ist_Dirty;
1692ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Dirty.details = d;
1693ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1694ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1695ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_MBE ( IRMBusEvent event )
1696ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1697ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s        = LibVEX_Alloc(sizeof(IRStmt));
1698ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag           = Ist_MBE;
1699ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.MBE.event = event;
1700ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1701ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1702ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Exit ( IRExpr* guard, IRJumpKind jk, IRConst* dst ) {
1703ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1704ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_Exit;
1705ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Exit.guard = guard;
1706ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Exit.jk    = jk;
1707ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Exit.dst   = dst;
1708ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1709ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1710ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1711ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1712ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRTypeEnv */
1713ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1714ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRTypeEnv* emptyIRTypeEnv ( void )
1715ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1716ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* env   = LibVEX_Alloc(sizeof(IRTypeEnv));
1717ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   env->types       = LibVEX_Alloc(8 * sizeof(IRType));
1718ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   env->types_size  = 8;
1719ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   env->types_used  = 0;
1720ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return env;
1721ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1722ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1723ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1724ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRSB */
1725ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1726ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRSB* emptyIRSB ( void )
1727ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1728ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRSB* bb       = LibVEX_Alloc(sizeof(IRSB));
1729ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->tyenv      = emptyIRTypeEnv();
1730ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts_used = 0;
1731ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts_size = 8;
1732ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts      = LibVEX_Alloc(bb->stmts_size * sizeof(IRStmt*));
1733ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->next       = NULL;
1734ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->jumpkind   = Ijk_Boring;
1735ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return bb;
1736ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1737ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1738ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1739ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1740ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- (Deep) copy constructors.  These make complete copies   ---*/
1741ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- the original, which can be modified without affecting   ---*/
1742ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- the original.                                           ---*/
1743ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1744ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1745ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Copying IR Expr vectors (for call args). */
1746ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1747ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Shallow copy of an IRExpr vector */
1748ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1749ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** shallowCopyIRExprVec ( IRExpr** vec )
1750ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1751ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1752ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** newvec;
1753ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; vec[i]; i++)
1754ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ;
1755ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   newvec = LibVEX_Alloc((i+1)*sizeof(IRExpr*));
1756ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; vec[i]; i++)
1757ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      newvec[i] = vec[i];
1758ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   newvec[i] = NULL;
1759ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return newvec;
1760ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1761ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1762ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Deep copy of an IRExpr vector */
1763ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1764ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** deepCopyIRExprVec ( IRExpr** vec )
1765ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1766ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1767ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** newvec = shallowCopyIRExprVec( vec );
1768ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; newvec[i]; i++)
1769ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      newvec[i] = deepCopyIRExpr(newvec[i]);
1770ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return newvec;
1771ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1772ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1773ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Deep copy constructors for all heap-allocated IR types follow. */
1774ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1775ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* deepCopyIRConst ( IRConst* c )
1776ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1777ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (c->tag) {
1778ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:   return IRConst_U1(c->Ico.U1);
1779ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:   return IRConst_U8(c->Ico.U8);
1780ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16:  return IRConst_U16(c->Ico.U16);
1781ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32:  return IRConst_U32(c->Ico.U32);
1782ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64:  return IRConst_U64(c->Ico.U64);
1783b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32:  return IRConst_F32(c->Ico.F32);
1784b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i: return IRConst_F32i(c->Ico.F32i);
1785ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64:  return IRConst_F64(c->Ico.F64);
1786ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i: return IRConst_F64i(c->Ico.F64i);
1787ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128: return IRConst_V128(c->Ico.V128);
1788ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("deepCopyIRConst");
1789ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1790ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1791ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1792ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCallee* deepCopyIRCallee ( IRCallee* ce )
1793ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1794ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCallee* ce2 = mkIRCallee(ce->regparms, ce->name, ce->addr);
1795ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce2->mcx_mask = ce->mcx_mask;
1796ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return ce2;
1797ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1798ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1799ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRRegArray* deepCopyIRRegArray ( IRRegArray* d )
1800ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1801ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return mkIRRegArray(d->base, d->elemTy, d->nElems);
1802ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1803ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1804ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* deepCopyIRExpr ( IRExpr* e )
1805ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1806ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (e->tag) {
1807ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
1808ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Get(e->Iex.Get.offset, e->Iex.Get.ty);
1809ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
1810ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_GetI(deepCopyIRRegArray(e->Iex.GetI.descr),
1811ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(e->Iex.GetI.ix),
1812ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            e->Iex.GetI.bias);
1813ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
1814ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_RdTmp(e->Iex.RdTmp.tmp);
1815ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Qop:
1816ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Qop(e->Iex.Qop.op,
1817ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                           deepCopyIRExpr(e->Iex.Qop.arg1),
1818ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                           deepCopyIRExpr(e->Iex.Qop.arg2),
1819ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                           deepCopyIRExpr(e->Iex.Qop.arg3),
1820ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                           deepCopyIRExpr(e->Iex.Qop.arg4));
1821ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Triop:
1822ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Triop(e->Iex.Triop.op,
1823ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Triop.arg1),
1824ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Triop.arg2),
1825ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Triop.arg3));
1826ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop:
1827ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Binop(e->Iex.Binop.op,
1828ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Binop.arg1),
1829ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Binop.arg2));
1830ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
1831ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Unop(e->Iex.Unop.op,
1832ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(e->Iex.Unop.arg));
1833ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
1834ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Load(e->Iex.Load.end,
1835ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            e->Iex.Load.ty,
1836ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(e->Iex.Load.addr));
1837ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
1838ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Const(deepCopyIRConst(e->Iex.Const.con));
1839ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
1840ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_CCall(deepCopyIRCallee(e->Iex.CCall.cee),
1841ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             e->Iex.CCall.retty,
1842ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExprVec(e->Iex.CCall.args));
1843ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1844ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
1845ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Mux0X(deepCopyIRExpr(e->Iex.Mux0X.cond),
1846ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Mux0X.expr0),
1847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Mux0X.exprX));
1848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
1849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("deepCopyIRExpr");
1850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1852ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1853ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* deepCopyIRDirty ( IRDirty* d )
1854ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1855ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1856ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d2 = emptyIRDirty();
1857ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->cee   = deepCopyIRCallee(d->cee);
1858ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->guard = deepCopyIRExpr(d->guard);
1859ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->args  = deepCopyIRExprVec(d->args);
1860ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->tmp   = d->tmp;
1861ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->mFx   = d->mFx;
1862ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->mAddr = d->mAddr==NULL ? NULL : deepCopyIRExpr(d->mAddr);
1863ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->mSize = d->mSize;
1864ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->needsBBP = d->needsBBP;
1865ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->nFxState = d->nFxState;
1866ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < d2->nFxState; i++)
1867ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      d2->fxState[i] = d->fxState[i];
1868ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d2;
1869ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1870ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1871ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCAS* deepCopyIRCAS ( IRCAS* cas )
1872ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1873ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return mkIRCAS( cas->oldHi, cas->oldLo, cas->end,
1874ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   deepCopyIRExpr(cas->addr),
1875ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   cas->expdHi==NULL ? NULL : deepCopyIRExpr(cas->expdHi),
1876ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   deepCopyIRExpr(cas->expdLo),
1877ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   cas->dataHi==NULL ? NULL : deepCopyIRExpr(cas->dataHi),
1878ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   deepCopyIRExpr(cas->dataLo) );
1879ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1880ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1881ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* deepCopyIRStmt ( IRStmt* s )
1882ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1883ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (s->tag) {
1884ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
1885ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_NoOp();
1886ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
1887ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_AbiHint(deepCopyIRExpr(s->Ist.AbiHint.base),
1888ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               s->Ist.AbiHint.len,
1889ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               deepCopyIRExpr(s->Ist.AbiHint.nia));
1890ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
1891b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         return IRStmt_IMark(s->Ist.IMark.addr,
1892b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                             s->Ist.IMark.len,
1893b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                             s->Ist.IMark.delta);
1894ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
1895ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Put(s->Ist.Put.offset,
1896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                           deepCopyIRExpr(s->Ist.Put.data));
1897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
1898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_PutI(deepCopyIRRegArray(s->Ist.PutI.descr),
1899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(s->Ist.PutI.ix),
1900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.PutI.bias,
1901ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(s->Ist.PutI.data));
1902ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
1903ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_WrTmp(s->Ist.WrTmp.tmp,
1904ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(s->Ist.WrTmp.data));
1905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
1906ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Store(s->Ist.Store.end,
1907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(s->Ist.Store.addr),
1908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(s->Ist.Store.data));
1909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
1910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_CAS(deepCopyIRCAS(s->Ist.CAS.details));
1911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
1912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_LLSC(s->Ist.LLSC.end,
1913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.LLSC.result,
1914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(s->Ist.LLSC.addr),
1915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.LLSC.storedata
1916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               ? deepCopyIRExpr(s->Ist.LLSC.storedata)
1917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               : NULL);
1918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
1919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Dirty(deepCopyIRDirty(s->Ist.Dirty.details));
1920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
1921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_MBE(s->Ist.MBE.event);
1922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
1923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Exit(deepCopyIRExpr(s->Ist.Exit.guard),
1924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.Exit.jk,
1925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRConst(s->Ist.Exit.dst));
1926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
1927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("deepCopyIRStmt");
1928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1929ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1930ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRTypeEnv* deepCopyIRTypeEnv ( IRTypeEnv* src )
1932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1933ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int        i;
1934ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* dst = LibVEX_Alloc(sizeof(IRTypeEnv));
1935ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   dst->types_size = src->types_size;
1936ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   dst->types_used = src->types_used;
1937ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   dst->types = LibVEX_Alloc(dst->types_size * sizeof(IRType));
1938ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < src->types_used; i++)
1939ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      dst->types[i] = src->types[i];
1940ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return dst;
1941ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1942ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1943ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRSB* deepCopyIRSB ( IRSB* bb )
1944ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1945ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1946ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt** sts2;
1947ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRSB* bb2 = deepCopyIRSBExceptStmts(bb);
1948ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->stmts_used = bb2->stmts_size = bb->stmts_used;
1949ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   sts2 = LibVEX_Alloc(bb2->stmts_used * sizeof(IRStmt*));
1950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb2->stmts_used; i++)
1951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sts2[i] = deepCopyIRStmt(bb->stmts[i]);
1952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->stmts    = sts2;
1953ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return bb2;
1954ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1955ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1956ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRSB* deepCopyIRSBExceptStmts ( IRSB* bb )
1957ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1958ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRSB* bb2     = emptyIRSB();
1959ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->tyenv    = deepCopyIRTypeEnv(bb->tyenv);
1960ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->next     = deepCopyIRExpr(bb->next);
1961ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->jumpkind = bb->jumpkind;
1962ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return bb2;
1963ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1964ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1965ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1966ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1967ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Primop types                                            ---*/
1968ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1969ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1970ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
1971ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid typeOfPrimop ( IROp op,
1972ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    /*OUTs*/
1973ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    IRType* t_dst,
1974ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    IRType* t_arg1, IRType* t_arg2,
1975ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    IRType* t_arg3, IRType* t_arg4 )
1976ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1977ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define UNARY(_ta1,_td)                                      \
1978ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      *t_dst = (_td); *t_arg1 = (_ta1); break
1979ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define BINARY(_ta1,_ta2,_td)                                \
1980ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = (_td); *t_arg1 = (_ta1); *t_arg2 = (_ta2); break
1981ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define TERNARY(_ta1,_ta2,_ta3,_td)                          \
1982ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = (_td); *t_arg1 = (_ta1);                         \
1983ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_arg2 = (_ta2); *t_arg3 = (_ta3); break
1984ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define QUATERNARY(_ta1,_ta2,_ta3,_ta4,_td)                  \
1985ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = (_td); *t_arg1 = (_ta1);                         \
1986ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_arg2 = (_ta2); *t_arg3 = (_ta3);                       \
1987ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_arg4 = (_ta4); break
1988ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define COMPARISON(_ta)                                      \
1989ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = Ity_I1; *t_arg1 = *t_arg2 = (_ta); break;
1990ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define UNARY_COMPARISON(_ta)                                \
1991ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = Ity_I1; *t_arg1 = (_ta); break;
1992ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1993ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Rounding mode values are always Ity_I32, encoded as per
1994ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRRoundingMode */
1995ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   const IRType ity_RMode = Ity_I32;
1996ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1997ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_dst  = Ity_INVALID;
1998ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg1 = Ity_INVALID;
1999ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg2 = Ity_INVALID;
2000ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg3 = Ity_INVALID;
2001ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg4 = Ity_INVALID;
2002ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (op) {
2003ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8: case Iop_Sub8: case Iop_Mul8:
2004ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or8:  case Iop_And8: case Iop_Xor8:
2005ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I8);
2006ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2007ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16: case Iop_Sub16: case Iop_Mul16:
2008ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or16:  case Iop_And16: case Iop_Xor16:
2009ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I16, Ity_I16);
2010ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2011ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32U:
2012ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32S:
2013ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32: case Iop_Sub32: case Iop_Mul32:
2014ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or32:  case Iop_And32: case Iop_Xor32:
2015ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32U:
2016ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x2: case Iop_Sub16x2:
2017ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx2: case Iop_QAdd16Ux2:
2018ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx2: case Iop_QSub16Ux2:
2019ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd16Ux2: case Iop_HAdd16Sx2:
2020ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub16Ux2: case Iop_HSub16Sx2:
2021ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x4: case Iop_Sub8x4:
2022ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx4: case Iop_QAdd8Ux4:
2023ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx4: case Iop_QSub8Ux4:
2024ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd8Ux4: case Iop_HAdd8Sx4:
2025ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub8Ux4: case Iop_HSub8Sx4:
2026ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sad8Ux4:
2027ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I32);
2028ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2029ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64: case Iop_Sub64: case Iop_Mul64:
2030ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or64:  case Iop_And64: case Iop_Xor64:
2031ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64U:
2032ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64S:
2033ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux8: case Iop_Avg16Ux4:
2034ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x8: case Iop_Add16x4: case Iop_Add32x2:
2035ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx2: case Iop_Sub32Fx2:
2036ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x8: case Iop_CmpEQ16x4: case Iop_CmpEQ32x2:
2037ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx8: case Iop_CmpGT16Sx4: case Iop_CmpGT32Sx2:
2038ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux8: case Iop_CmpGT16Ux4: case Iop_CmpGT32Ux2:
2039ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx2: case Iop_CmpEQ32Fx2: case Iop_CmpGE32Fx2:
2040ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x8: case Iop_InterleaveLO8x8:
2041ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI16x4: case Iop_InterleaveLO16x4:
2042ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x2: case Iop_InterleaveLO32x2:
2043ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x8: case Iop_CatEvenLanes8x8:
2044ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x4: case Iop_CatEvenLanes16x4:
2045ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x8: case Iop_InterleaveEvenLanes8x8:
2046ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x4: case Iop_InterleaveEvenLanes16x4:
2047ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x8:
2048ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux8: case Iop_Max16Ux4: case Iop_Max32Ux2:
2049ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx8: case Iop_Max16Sx4: case Iop_Max32Sx2:
2050ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx2: case Iop_Min32Fx2:
2051ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx2: case Iop_PwMin32Fx2:
2052ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux8: case Iop_Min16Ux4: case Iop_Min32Ux2:
2053ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx8: case Iop_Min16Sx4: case Iop_Min32Sx2:
2054ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Ux8: case Iop_PwMax16Ux4: case Iop_PwMax32Ux2:
2055ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Sx8: case Iop_PwMax16Sx4: case Iop_PwMax32Sx2:
2056ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Ux8: case Iop_PwMin16Ux4: case Iop_PwMin32Ux2:
2057ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Sx8: case Iop_PwMin16Sx4: case Iop_PwMin32Sx2:
2058ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x8: case Iop_Mul16x4: case Iop_Mul32x2:
2059ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx2:
2060ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x8:
2061ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx4: case Iop_MulHi16Ux4:
2062ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx4: case Iop_QDMulHi32Sx2:
2063ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx4: case Iop_QRDMulHi32Sx2:
2064ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx8: case Iop_QAdd16Sx4:
2065ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx2: case Iop_QAdd64Sx1:
2066ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux8: case Iop_QAdd16Ux4:
2067ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux2: case Iop_QAdd64Ux1:
2068ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x8: case Iop_PwAdd16x4: case Iop_PwAdd32x2:
2069ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32Fx2:
2070b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Sx4:
2071b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx8: case Iop_QNarrowBin16Sto8Ux8:
2072b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x8: case Iop_NarrowBin32to16x4:
2073ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x8: case Iop_Sub16x4: case Iop_Sub32x2:
2074ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx8: case Iop_QSub16Sx4:
2075ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx2: case Iop_QSub64Sx1:
2076ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux8: case Iop_QSub16Ux4:
2077ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux2: case Iop_QSub64Ux1:
2078ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x8: case Iop_Shl16x4: case Iop_Shl32x2:
2079ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x8: case Iop_Shr16x4: case Iop_Shr32x2:
2080ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x8: case Iop_Sar16x4: case Iop_Sar32x2:
2081ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x8: case Iop_Sal16x4: case Iop_Sal32x2: case Iop_Sal64x1:
2082ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl8x8: case Iop_QShl16x4: case Iop_QShl32x2: case Iop_QShl64x1:
2083ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal8x8: case Iop_QSal16x4: case Iop_QSal32x2: case Iop_QSal64x1:
2084ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx2:
2085ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx2:
2086ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I64);
2087ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2088ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x2: case Iop_ShlN16x4: case Iop_ShlN8x8:
2089ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x2: case Iop_ShrN16x4: case Iop_ShrN8x8:
2090ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x2: case Iop_SarN16x4: case Iop_SarN8x8:
2091ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x8: case Iop_QShlN16x4:
2092ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x2: case Iop_QShlN64x1:
2093ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx8: case Iop_QShlN16Sx4:
2094ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx2: case Iop_QShlN64Sx1:
2095ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x8: case Iop_QSalN16x4:
2096ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x2: case Iop_QSalN64x1:
2097ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I8, Ity_I64);
2098ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2099ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8: case Iop_Shr8: case Iop_Sar8:
2100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I8);
2101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl16: case Iop_Shr16: case Iop_Sar16:
2102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I8, Ity_I16);
2103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl32: case Iop_Shr32: case Iop_Sar32:
2104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I8, Ity_I32);
2105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl64: case Iop_Shr64: case Iop_Sar64:
2106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I8, Ity_I64);
2107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not8:
2109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I8);
2110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not16:
2111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I16);
2112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not32:
2113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x2: case Iop_CmpNEZ8x4:
2114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I32);
2115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not64:
2117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x2: case Iop_CmpNEZ16x4: case Iop_CmpNEZ8x8:
2118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x8:
2119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx8: case Iop_Clz16Sx4: case Iop_Clz32Sx2:
2120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx8: case Iop_Cls16Sx4: case Iop_Cls32Sx2:
2121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux8: case Iop_PwAddL16Ux4: case Iop_PwAddL32Ux2:
2122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx8: case Iop_PwAddL16Sx4: case Iop_PwAddL32Sx2:
2123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x8: case Iop_Reverse64_16x4: case Iop_Reverse64_32x2:
2124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x8: case Iop_Reverse32_16x4:
2125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x8:
2126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx2_RZ: case Iop_FtoI32Ux2_RZ:
2127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx2: case Iop_I32UtoFx2:
2128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x2: case Iop_Recip32Fx2:
2129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx2:
2130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx2:
2131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x2:
2132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx2:
2133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x8: case Iop_Abs16x4: case Iop_Abs32x2:
2134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I64);
2135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8: case Iop_CmpNE8:
2137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ8: case Iop_CasCmpNE8:
2138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I8);
2139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ16: case Iop_CmpNE16:
2140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ16: case Iop_CasCmpNE16:
2141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I16);
2142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32: case Iop_CmpNE32:
2143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ32: case Iop_CasCmpNE32:
2144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32S: case Iop_CmpLE32S:
2145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32U: case Iop_CmpLE32U:
2146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I32);
2147ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64: case Iop_CmpNE64:
2148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ64: case Iop_CasCmpNE64:
2149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64S: case Iop_CmpLE64S:
2150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64U: case Iop_CmpLE64U:
2151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I64);
2152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8:  UNARY_COMPARISON(Ity_I8);
2154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16: UNARY_COMPARISON(Ity_I16);
2155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32: UNARY_COMPARISON(Ity_I32);
2156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ64: UNARY_COMPARISON(Ity_I64);
2157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left8:  UNARY(Ity_I8, Ity_I8);
2159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left16: UNARY(Ity_I16,Ity_I16);
2160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ32: case Iop_Left32: UNARY(Ity_I32,Ity_I32);
2161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ64: case Iop_Left64: UNARY(Ity_I64,Ity_I64);
2162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU8: case Iop_MullS8:
2164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I16);
2165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU16: case Iop_MullS16:
2166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I16, Ity_I32);
2167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU32: case Iop_MullS32:
2168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I64);
2169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU64: case Iop_MullS64:
2170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I128);
2171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32: case Iop_Ctz32:
2173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I32);
2174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz64: case Iop_Ctz64:
2176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I64);
2177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2178b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU32: case Iop_DivS32: case Iop_DivU32E: case Iop_DivS32E:
2179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I32);
2180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2181b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU64: case Iop_DivS64: case Iop_DivS64E: case Iop_DivU64E:
2182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I64);
2183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU64to32: case Iop_DivModS64to32:
2185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I32, Ity_I64);
2186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU128to64: case Iop_DivModS128to64:
2188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I128,Ity_I64, Ity_I128);
2189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2190b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivModS64to64:
2191b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_I64,Ity_I64, Ity_I128);
2192b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HIto8: case Iop_16to8:
2194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I8);
2195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8HLto16:
2196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I16);
2197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HIto16: case Iop_32to16:
2199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I16);
2200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HLto32:
2201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I16, Ity_I32);
2202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HIto32: case Iop_64to32:
2204ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I32);
2205ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HLto64:
2206ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I64);
2207ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2208ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_128HIto64: case Iop_128to64:
2209ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I128, Ity_I64);
2210ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HLto128:
2211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I128);
2212ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2213ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not1:   UNARY(Ity_I1, Ity_I1);
2214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto8:  UNARY(Ity_I1, Ity_I8);
2215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto8:  UNARY(Ity_I1, Ity_I8);
2216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto16: UNARY(Ity_I1, Ity_I16);
2217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto32: case Iop_1Sto32: UNARY(Ity_I1, Ity_I32);
2218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto64: case Iop_1Uto64: UNARY(Ity_I1, Ity_I64);
2219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to1:  UNARY(Ity_I32, Ity_I1);
2220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to1:  UNARY(Ity_I64, Ity_I1);
2221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto32: case Iop_8Sto32:
2223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I32);
2224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto16: case Iop_8Sto16:
2226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I16);
2227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto32: case Iop_16Sto32:
2229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I32);
2230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32Sto64: case Iop_32Uto64:
2232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I64);
2233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto64: case Iop_8Sto64:
2235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I64);
2236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto64: case Iop_16Sto64:
2238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I64);
2239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to16:
2240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I16);
2241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to8: UNARY(Ity_I32, Ity_I8);
2243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to8: UNARY(Ity_I64, Ity_I8);
2244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64:    case Iop_SubF64:
2246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64:    case Iop_DivF64:
2247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64r32: case Iop_SubF64r32:
2248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64r32: case Iop_DivF64r32:
2249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F64,Ity_F64, Ity_F64);
2250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF32: case Iop_SubF32:
2252ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF32: case Iop_DivF32:
2253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F32,Ity_F32, Ity_F32);
2254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF64: case Iop_AbsF64:
2256ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_F64);
2257ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2258ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF32: case Iop_AbsF32:
2259ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F32, Ity_F32);
2260ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF64:
2262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF64r32:
2263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(ity_RMode,Ity_F64, Ity_F64);
2264ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2265ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF32:
2266ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32toInt:
2267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(ity_RMode,Ity_F32, Ity_F32);
2268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2269b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF32:
2270b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_F32,Ity_F32, Ity_I32);
2271b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpF64:
2273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_F64,Ity_F64, Ity_I32);
2274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2275b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF128:
2276b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_F128,Ity_F128, Ity_I32);
2277b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2278ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI16S: BINARY(ity_RMode,Ity_F64, Ity_I16);
2279ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32S: BINARY(ity_RMode,Ity_F64, Ity_I32);
2280b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toI64S: case Iop_F64toI64U:
2281b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(ity_RMode,Ity_F64, Ity_I64);
2282ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2283ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32U: BINARY(ity_RMode,Ity_F64, Ity_I32);
2284ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2285ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I16StoF64: UNARY(Ity_I16, Ity_F64);
2286ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoF64: UNARY(Ity_I32, Ity_F64);
2287ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I64StoF64: BINARY(ity_RMode,Ity_I64, Ity_F64);
2288b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF64: BINARY(ity_RMode,Ity_I64, Ity_F64);
2289b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF32: BINARY(ity_RMode,Ity_I64, Ity_F32);
2290ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2291ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoF64: UNARY(Ity_I32, Ity_F64);
2292ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2293b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI16S: BINARY(ity_RMode,Ity_F32, Ity_I16);
2294b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI32S: BINARY(ity_RMode,Ity_F32, Ity_I32);
2295b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI64S: BINARY(ity_RMode,Ity_F32, Ity_I64);
2296b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2297b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I16StoF32: UNARY(Ity_I16, Ity_F32);
2298b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF32: BINARY(ity_RMode,Ity_I32, Ity_F32);
2299b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF32: BINARY(ity_RMode,Ity_I64, Ity_F32);
2300b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF64: UNARY(Ity_F32, Ity_F64);
2302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toF32: BINARY(ity_RMode,Ity_F64, Ity_F32);
2303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI64asF64: UNARY(Ity_I64, Ity_F64);
2305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF64asI64: UNARY(Ity_F64, Ity_I64);
2306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI32asF32: UNARY(Ity_I32, Ity_F32);
2307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF32asI32: UNARY(Ity_F32, Ity_I32);
2308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AtanF64: case Iop_Yl2xF64:  case Iop_Yl2xp1F64:
2310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ScaleF64: case Iop_PRemF64: case Iop_PRem1F64:
2311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F64,Ity_F64, Ity_F64);
2312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRemC3210F64: case Iop_PRem1C3210F64:
2314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F64,Ity_F64, Ity_I32);
2315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SinF64: case Iop_CosF64: case Iop_TanF64:
2317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_2xm1F64:
2318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toInt: BINARY(ity_RMode,Ity_F64, Ity_F64);
2319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64: case Iop_MSubF64:
2321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64r32: case Iop_MSubF64r32:
2322ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         QUATERNARY(ity_RMode,Ity_F64,Ity_F64,Ity_F64, Ity_F64);
2323ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2324ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Est5FRSqrt:
2325ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_NEAREST: case Iop_RoundF64toF64_NegINF:
2326ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_PosINF: case Iop_RoundF64toF64_ZERO:
2327ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_F64);
2328ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF32:
2329ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(ity_RMode,Ity_F64, Ity_F64);
2330ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CalcFPRF:
2331ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_I32);
2332ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_TruncF64asF32:
2333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_F32);
2334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoFx4:
2336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx4:
2337ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Ux4_RZ:
2338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Sx4_RZ:
2339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Ux4_RZ:
2340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx4_RZ:
2341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RM:
2342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RP:
2343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RN:
2344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RZ:
2345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx4:
2346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx4:
2347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x4:
2348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_V128, Ity_V128);
2349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2350b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_64HLtoV128:
2351b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_I64,Ity_I64, Ity_V128);
2352b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to64: case Iop_V128HIto64:
2354b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn16to8x8:
2355b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn32to16x4:
2356b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn64to32x2:
2357b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Uto8Ux8:
2358b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Uto16Ux4:
2359b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Uto32Ux2:
2360b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Sx8:
2361b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Sx4:
2362b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Sx2:
2363b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Ux8:
2364b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Ux4:
2365b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Ux2:
2366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF16x4:
2367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_V128, Ity_I64);
2368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2369b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Uto16x8:
2370b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Uto32x4:
2371b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Uto64x2:
2372b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Sto16x8:
2373b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Sto32x4:
2374b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Sto64x2:
2375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F16toF32x4:
2376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_V128);
2377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to32:    UNARY(Ity_V128, Ity_I32);
2379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32UtoV128:   UNARY(Ity_I32, Ity_V128);
2380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64UtoV128:   UNARY(Ity_I64, Ity_V128);
2381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo32: BINARY(Ity_V128,Ity_I32, Ity_V128);
2382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo64: BINARY(Ity_V128,Ity_I64, Ity_V128);
2383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x16: UNARY(Ity_I8, Ity_V128);
2385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x8: UNARY(Ity_I16, Ity_V128);
2386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x4: UNARY(Ity_I32, Ity_V128);
2387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x8:  UNARY(Ity_I8, Ity_I64);
2388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x4: UNARY(Ity_I16, Ity_I64);
2389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x2: UNARY(Ity_I32, Ity_I64);
2390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32Fx4: case Iop_CmpLT32Fx4:
2392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64Fx2: case Iop_CmpLT64Fx2:
2393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32Fx4: case Iop_CmpUN32Fx4:
2394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64Fx2: case Iop_CmpUN64Fx2:
2395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx4: case Iop_CmpGE32Fx4:
2396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32F0x4: case Iop_CmpLT32F0x4:
2397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64F0x2: case Iop_CmpLT64F0x2:
2398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32F0x4: case Iop_CmpUN32F0x4:
2399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64F0x2: case Iop_CmpUN64F0x2:
2400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx4: case Iop_Add32F0x4:
2401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64Fx2: case Iop_Add64F0x2:
2402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div32Fx4: case Iop_Div32F0x4:
2403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div64Fx2: case Iop_Div64F0x2:
2404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx4: case Iop_Max32F0x4:
2405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx4: case Iop_PwMin32Fx4:
2406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max64Fx2: case Iop_Max64F0x2:
2407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Fx4: case Iop_Min32F0x4:
2408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min64Fx2: case Iop_Min64F0x2:
2409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx4: case Iop_Mul32F0x4:
2410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul64Fx2: case Iop_Mul64F0x2:
2411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32Fx4: case Iop_Sub32F0x4:
2412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64Fx2: case Iop_Sub64F0x2:
2413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AndV128: case Iop_OrV128: case Iop_XorV128:
2414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x16:   case Iop_Add16x8:
2415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32x4:   case Iop_Add64x2:
2416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux16: case Iop_QAdd16Ux8:
2417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux4: //case Iop_QAdd64Ux2:
2418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx16: case Iop_QAdd16Sx8:
2419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx4: case Iop_QAdd64Sx2:
2420ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x16: case Iop_PwAdd16x8: case Iop_PwAdd32x4:
2421ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x16:   case Iop_Sub16x8:
2422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32x4:   case Iop_Sub64x2:
2423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux16: case Iop_QSub16Ux8:
2424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux4: //case Iop_QSub64Ux2:
2425ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx16: case Iop_QSub16Sx8:
2426ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx4: case Iop_QSub64Sx2:
2427ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x16: case Iop_Mul16x8: case Iop_Mul32x4:
2428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x16:
2429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Ux8: case Iop_MulHi32Ux4:
2430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx8: case Iop_MulHi32Sx4:
2431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx8: case Iop_QDMulHi32Sx4:
2432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx8: case Iop_QRDMulHi32Sx4:
2433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Ux16: case Iop_MullEven16Ux8:
2434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Sx16: case Iop_MullEven16Sx8:
2435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux16: case Iop_Avg16Ux8: case Iop_Avg32Ux4:
2436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Sx16: case Iop_Avg16Sx8: case Iop_Avg32Sx4:
2437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx16: case Iop_Max16Sx8: case Iop_Max32Sx4:
2438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux16: case Iop_Max16Ux8: case Iop_Max32Ux4:
2439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx16: case Iop_Min16Sx8: case Iop_Min32Sx4:
2440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux16: case Iop_Min16Ux8: case Iop_Min32Ux4:
2441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x16:  case Iop_CmpEQ16x8:  case Iop_CmpEQ32x4:
2442b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpEQ64x2:
2443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx16: case Iop_CmpGT16Sx8: case Iop_CmpGT32Sx4:
2444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT64Sx2:
2445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux16: case Iop_CmpGT16Ux8: case Iop_CmpGT32Ux4:
2446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x16: case Iop_Shl16x8: case Iop_Shl32x4: case Iop_Shl64x2:
2447b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QShl8x16: case Iop_QShl16x8:
2448b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QShl32x4: case Iop_QShl64x2:
2449b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QSal8x16: case Iop_QSal16x8:
2450b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QSal32x4: case Iop_QSal64x2:
2451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x16: case Iop_Shr16x8: case Iop_Shr32x4: case Iop_Shr64x2:
2452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x16: case Iop_Sar16x8: case Iop_Sar32x4: case Iop_Sar64x2:
2453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x16: case Iop_Sal16x8: case Iop_Sal32x4: case Iop_Sal64x2:
2454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol8x16: case Iop_Rol16x8: case Iop_Rol32x4:
2455b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Ux16: case Iop_QNarrowBin32Sto16Ux8:
2456b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx16: case Iop_QNarrowBin32Sto16Sx8:
2457b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Uto8Ux16: case Iop_QNarrowBin32Uto16Ux8:
2458b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x16:   case Iop_NarrowBin32to16x8:
2459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x16: case Iop_InterleaveHI16x8:
2460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x4: case Iop_InterleaveHI64x2:
2461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO8x16: case Iop_InterleaveLO16x8:
2462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO32x4: case Iop_InterleaveLO64x2:
2463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x16: case Iop_CatEvenLanes8x16:
2464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x8: case Iop_CatEvenLanes16x8:
2465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes32x4: case Iop_CatEvenLanes32x4:
2466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x16: case Iop_InterleaveEvenLanes8x16:
2467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x8: case Iop_InterleaveEvenLanes16x8:
2468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes32x4: case Iop_InterleaveEvenLanes32x4:
2469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x16:
2470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx4:
2471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx4:
2472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128,Ity_V128, Ity_V128);
2473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMull8x8:
2475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull8Ux8: case Iop_Mull8Sx8:
2476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull16Ux4: case Iop_Mull16Sx4:
2477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull32Ux2: case Iop_Mull32Sx2:
2478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I64, Ity_V128);
2479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NotV128:
2481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32Fx4: case Iop_Recip32F0x4:
2482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x4:
2483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip64Fx2: case Iop_Recip64F0x2:
2484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt32Fx4: case Iop_RSqrt32F0x4:
2485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt64Fx2: case Iop_RSqrt64F0x2:
2486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt32Fx4:  case Iop_Sqrt32F0x4:
2487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt64Fx2:  case Iop_Sqrt64F0x2:
2488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x16: case Iop_CmpNEZ16x8:
2489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x4: case Iop_CmpNEZ64x2:
2490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x16:
2491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx16: case Iop_Clz16Sx8: case Iop_Clz32Sx4:
2492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx16: case Iop_Cls16Sx8: case Iop_Cls32Sx4:
2493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux16: case Iop_PwAddL16Ux8: case Iop_PwAddL32Ux4:
2494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx16: case Iop_PwAddL16Sx8: case Iop_PwAddL32Sx4:
2495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x16: case Iop_Reverse64_16x8: case Iop_Reverse64_32x4:
2496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x16: case Iop_Reverse32_16x8:
2497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x16:
2498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx4:
2499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x16: case Iop_Abs16x8: case Iop_Abs32x4:
2500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_V128, Ity_V128);
2501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlV128: case Iop_ShrV128:
2503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN8x16: case Iop_ShlN16x8:
2504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x4: case Iop_ShlN64x2:
2505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN8x16: case Iop_ShrN16x8:
2506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x4: case Iop_ShrN64x2:
2507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN8x16: case Iop_SarN16x8:
2508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x4: case Iop_SarN64x2:
2509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x16: case Iop_QShlN16x8:
2510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x4: case Iop_QShlN64x2:
2511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx16: case Iop_QShlN16Sx8:
2512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx4: case Iop_QShlN64Sx2:
2513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x16: case Iop_QSalN16x8:
2514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x4: case Iop_QSalN64x2:
2515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128,Ity_I8, Ity_V128);
2516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux4_RZ:
2518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx4_RZ:
2519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x4_RN:
2520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x4_RN:
2521ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_V128);
2522ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2523ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux2_RZ:
2524ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx2_RZ:
2525ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x2_RN:
2526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x2_RN:
2527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I64);
2528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x16:
2530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I8);
2531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x8:
2532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I16);
2533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x4:
2534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I32);
2535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem64x2:
2536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I64);
2537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x8:
2538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I8);
2539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x4:
2540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I16);
2541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x2:
2542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I32);
2543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem8x8:
2544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I8, Ity_I8, Ity_I64);
2545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem16x4:
2546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I8, Ity_I16, Ity_I64);
2547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem32x2:
2548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I8, Ity_I32, Ity_I64);
2549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Extract64:
2551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I64, Ity_I8, Ity_I64);
2552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ExtractV128:
2553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_V128, Ity_V128, Ity_I8, Ity_V128);
2554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulLong16Sx4: case Iop_QDMulLong32Sx2:
2556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I64, Ity_V128);
2557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2558b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         /* s390 specific */
2559b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MAddF32:
2560b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MSubF32:
2561b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         QUATERNARY(ity_RMode,Ity_F32,Ity_F32,Ity_F32, Ity_F32);
2562b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2563b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64HLtoF128:
2564b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        BINARY(Ity_F64,Ity_F64, Ity_F128);
2565b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2566b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128HItoF64:
2567b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128LOtoF64:
2568b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        UNARY(Ity_F128, Ity_F64);
2569b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2570b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AddF128:
2571b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SubF128:
2572b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MulF128:
2573b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivF128:
2574b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         TERNARY(ity_RMode,Ity_F128,Ity_F128, Ity_F128);
2575b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2576b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NegF128:
2577b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AbsF128:
2578b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         UNARY(Ity_F128, Ity_F128);
2579b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2580b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SqrtF128:
2581b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(ity_RMode,Ity_F128, Ity_F128);
2582b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2583b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF128: UNARY(Ity_I32, Ity_F128);
2584b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF128: UNARY(Ity_I64, Ity_F128);
2585b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2586b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI32S: BINARY(ity_RMode,Ity_F128, Ity_I32);
2587b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI64S: BINARY(ity_RMode,Ity_F128, Ity_I64);
2588b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2589b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toF128: UNARY(Ity_F32, Ity_F128);
2590b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toF128: UNARY(Ity_F64, Ity_F128);
2591b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2592b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF32: BINARY(ity_RMode,Ity_F128, Ity_F32);
2593b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF64: BINARY(ity_RMode,Ity_F128, Ity_F64);
2594b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIROp(op);
2597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("typeOfPrimop");
2598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef UNARY
2600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef BINARY
2601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef TERNARY
2602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef COMPARISON
2603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef UNARY_COMPARISON
2604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Helper functions for the IR -- IR Basic Blocks          ---*/
2609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid addStmtToIRSB ( IRSB* bb, IRStmt* st )
2612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
2614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (bb->stmts_used == bb->stmts_size) {
2615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRStmt** stmts2 = LibVEX_Alloc(2 * bb->stmts_size * sizeof(IRStmt*));
2616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; i < bb->stmts_size; i++)
2617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         stmts2[i] = bb->stmts[i];
2618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      bb->stmts = stmts2;
2619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      bb->stmts_size *= 2;
2620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(bb->stmts_used < bb->stmts_size);
2622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts[bb->stmts_used] = st;
2623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts_used++;
2624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2625ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Helper functions for the IR -- IR Type Environments     ---*/
2629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Allocate a new IRTemp, given its type. */
2632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRTemp newIRTemp ( IRTypeEnv* env, IRType ty )
2634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env);
2636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env->types_used >= 0);
2637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env->types_size >= 0);
2638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env->types_used <= env->types_size);
2639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (env->types_used < env->types_size) {
2640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      env->types[env->types_used] = ty;
2641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return env->types_used++;
2642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   } else {
2643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      Int i;
2644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      Int new_size = env->types_size==0 ? 8 : 2*env->types_size;
2645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRType* new_types
2646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         = LibVEX_Alloc(new_size * sizeof(IRType));
2647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; i < env->types_used; i++)
2648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         new_types[i] = env->types[i];
2649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      env->types      = new_types;
2650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      env->types_size = new_size;
2651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return newIRTemp(env, ty);
2652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Helper functions for the IR -- finding types of exprs   ---*/
2658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Browninline
2661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRType typeOfIRTemp ( IRTypeEnv* env, IRTemp tmp )
2662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(tmp >= 0);
2664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(tmp < env->types_used);
2665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return env->types[tmp];
2666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2668ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2669ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRType typeOfIRConst ( IRConst* con )
2670ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2671ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (con->tag) {
2672ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:    return Ity_I1;
2673ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:    return Ity_I8;
2674ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16:   return Ity_I16;
2675ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32:   return Ity_I32;
2676ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64:   return Ity_I64;
2677b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32:   return Ity_F32;
2678b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i:  return Ity_F32;
2679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64:   return Ity_F64;
2680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i:  return Ity_F64;
2681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128:  return Ity_V128;
2682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("typeOfIRConst");
2683ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2684ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2685ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2686ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRType typeOfIRExpr ( IRTypeEnv* tyenv, IRExpr* e )
2687ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2688ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRType t_dst, t_arg1, t_arg2, t_arg3, t_arg4;
2689ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown start:
2690ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (e->tag) {
2691ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
2692ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.Load.ty;
2693ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
2694ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.Get.ty;
2695ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
2696ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.GetI.descr->elemTy;
2697ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
2698ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return typeOfIRTemp(tyenv, e->Iex.RdTmp.tmp);
2699ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
2700ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return typeOfIRConst(e->Iex.Const.con);
2701ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Qop:
2702ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(e->Iex.Qop.op,
2703ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2704ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2705ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Triop:
2706ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(e->Iex.Triop.op,
2707ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2708ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2709ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop:
2710ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(e->Iex.Binop.op,
2711ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2712ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2713ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
2714ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(e->Iex.Unop.op,
2715ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2716ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2717ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
2718ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.CCall.retty;
2719ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
2720ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         e = e->Iex.Mux0X.expr0;
2721ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         goto start;
2722ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* return typeOfIRExpr(tyenv, e->Iex.Mux0X.expr0); */
2723ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binder:
2724ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("typeOfIRExpr: Binder is not a valid expression");
2725ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2726ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(e);
2727ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("typeOfIRExpr");
2728ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2729ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2730ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2731ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Is this any value actually in the enumeration 'IRType' ? */
2732ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool isPlausibleIRType ( IRType ty )
2733ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2734ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (ty) {
2735ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_INVALID: case Ity_I1:
2736ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I8: case Ity_I16: case Ity_I32:
2737ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I64: case Ity_I128:
2738b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ity_F32: case Ity_F64: case Ity_F128:
2739ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_V128:
2740ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
2741ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2742ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return False;
2743ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2744ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2745ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2746ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2747ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2748ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Sanity checking -- FLATNESS                             ---*/
2749ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2750ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2751ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Check that the canonical flatness constraints hold on an
2752ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt. The only place where any expression is allowed to be
2753ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   non-atomic is the RHS of IRStmt_Tmp. */
2754ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2755ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Relies on:
2756ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   inline static Bool isAtom ( IRExpr* e ) {
2757ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return e->tag == Iex_RdTmp || e->tag == Iex_Const;
2758ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2759ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown*/
2760ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2761ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool isFlatIRStmt ( IRStmt* st )
2762ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2763ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
2764ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr*  e;
2765ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* di;
2766ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS*   cas;
2767ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2768ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (st->tag) {
2769ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
2770ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return isIRAtom(st->Ist.AbiHint.base)
2771ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                && isIRAtom(st->Ist.AbiHint.nia);
2772ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
2773ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return isIRAtom(st->Ist.Put.data);
2774ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
2775ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(st->Ist.PutI.ix)
2776ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(st->Ist.PutI.data) );
2777ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
2778ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* This is the only interesting case.  The RHS can be any
2779ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            expression, *but* all its subexpressions *must* be
2780ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            atoms. */
2781ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         e = st->Ist.WrTmp.data;
2782ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         switch (e->tag) {
2783ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Binder: return True;
2784ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Get:    return True;
2785ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_GetI:   return isIRAtom(e->Iex.GetI.ix);
2786ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_RdTmp:  return True;
2787ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Qop:    return toBool(
2788ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    isIRAtom(e->Iex.Qop.arg1)
2789ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Qop.arg2)
2790ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Qop.arg3)
2791ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Qop.arg4));
2792ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Triop:  return toBool(
2793ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    isIRAtom(e->Iex.Triop.arg1)
2794ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Triop.arg2)
2795ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Triop.arg3));
2796ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Binop:  return toBool(
2797ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    isIRAtom(e->Iex.Binop.arg1)
2798ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Binop.arg2));
2799ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Unop:   return isIRAtom(e->Iex.Unop.arg);
2800ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Load:   return isIRAtom(e->Iex.Load.addr);
2801ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Const:  return True;
2802ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_CCall:  for (i = 0; e->Iex.CCall.args[i]; i++)
2803ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                if (!isIRAtom(e->Iex.CCall.args[i]))
2804ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                   return False;
2805ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             return True;
2806ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Mux0X:  return toBool (
2807ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    isIRAtom(e->Iex.Mux0X.cond)
2808ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Mux0X.expr0)
2809ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Mux0X.exprX));
2810ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            default:         vpanic("isFlatIRStmt(e)");
2811ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
2812ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /*notreached*/
2813ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vassert(0);
2814ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
2815ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(st->Ist.Store.addr)
2816ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(st->Ist.Store.data) );
2817ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
2818ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = st->Ist.CAS.details;
2819ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(cas->addr)
2820ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && (cas->expdHi ? isIRAtom(cas->expdHi) : True)
2821ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(cas->expdLo)
2822ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && (cas->dataHi ? isIRAtom(cas->dataHi) : True)
2823ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(cas->dataLo) );
2824ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
2825ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(st->Ist.LLSC.addr)
2826ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && (st->Ist.LLSC.storedata
2827ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               ? isIRAtom(st->Ist.LLSC.storedata) : True) );
2828ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
2829ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         di = st->Ist.Dirty.details;
2830ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!isIRAtom(di->guard))
2831ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            return False;
2832ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; di->args[i]; i++)
2833ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (!isIRAtom(di->args[i]))
2834ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               return False;
2835ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (di->mAddr && !isIRAtom(di->mAddr))
2836ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            return False;
2837ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
2838ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
2839ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
2840ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
2841ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
2842ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
2843ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return isIRAtom(st->Ist.Exit.guard);
2844ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2845ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("isFlatIRStmt(st)");
2846ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Sanity checking                                         ---*/
2852ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2853ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2854ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Checks:
2855ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2856ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Everything is type-consistent.  No ill-typed anything.
2857ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   The target address at the end of the BB is a 32- or 64-
2858ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bit expression, depending on the guest's word size.
2859ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2860ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Each temp is assigned only once, before its uses.
2861ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown*/
2862ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2863ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic inline Int countArgs ( IRExpr** args )
2864ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2865ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
2866ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; args[i]; i++)
2867ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ;
2868ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return i;
2869ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2870ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2871ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
2872ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown__attribute((noreturn))
2873ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid sanityCheckFail ( IRSB* bb, IRStmt* stmt, HChar* what )
2874ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2875ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("\nIR SANITY CHECK FAILURE\n\n");
2876ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRSB(bb);
2877ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (stmt) {
2878ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("\nIN STATEMENT:\n\n");
2879ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRStmt(stmt);
2880ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2881ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("\n\nERROR = %s\n\n", what );
2882ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vpanic("sanityCheckFail: exiting due to bad IR");
2883ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2884ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2885ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic Bool saneIRRegArray ( IRRegArray* arr )
2886ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2887ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (arr->base < 0 || arr->base > 10000 /* somewhat arbitrary */)
2888ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
2889ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (arr->elemTy == Ity_I1)
2890ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
2891ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (arr->nElems <= 0 || arr->nElems > 500 /* somewhat arbitrary */)
2892ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
2893ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return True;
2894ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2895ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic Bool saneIRCallee ( IRCallee* cee )
2897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cee->name == NULL)
2899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
2900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cee->addr == 0)
2901ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
2902ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cee->regparms < 0 || cee->regparms > 3)
2903ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
2904ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return True;
2905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2906ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic Bool saneIRConst ( IRConst* con )
2908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (con->tag) {
2910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:
2911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( con->Ico.U1 == True || con->Ico.U1 == False );
2912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* Is there anything we can meaningfully check?  I don't
2914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            think so. */
2915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
2916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Traverse a Stmt/Expr, inspecting IRTemp uses.  Report any out of
2920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   range ones.  Report any which are read and for which the current
2921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   def_count is zero. */
2922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
2924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid useBeforeDef_Temp ( IRSB* bb, IRStmt* stmt, IRTemp tmp, Int* def_counts )
2925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (tmp < 0 || tmp >= bb->tyenv->types_used)
2927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sanityCheckFail(bb,stmt, "out of range Temp in IRExpr");
2928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (def_counts[tmp] < 1)
2929ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sanityCheckFail(bb,stmt, "IRTemp use before def in IRExpr");
2930ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
2933ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid useBeforeDef_Expr ( IRSB* bb, IRStmt* stmt, IRExpr* expr, Int* def_counts )
2934ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2935ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
2936ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (expr->tag) {
2937ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
2938ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2939ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
2940ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.GetI.ix,def_counts);
2941ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2942ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
2943ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Temp(bb,stmt,expr->Iex.RdTmp.tmp,def_counts);
2944ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2945ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Qop:
2946ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Qop.arg1,def_counts);
2947ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Qop.arg2,def_counts);
2948ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Qop.arg3,def_counts);
2949ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Qop.arg4,def_counts);
2950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Triop:
2952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Triop.arg1,def_counts);
2953ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Triop.arg2,def_counts);
2954ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Triop.arg3,def_counts);
2955ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2956ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop:
2957ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Binop.arg1,def_counts);
2958ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Binop.arg2,def_counts);
2959ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2960ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
2961ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Unop.arg,def_counts);
2962ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2963ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
2964ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Load.addr,def_counts);
2965ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2966ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
2967ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2968ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
2969ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; expr->Iex.CCall.args[i]; i++)
2970ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,expr->Iex.CCall.args[i],def_counts);
2971ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2972ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
2973ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.cond,def_counts);
2974ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.expr0,def_counts);
2975ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.exprX,def_counts);
2976ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2977ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2978ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("useBeforeDef_Expr");
2979ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2980ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2981ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2982ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
2983ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid useBeforeDef_Stmt ( IRSB* bb, IRStmt* stmt, Int* def_counts )
2984ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2985ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
2986ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d;
2987ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS*   cas;
2988ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (stmt->tag) {
2989ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
2990ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2991ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
2992ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.base,def_counts);
2993ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.nia,def_counts);
2994ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2995ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
2996ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Put.data,def_counts);
2997ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
2998ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
2999ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.PutI.ix,def_counts);
3000ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.PutI.data,def_counts);
3001ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3002ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3003ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.WrTmp.data,def_counts);
3004ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3005ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3006ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Store.addr,def_counts);
3007ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Store.data,def_counts);
3008ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3009ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3010ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = stmt->Ist.CAS.details;
3011ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,cas->addr,def_counts);
3012ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->expdHi)
3013ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,cas->expdHi,def_counts);
3014ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,cas->expdLo,def_counts);
3015ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->dataHi)
3016ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,cas->dataHi,def_counts);
3017ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,cas->dataLo,def_counts);
3018ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3019ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
3020ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.LLSC.addr,def_counts);
3021ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.storedata != NULL)
3022ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,stmt->Ist.LLSC.storedata,def_counts);
3023ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3024ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3025ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         d = stmt->Ist.Dirty.details;
3026ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; d->args[i] != NULL; i++)
3027ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,d->args[i],def_counts);
3028ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->mFx != Ifx_None)
3029ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,d->mAddr,def_counts);
3030ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3031ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
3032ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
3033ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3034ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
3035ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Exit.guard,def_counts);
3036ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3037ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3038ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("useBeforeDef_Stmt");
3039ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3040ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3041ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3042ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3043ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid tcExpr ( IRSB* bb, IRStmt* stmt, IRExpr* expr, IRType gWordTy )
3044ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3045ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int        i;
3046ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRType     t_dst, t_arg1, t_arg2, t_arg3, t_arg4;
3047ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* tyenv = bb->tyenv;
3048ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (expr->tag) {
3049ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
3050ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
3051ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3052ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
3053ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.GetI.ix, gWordTy );
3054ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,expr->Iex.GetI.ix) != Ity_I32)
3055ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRExpr.GetI.ix: not :: Ity_I32");
3056ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRRegArray(expr->Iex.GetI.descr))
3057ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRExpr.GetI.descr: invalid descr");
3058ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3059ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Qop: {
3060ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType ttarg1, ttarg2, ttarg3, ttarg4;
3061ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Qop.arg1, gWordTy );
3062ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Qop.arg2, gWordTy );
3063ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Qop.arg3, gWordTy );
3064ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Qop.arg4, gWordTy );
3065ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(expr->Iex.Qop.op,
3066ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3067ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 == Ity_INVALID
3068ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 == Ity_INVALID || t_arg4 == Ity_INVALID) {
3069ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: " );
3070ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Qop.op);
3071ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3072ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3073ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Qop: wrong arity op\n"
3074ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... name of op precedes BB printout\n");
3075ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3076ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg1 = typeOfIRExpr(tyenv, expr->Iex.Qop.arg1);
3077ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg2 = typeOfIRExpr(tyenv, expr->Iex.Qop.arg2);
3078ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg3 = typeOfIRExpr(tyenv, expr->Iex.Qop.arg3);
3079ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg4 = typeOfIRExpr(tyenv, expr->Iex.Qop.arg4);
3080ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != ttarg1 || t_arg2 != ttarg2
3081ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 != ttarg3 || t_arg4 != ttarg4) {
3082ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: ");
3083ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Qop.op);
3084ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3085ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op type is (");
3086ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg1);
3087ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3088ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg2);
3089ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3090ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg3);
3091ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3092ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg4);
3093ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") -> ");
3094ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType (t_dst);
3095ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\narg tys are (");
3096ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg1);
3097ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3098ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg2);
3099ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg3);
3101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg4);
3103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")\n");
3104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Qop: arg tys don't match op tys\n"
3106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... additional details precede BB printout\n");
3107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Triop: {
3111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType ttarg1, ttarg2, ttarg3;
3112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Triop.arg1, gWordTy );
3113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Triop.arg2, gWordTy );
3114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Triop.arg3, gWordTy );
3115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(expr->Iex.Triop.op,
3116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 == Ity_INVALID
3118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 == Ity_INVALID || t_arg4 != Ity_INVALID) {
3119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: " );
3120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Triop.op);
3121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Triop: wrong arity op\n"
3124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... name of op precedes BB printout\n");
3125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg1 = typeOfIRExpr(tyenv, expr->Iex.Triop.arg1);
3127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg2 = typeOfIRExpr(tyenv, expr->Iex.Triop.arg2);
3128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg3 = typeOfIRExpr(tyenv, expr->Iex.Triop.arg3);
3129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != ttarg1 || t_arg2 != ttarg2 || t_arg3 != ttarg3) {
3130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: ");
3131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Triop.op);
3132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op type is (");
3134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg1);
3135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg2);
3137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg3);
3139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") -> ");
3140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType (t_dst);
3141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\narg tys are (");
3142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg1);
3143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg2);
3145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg3);
3147ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")\n");
3148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Triop: arg tys don't match op tys\n"
3150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... additional details precede BB printout\n");
3151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop: {
3155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType ttarg1, ttarg2;
3156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Binop.arg1, gWordTy );
3157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Binop.arg2, gWordTy );
3158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(expr->Iex.Binop.op,
3159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 == Ity_INVALID
3161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 != Ity_INVALID || t_arg4 != Ity_INVALID) {
3162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: " );
3163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Binop.op);
3164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Binop: wrong arity op\n"
3167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... name of op precedes BB printout\n");
3168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg1 = typeOfIRExpr(tyenv, expr->Iex.Binop.arg1);
3170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg2 = typeOfIRExpr(tyenv, expr->Iex.Binop.arg2);
3171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != ttarg1 || t_arg2 != ttarg2) {
3172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: ");
3173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Binop.op);
3174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op type is (");
3176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg1);
3177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg2);
3179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") -> ");
3180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType (t_dst);
3181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\narg tys are (");
3182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg1);
3183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg2);
3185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")\n");
3186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Binop: arg tys don't match op tys\n"
3188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... additional details precede BB printout\n");
3189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
3193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Unop.arg, gWordTy );
3194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(expr->Iex.Binop.op,
3195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 != Ity_INVALID
3197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 != Ity_INVALID || t_arg4 != Ity_INVALID)
3198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Unop: wrong arity op");
3199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != typeOfIRExpr(tyenv, expr->Iex.Unop.arg))
3200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Unop: arg ty doesn't match op ty");
3201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
3203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Load.addr, gWordTy);
3204ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, expr->Iex.Load.addr) != gWordTy)
3205ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Load.addr: not :: guest word type");
3206ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (expr->Iex.Load.end != Iend_LE && expr->Iex.Load.end != Iend_BE)
3207ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Load.end: bogus endianness");
3208ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3209ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
3210ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRCallee(expr->Iex.CCall.cee))
3211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.CCall.cee: bad IRCallee");
3212ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (expr->Iex.CCall.cee->regparms > countArgs(expr->Iex.CCall.args))
3213ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.CCall.cee: #regparms > #args");
3214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; expr->Iex.CCall.args[i]; i++) {
3215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (i >= 32)
3216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Iex.CCall: > 32 args");
3217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tcExpr(bb,stmt, expr->Iex.CCall.args[i], gWordTy);
3218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (expr->Iex.CCall.retty == Ity_I1)
3220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.CCall.retty: cannot return :: Ity_I1");
3221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; expr->Iex.CCall.args[i]; i++)
3222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (typeOfIRExpr(tyenv, expr->Iex.CCall.args[i]) == Ity_I1)
3223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Iex.CCall.arg: arg :: Ity_I1");
3224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
3226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRConst(expr->Iex.Const.con))
3227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Const.con: invalid const");
3228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
3230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Mux0X.cond, gWordTy);
3231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Mux0X.expr0, gWordTy);
3232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Mux0X.exprX, gWordTy);
3233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, expr->Iex.Mux0X.cond) != Ity_I8)
3234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Mux0X.cond: cond :: Ity_I8");
3235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, expr->Iex.Mux0X.expr0)
3236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             != typeOfIRExpr(tyenv, expr->Iex.Mux0X.exprX))
3237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Mux0X: expr0/exprX mismatch");
3238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown       default:
3240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("tcExpr");
3241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid tcStmt ( IRSB* bb, IRStmt* stmt, IRType gWordTy )
3247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int        i;
3249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty*   d;
3250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS*     cas;
3251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRType     tyExpd, tyData;
3252ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* tyenv = bb->tyenv;
3253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (stmt->tag) {
3254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
3255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* Somewhat heuristic, but rule out totally implausible
3256b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            instruction sizes and deltas. */
3257ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.IMark.len < 0 || stmt->Ist.IMark.len > 20)
3258ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.IMark.len: implausible");
3259b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         if (stmt->Ist.IMark.delta > 1)
3260b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            sanityCheckFail(bb,stmt,"IRStmt.IMark.delta: implausible");
3261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
3263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.AbiHint.base) != gWordTy)
3264ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.AbiHint.base: "
3265ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    "not :: guest word type");
3266ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.AbiHint.nia) != gWordTy)
3267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.AbiHint.nia: "
3268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    "not :: guest word type");
3269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
3271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Put.data, gWordTy );
3272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.Put.data) == Ity_I1)
3273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Put.data: cannot Put :: Ity_I1");
3274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3275ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
3276ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.PutI.data, gWordTy );
3277ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.PutI.ix, gWordTy );
3278ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data) == Ity_I1)
3279ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.data: cannot PutI :: Ity_I1");
3280ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.data)
3281ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             != stmt->Ist.PutI.descr->elemTy)
3282ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.data: data ty != elem ty");
3283ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.PutI.ix) != Ity_I32)
3284ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.ix: not :: Ity_I32");
3285ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRRegArray(stmt->Ist.PutI.descr))
3286ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.descr: invalid descr");
3287ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3288ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3289ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.WrTmp.data, gWordTy );
3290ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRTemp(tyenv, stmt->Ist.WrTmp.tmp)
3291ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             != typeOfIRExpr(tyenv, stmt->Ist.WrTmp.data))
3292ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Put.Tmp: tmp and expr do not match");
3293ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3294ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3295ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Store.addr, gWordTy );
3296ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Store.data, gWordTy );
3297ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.Store.addr) != gWordTy)
3298ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Store.addr: not :: guest word type");
3299ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.Store.data) == Ity_I1)
3300ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Store.data: cannot Store :: Ity_I1");
3301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.Store.end != Iend_LE && stmt->Ist.Store.end != Iend_BE)
3302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Ist.Store.end: bogus endianness");
3303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = stmt->Ist.CAS.details;
3306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* make sure it's definitely either a CAS or a DCAS */
3307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi == IRTemp_INVALID
3308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             && cas->expdHi == NULL && cas->dataHi == NULL) {
3309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* fine; it's a single cas */
3310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         else
3312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi != IRTemp_INVALID
3313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             && cas->expdHi != NULL && cas->dataHi != NULL) {
3314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* fine; it's a double cas */
3315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         else {
3317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* it's some el-mutanto hybrid */
3318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_cas;
3319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check the address type */
3321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, cas->addr, gWordTy );
3322ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, cas->addr) != gWordTy) goto bad_cas;
3323ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check types on the {old,expd,data}Lo components agree */
3324ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tyExpd = typeOfIRExpr(tyenv, cas->expdLo);
3325ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tyData = typeOfIRExpr(tyenv, cas->dataLo);
3326ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (tyExpd != tyData) goto bad_cas;
3327ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (tyExpd != typeOfIRTemp(tyenv, cas->oldLo))
3328ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_cas;
3329ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check the base element type is sane */
3330ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (tyExpd == Ity_I8 || tyExpd == Ity_I16 || tyExpd == Ity_I32
3331ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || (gWordTy == Ity_I64 && tyExpd == Ity_I64)) {
3332ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* fine */
3333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
3334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_cas;
3335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* If it's a DCAS, check types on the {old,expd,data}Hi
3337ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            components too */
3338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi != IRTemp_INVALID) {
3339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tyExpd = typeOfIRExpr(tyenv, cas->expdHi);
3340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tyData = typeOfIRExpr(tyenv, cas->dataHi);
3341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (tyExpd != tyData) goto bad_cas;
3342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (tyExpd != typeOfIRTemp(tyenv, cas->oldHi))
3343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_cas;
3344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* and finally check that oldLo and oldHi have the same
3345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               type.  This forces equivalence amongst all 6 types. */
3346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (typeOfIRTemp(tyenv, cas->oldHi)
3347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                != typeOfIRTemp(tyenv, cas->oldLo))
3348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_cas;
3349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3350ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         bad_cas:
3352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb,stmt,"IRStmt.CAS: ill-formed");
3353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC: {
3355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType tyRes;
3356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.LLSC.addr) != gWordTy)
3357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.LLSC.addr: not :: guest word type");
3358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.end != Iend_LE && stmt->Ist.LLSC.end != Iend_BE)
3359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Ist.LLSC.end: bogus endianness");
3360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tyRes = typeOfIRTemp(tyenv, stmt->Ist.LLSC.result);
3361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.storedata == NULL) {
3362ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* it's a LL */
3363b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            if (tyRes != Ity_I64 && tyRes != Ity_I32
3364b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                && tyRes != Ity_I16 && tyRes != Ity_I8)
3365ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Ist.LLSC(LL).result :: bogus");
3366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
3367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* it's a SC */
3368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (tyRes != Ity_I1)
3369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Ist.LLSC(SC).result: not :: Ity_I1");
3370ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tyData = typeOfIRExpr(tyenv, stmt->Ist.LLSC.storedata);
3371b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            if (tyData != Ity_I64 && tyData != Ity_I32
3372b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                && tyData != Ity_I16 && tyData != Ity_I8)
3373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,
3374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               "Ist.LLSC(SC).result :: storedata bogus");
3375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* Mostly check for various kinds of ill-formed dirty calls. */
3380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         d = stmt->Ist.Dirty.details;
3381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->cee == NULL) goto bad_dirty;
3382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRCallee(d->cee)) goto bad_dirty;
3383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->cee->regparms > countArgs(d->args)) goto bad_dirty;
3384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->mFx == Ifx_None) {
3385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->mAddr != NULL || d->mSize != 0)
3386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_dirty;
3387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
3388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->mAddr == NULL || d->mSize == 0)
3389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_dirty;
3390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->nFxState < 0 || d->nFxState > VEX_N_FXSTATE)
3392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_dirty;
3393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->nFxState == 0 && d->needsBBP)
3394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_dirty;
3395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; i < d->nFxState; i++) {
3396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->fxState[i].fx == Ifx_None) goto bad_dirty;
3397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->fxState[i].size <= 0) goto bad_dirty;
3398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check types, minimally */
3400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->guard == NULL) goto bad_dirty;
3401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, d->guard, gWordTy );
3402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, d->guard) != Ity_I1)
3403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Dirty.guard not :: Ity_I1");
3404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->tmp != IRTemp_INVALID
3405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             && typeOfIRTemp(tyenv, d->tmp) == Ity_I1)
3406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Dirty.dst :: Ity_I1");
3407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; d->args[i] != NULL; i++) {
3408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (i >= 32)
3409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"IRStmt.Dirty: > 32 args");
3410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (typeOfIRExpr(tyenv, d->args[i]) == Ity_I1)
3411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"IRStmt.Dirty.arg[i] :: Ity_I1");
3412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         bad_dirty:
3415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb,stmt,"IRStmt.Dirty: ill-formed");
3416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
3418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
3420ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         switch (stmt->Ist.MBE.event) {
3421b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            case Imbe_Fence: case Imbe_CancelReservation:
3422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               break;
3423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            default: sanityCheckFail(bb,stmt,"IRStmt.MBE.event: unknown");
3424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               break;
3425ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3426ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3427ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
3428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Exit.guard, gWordTy );
3429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.Exit.guard) != Ity_I1)
3430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Exit.guard: not :: Ity_I1");
3431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRConst(stmt->Ist.Exit.dst))
3432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: bad dst");
3433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRConst(stmt->Ist.Exit.dst) != gWordTy)
3434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: not :: guest word type");
3435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("tcStmt");
3438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid sanityCheckIRSB ( IRSB* bb,          HChar* caller,
3442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                       Bool require_flat, IRType guest_word_size )
3443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int     i;
3445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* stmt;
3446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int     n_temps    = bb->tyenv->types_used;
3447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int*    def_counts = LibVEX_Alloc(n_temps * sizeof(Int));
3448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3449ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (0)
3450ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("sanityCheck: %s\n", caller);
3451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(guest_word_size == Ity_I32
3453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown           || guest_word_size == Ity_I64);
3454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3455ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (bb->stmts_used < 0 || bb->stmts_size < 8
3456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown       || bb->stmts_used > bb->stmts_size)
3457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* this BB is so strange we can't even print it */
3458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vpanic("sanityCheckIRSB: stmts array limits wierd");
3459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Ensure each temp has a plausible type. */
3461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < n_temps; i++) {
3462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRType ty = typeOfIRTemp(bb->tyenv,(IRTemp)i);
3463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (!isPlausibleIRType(ty)) {
3464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("Temp t%d declared with implausible type 0x%x\n",
3465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    i, (UInt)ty);
3466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb,NULL,"Temp declared with implausible type");
3467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Check for flatness, if required. */
3471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (require_flat) {
3472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; i < bb->stmts_used; i++) {
3473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         stmt = bb->stmts[i];
3474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!stmt)
3475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt, "IRStmt: is NULL");
3476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!isFlatIRStmt(stmt))
3477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt, "IRStmt: is not flat");
3478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (!isIRAtom(bb->next))
3480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb, NULL, "bb->next is not an atom");
3481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Count the defs of each temp.  Only one def is allowed.
3484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      Also, check that each used temp has already been defd. */
3485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < n_temps; i++)
3487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      def_counts[i] = 0;
3488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb->stmts_used; i++) {
3490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRDirty* d;
3491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRCAS*   cas;
3492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      stmt = bb->stmts[i];
3493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* Check any temps used by this statement. */
3494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      useBeforeDef_Stmt(bb,stmt,def_counts);
3495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* Now make note of any temps defd by this statement. */
3497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      switch (stmt->tag) {
3498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.WrTmp.tmp < 0 || stmt->Ist.WrTmp.tmp >= n_temps)
3500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.Tmp: destination tmp is out of range");
3502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         def_counts[stmt->Ist.WrTmp.tmp]++;
3503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (def_counts[stmt->Ist.WrTmp.tmp] > 1)
3504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.Tmp: destination tmp is assigned more than once");
3506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.Dirty.details->tmp != IRTemp_INVALID) {
3511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            d = stmt->Ist.Dirty.details;
3512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->tmp < 0 || d->tmp >= n_temps)
3513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb, stmt,
3514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  "IRStmt.Dirty: destination tmp is out of range");
3515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            def_counts[d->tmp]++;
3516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (def_counts[d->tmp] > 1)
3517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb, stmt,
3518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  "IRStmt.Dirty: destination tmp is assigned more than once");
3519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3521ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3522ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = stmt->Ist.CAS.details;
3523ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi != IRTemp_INVALID) {
3524ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (cas->oldHi < 0 || cas->oldHi >= n_temps)
3525ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                sanityCheckFail(bb, stmt,
3526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   "IRStmt.CAS: destination tmpHi is out of range");
3527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             def_counts[cas->oldHi]++;
3528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             if (def_counts[cas->oldHi] > 1)
3529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                sanityCheckFail(bb, stmt,
3530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   "IRStmt.CAS: destination tmpHi is assigned more than once");
3531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldLo < 0 || cas->oldLo >= n_temps)
3533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.CAS: destination tmpLo is out of range");
3535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         def_counts[cas->oldLo]++;
3536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (def_counts[cas->oldLo] > 1)
3537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.CAS: destination tmpLo is assigned more than once");
3539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
3541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.result < 0 || stmt->Ist.LLSC.result >= n_temps)
3542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.LLSC: destination tmp is out of range");
3544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         def_counts[stmt->Ist.LLSC.result]++;
3545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (def_counts[stmt->Ist.LLSC.result] > 1)
3546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.LLSC: destination tmp is assigned more than once");
3548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* explicitly handle the rest, so as to keep gcc quiet */
3551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Typecheck everything. */
3556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb->stmts_used; i++)
3557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (bb->stmts[i])
3558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcStmt( bb, bb->stmts[i], guest_word_size );
3559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (typeOfIRExpr(bb->tyenv,bb->next) != guest_word_size)
3560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sanityCheckFail(bb, NULL, "bb->next field has wrong type");
3561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Misc helper functions                                   ---*/
3565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool eqIRConst ( IRConst* c1, IRConst* c2 )
3568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (c1->tag != c2->tag)
3570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (c1->tag) {
3573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:  return toBool( (1 & c1->Ico.U1) == (1 & c2->Ico.U1) );
3574ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:  return toBool( c1->Ico.U8  == c2->Ico.U8 );
3575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16: return toBool( c1->Ico.U16 == c2->Ico.U16 );
3576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32: return toBool( c1->Ico.U32 == c2->Ico.U32 );
3577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64: return toBool( c1->Ico.U64 == c2->Ico.U64 );
3578b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32: return toBool( c1->Ico.F32 == c2->Ico.F32 );
3579b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i: return toBool( c1->Ico.F32i == c2->Ico.F32i );
3580ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64: return toBool( c1->Ico.F64 == c2->Ico.F64 );
3581ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i: return toBool( c1->Ico.F64i == c2->Ico.F64i );
3582ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128: return toBool( c1->Ico.V128 == c2->Ico.V128 );
3583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("eqIRConst");
3584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3587ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool eqIRRegArray ( IRRegArray* descr1, IRRegArray* descr2 )
3588ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3589ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return toBool( descr1->base == descr2->base
3590ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  && descr1->elemTy == descr2->elemTy
3591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  && descr1->nElems == descr2->nElems );
3592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownInt sizeofIRType ( IRType ty )
3595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (ty) {
3597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I8:   return 1;
3598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I16:  return 2;
3599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I32:  return 4;
3600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I64:  return 8;
3601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I128: return 16;
3602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_F32:  return 4;
3603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_F64:  return 8;
3604b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ity_F128: return 16;
3605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_V128: return 16;
3606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vex_printf("\n"); ppIRType(ty); vex_printf("\n");
3607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               vpanic("sizeofIRType");
3608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* mkIRExpr_HWord ( HWord hw )
3612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(sizeof(void*) == sizeof(HWord));
3614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (sizeof(HWord) == 4)
3615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return IRExpr_Const(IRConst_U32((UInt)hw));
3616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (sizeof(HWord) == 8)
3617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return IRExpr_Const(IRConst_U64((ULong)hw));
3618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vpanic("mkIRExpr_HWord");
3619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* unsafeIRDirty_0_N ( Int regparms, HChar* name, void* addr,
3622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             IRExpr** args )
3623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d = emptyIRDirty();
3625ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->cee   = mkIRCallee ( regparms, name, addr );
3626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->guard = IRExpr_Const(IRConst_U1(True));
3627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->args  = args;
3628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d;
3629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* unsafeIRDirty_1_N ( IRTemp dst,
3632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             Int regparms, HChar* name, void* addr,
3633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             IRExpr** args )
3634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d = emptyIRDirty();
3636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->cee   = mkIRCallee ( regparms, name, addr );
3637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->guard = IRExpr_Const(IRConst_U1(True));
3638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->args  = args;
3639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->tmp   = dst;
3640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d;
3641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* mkIRExprCCall ( IRType retty,
3644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        Int regparms, HChar* name, void* addr,
3645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        IRExpr** args )
3646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return IRExpr_CCall ( mkIRCallee ( regparms, name, addr ),
3648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         retty, args );
3649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool eqIRAtom ( IRExpr* a1, IRExpr* a2 )
3652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(isIRAtom(a1));
3654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(isIRAtom(a2));
3655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (a1->tag == Iex_RdTmp && a2->tag == Iex_RdTmp)
3656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return toBool(a1->Iex.RdTmp.tmp == a2->Iex.RdTmp.tmp);
3657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (a1->tag == Iex_Const && a2->tag == Iex_Const)
3658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return eqIRConst(a1->Iex.Const.con, a2->Iex.Const.con);
3659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return False;
3660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- end                                           ir_defs.c ---*/
3664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3665