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
10663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   Copyright (C) 2004-2012 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;
60663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D32:     vex_printf( "D32");  break;
61663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D64:     vex_printf( "D64");  break;
62663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D128:    vex_printf( "D128"); break;
63ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_V128:    vex_printf( "V128"); break;
64663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_V256:    vex_printf( "V256"); break;
65ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vex_printf("ty = 0x%x\n", (Int)ty);
66ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               vpanic("ppIRType");
67ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
68ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
69ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
70ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRConst ( IRConst* con )
71ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
72b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   union { ULong i64; Double f64; UInt i32; Float f32; } u;
73ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(sizeof(ULong) == sizeof(Double));
74ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (con->tag) {
75ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:   vex_printf( "%d:I1",        con->Ico.U1 ? 1 : 0); break;
76ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:   vex_printf( "0x%x:I8",      (UInt)(con->Ico.U8)); break;
77ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16:  vex_printf( "0x%x:I16",     (UInt)(con->Ico.U16)); break;
78ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32:  vex_printf( "0x%x:I32",     (UInt)(con->Ico.U32)); break;
79ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64:  vex_printf( "0x%llx:I64",   (ULong)(con->Ico.U64)); break;
80b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32:  u.f32 = con->Ico.F32;
81b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     vex_printf( "F32{0x%x}",   u.i32);
82b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     break;
83b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i: vex_printf( "F32i{0x%x}",   con->Ico.F32i); break;
84ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64:  u.f64 = con->Ico.F64;
85ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                     vex_printf( "F64{0x%llx}",  u.i64);
86ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                     break;
87ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i: vex_printf( "F64i{0x%llx}", con->Ico.F64i); break;
88ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128: vex_printf( "V128{0x%04x}", (UInt)(con->Ico.V128)); break;
89663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ico_V256: vex_printf( "V256{0x%08x}", con->Ico.V256); break;
90ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIRConst");
91ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
92ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
93ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
94ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRCallee ( IRCallee* ce )
95ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
96ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("%s", ce->name);
97ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (ce->regparms > 0)
98ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("[rp=%d]", ce->regparms);
99ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (ce->mcx_mask > 0)
100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("[mcx=0x%x]", ce->mcx_mask);
101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("{%p}", (void*)ce->addr);
102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRRegArray ( IRRegArray* arr )
105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("(%d:%dx", arr->base, arr->nElems);
107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRType(arr->elemTy);
108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(")");
109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRTemp ( IRTemp tmp )
112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (tmp == IRTemp_INVALID)
114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("IRTemp_INVALID");
115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   else
116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "t%d", (Int)tmp);
117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIROp ( IROp op )
120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   HChar* str = NULL;
122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IROp   base;
123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (op) {
124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8 ... Iop_Add64:
125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Add"; base = Iop_Add8; break;
126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8 ... Iop_Sub64:
127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Sub"; base = Iop_Sub8; break;
128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8 ... Iop_Mul64:
129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Mul"; base = Iop_Mul8; break;
130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or8 ... Iop_Or64:
131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Or"; base = Iop_Or8; break;
132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_And8 ... Iop_And64:
133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "And"; base = Iop_And8; break;
134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Xor8 ... Iop_Xor64:
135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Xor"; base = Iop_Xor8; break;
136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8 ... Iop_Shl64:
137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Shl"; base = Iop_Shl8; break;
138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8 ... Iop_Shr64:
139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Shr"; base = Iop_Shr8; break;
140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8 ... Iop_Sar64:
141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Sar"; base = Iop_Sar8; break;
142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8 ... Iop_CmpEQ64:
143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CmpEQ"; base = Iop_CmpEQ8; break;
144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNE8 ... Iop_CmpNE64:
145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CmpNE"; base = Iop_CmpNE8; break;
146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ8 ... Iop_CasCmpEQ64:
147ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CasCmpEQ"; base = Iop_CasCmpEQ8; break;
148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpNE8 ... Iop_CasCmpNE64:
149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "CasCmpNE"; base = Iop_CasCmpNE8; break;
150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not8 ... Iop_Not64:
151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         str = "Not"; base = Iop_Not8; break;
152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* other cases must explicitly "return;" */
153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto16:   vex_printf("8Uto16");  return;
154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto32:   vex_printf("8Uto32");  return;
155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto32:  vex_printf("16Uto32"); return;
156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Sto16:   vex_printf("8Sto16");  return;
157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Sto32:   vex_printf("8Sto32");  return;
158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Sto32:  vex_printf("16Sto32"); return;
159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32Sto64:  vex_printf("32Sto64"); return;
160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32Uto64:  vex_printf("32Uto64"); return;
161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to8:    vex_printf("32to8");   return;
162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto64:  vex_printf("16Uto64"); return;
163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Sto64:  vex_printf("16Sto64"); return;
164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto64:   vex_printf("8Uto64"); return;
165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Sto64:   vex_printf("8Sto64"); return;
166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to16:   vex_printf("64to16"); return;
167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to8:    vex_printf("64to8");  return;
168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not1:     vex_printf("Not1");    return;
170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to1:    vex_printf("32to1");   return;
171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to1:    vex_printf("64to1");   return;
172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto8:    vex_printf("1Uto8");   return;
173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto32:   vex_printf("1Uto32");  return;
174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto64:   vex_printf("1Uto64");  return;
175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto8:    vex_printf("1Sto8");  return;
176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto16:   vex_printf("1Sto16");  return;
177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto32:   vex_printf("1Sto32");  return;
178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto64:   vex_printf("1Sto64");  return;
179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS8:   vex_printf("MullS8");  return;
181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS16:  vex_printf("MullS16"); return;
182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS32:  vex_printf("MullS32"); return;
183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullS64:  vex_printf("MullS64"); return;
184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU8:   vex_printf("MullU8");  return;
185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU16:  vex_printf("MullU16"); return;
186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU32:  vex_printf("MullU32"); return;
187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU64:  vex_printf("MullU64"); return;
188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz64:    vex_printf("Clz64"); return;
190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32:    vex_printf("Clz32"); return;
191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Ctz64:    vex_printf("Ctz64"); return;
192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Ctz32:    vex_printf("Ctz32"); return;
193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32S: vex_printf("CmpLT32S"); return;
195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32S: vex_printf("CmpLE32S"); return;
196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32U: vex_printf("CmpLT32U"); return;
197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32U: vex_printf("CmpLE32U"); return;
198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64S: vex_printf("CmpLT64S"); return;
200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64S: vex_printf("CmpLE64S"); return;
201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64U: vex_printf("CmpLT64U"); return;
202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64U: vex_printf("CmpLE64U"); return;
203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
204ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8:  vex_printf("CmpNEZ8"); return;
205ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16: vex_printf("CmpNEZ16"); return;
206ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32: vex_printf("CmpNEZ32"); return;
207ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ64: vex_printf("CmpNEZ64"); return;
208ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
209ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ32: vex_printf("CmpwNEZ32"); return;
210ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ64: vex_printf("CmpwNEZ64"); return;
211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
212ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left8:  vex_printf("Left8"); return;
213ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left16: vex_printf("Left16"); return;
214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left32: vex_printf("Left32"); return;
215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left64: vex_printf("Left64"); return;
216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32U: vex_printf("Max32U"); return;
217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32U: vex_printf("CmpORD32U"); return;
219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32S: vex_printf("CmpORD32S"); return;
220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64U: vex_printf("CmpORD64U"); return;
222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64S: vex_printf("CmpORD64S"); return;
223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivU32: vex_printf("DivU32"); return;
225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivS32: vex_printf("DivS32"); return;
226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivU64: vex_printf("DivU64"); return;
227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivS64: vex_printf("DivS64"); return;
228b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU64E: vex_printf("DivU64E"); return;
229b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivS64E: vex_printf("DivS64E"); return;
230b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU32E: vex_printf("DivU32E"); return;
231b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivS32E: vex_printf("DivS32E"); return;
232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU64to32: vex_printf("DivModU64to32"); return;
234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModS64to32: vex_printf("DivModS64to32"); return;
235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU128to64: vex_printf("DivModU128to64"); return;
237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModS128to64: vex_printf("DivModS128to64"); return;
238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
239b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivModS64to64: vex_printf("DivModS64to64"); return;
240b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HIto8:  vex_printf("16HIto8"); return;
242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16to8:    vex_printf("16to8");   return;
243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8HLto16:  vex_printf("8HLto16"); return;
244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HIto16: vex_printf("32HIto16"); return;
246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to16:   vex_printf("32to16");   return;
247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HLto32: vex_printf("16HLto32"); return;
248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HIto32: vex_printf("64HIto32"); return;
250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to32:   vex_printf("64to32");   return;
251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HLto64: vex_printf("32HLto64"); return;
252ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_128HIto64: vex_printf("128HIto64"); return;
254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_128to64:   vex_printf("128to64");   return;
255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HLto128: vex_printf("64HLto128"); return;
256ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
257b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF32:    vex_printf("CmpF32");    return;
258b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI16S: vex_printf("F32toI16S");  return;
259b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI32S: vex_printf("F32toI32S");  return;
260b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI64S: vex_printf("F32toI64S");  return;
261b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I16StoF32: vex_printf("I16StoF32");  return;
262b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF32: vex_printf("I32StoF32");  return;
263b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF32: vex_printf("I64StoF32");  return;
264b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
265ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64:    vex_printf("AddF64"); return;
266ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SubF64:    vex_printf("SubF64"); return;
267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64:    vex_printf("MulF64"); return;
268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivF64:    vex_printf("DivF64"); return;
269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64r32: vex_printf("AddF64r32"); return;
270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SubF64r32: vex_printf("SubF64r32"); return;
271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64r32: vex_printf("MulF64r32"); return;
272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivF64r32: vex_printf("DivF64r32"); return;
273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF32:    vex_printf("AddF32"); return;
274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SubF32:    vex_printf("SubF32"); return;
275ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF32:    vex_printf("MulF32"); return;
276ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivF32:    vex_printf("DivF32"); return;
277ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
278b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        /* 128 bit floating point */
279b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AddF128:   vex_printf("AddF128");  return;
280b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SubF128:   vex_printf("SubF128");  return;
281b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MulF128:   vex_printf("MulF128");  return;
282b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivF128:   vex_printf("DivF128");  return;
283b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AbsF128:   vex_printf("AbsF128");  return;
284b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NegF128:   vex_printf("NegF128");  return;
285b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SqrtF128:  vex_printf("SqrtF128"); return;
286b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF128:   vex_printf("CmpF128");  return;
287b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
288b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64HLtoF128: vex_printf("F64HLtoF128"); return;
289b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128HItoF64: vex_printf("F128HItoF64"); return;
290b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128LOtoF64: vex_printf("F128LOtoF64"); return;
291b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF128: vex_printf("I32StoF128"); return;
292b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF128: vex_printf("I64StoF128"); return;
293b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI32S: vex_printf("F128toI32S"); return;
294b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI64S: vex_printf("F128toI64S"); return;
295b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toF128:  vex_printf("F32toF128");  return;
296b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toF128:  vex_printf("F64toF128");  return;
297b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF64:  vex_printf("F128toF64");  return;
298b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF32:  vex_printf("F128toF32");  return;
299b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
300b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        /* s390 specific */
301b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MAddF32:    vex_printf("s390_MAddF32"); return;
302b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MSubF32:    vex_printf("s390_MSubF32"); return;
303b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ScaleF64:      vex_printf("ScaleF64"); return;
305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AtanF64:       vex_printf("AtanF64"); return;
306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Yl2xF64:       vex_printf("Yl2xF64"); return;
307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Yl2xp1F64:     vex_printf("Yl2xp1F64"); return;
308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRemF64:       vex_printf("PRemF64"); return;
309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRemC3210F64:  vex_printf("PRemC3210F64"); return;
310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRem1F64:      vex_printf("PRem1F64"); return;
311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRem1C3210F64: vex_printf("PRem1C3210F64"); return;
312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF64:        vex_printf("NegF64"); return;
313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AbsF64:        vex_printf("AbsF64"); return;
314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF32:        vex_printf("NegF32"); return;
315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AbsF32:        vex_printf("AbsF32"); return;
316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF64:       vex_printf("SqrtF64"); return;
317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF32:       vex_printf("SqrtF32"); return;
318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SinF64:    vex_printf("SinF64"); return;
319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CosF64:    vex_printf("CosF64"); return;
320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_TanF64:    vex_printf("TanF64"); return;
321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_2xm1F64:   vex_printf("2xm1F64"); return;
322ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
323ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64:    vex_printf("MAddF64"); return;
324ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MSubF64:    vex_printf("MSubF64"); return;
325ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64r32: vex_printf("MAddF64r32"); return;
326ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MSubF64r32: vex_printf("MSubF64r32"); return;
327ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
328ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Est5FRSqrt:    vex_printf("Est5FRSqrt"); return;
329ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_NEAREST: vex_printf("RoundF64toF64_NEAREST"); return;
330ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_NegINF: vex_printf("RoundF64toF64_NegINF"); return;
331ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_PosINF: vex_printf("RoundF64toF64_PosINF"); return;
332ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_ZERO: vex_printf("RoundF64toF64_ZERO"); return;
333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_TruncF64asF32: vex_printf("TruncF64asF32"); return;
335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CalcFPRF:      vex_printf("CalcFPRF"); return;
336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
337663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QAdd32S: vex_printf("QAdd32S"); return;
338663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QSub32S: vex_printf("QSub32S"); return;
339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x2:   vex_printf("Add16x2"); return;
340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub16x2:   vex_printf("Sub16x2"); return;
341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx2: vex_printf("QAdd16Sx2"); return;
342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Ux2: vex_printf("QAdd16Ux2"); return;
343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx2: vex_printf("QSub16Sx2"); return;
344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Ux2: vex_printf("QSub16Ux2"); return;
345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd16Ux2: vex_printf("HAdd16Ux2"); return;
346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd16Sx2: vex_printf("HAdd16Sx2"); return;
347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub16Ux2: vex_printf("HSub16Ux2"); return;
348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub16Sx2: vex_printf("HSub16Sx2"); return;
349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
350ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x4:   vex_printf("Add8x4"); return;
351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x4:   vex_printf("Sub8x4"); return;
352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx4: vex_printf("QAdd8Sx4"); return;
353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux4: vex_printf("QAdd8Ux4"); return;
354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx4: vex_printf("QSub8Sx4"); return;
355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux4: vex_printf("QSub8Ux4"); return;
356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd8Ux4: vex_printf("HAdd8Ux4"); return;
357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd8Sx4: vex_printf("HAdd8Sx4"); return;
358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub8Ux4: vex_printf("HSub8Ux4"); return;
359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub8Sx4: vex_printf("HSub8Sx4"); return;
360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sad8Ux4:  vex_printf("Sad8Ux4"); return;
361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
362ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x2: vex_printf("CmpNEZ16x2"); return;
363ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x4:  vex_printf("CmpNEZ8x4"); return;
364ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
365ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpF64:    vex_printf("CmpF64"); return;
366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI16S: vex_printf("F64toI16S"); return;
368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32S: vex_printf("F64toI32S"); return;
369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI64S: vex_printf("F64toI64S"); return;
370b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toI64U: vex_printf("F64toI64U"); return;
371ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
372ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32U: vex_printf("F64toI32U"); return;
373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I16StoF64: vex_printf("I16StoF64"); return;
375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoF64: vex_printf("I32StoF64"); return;
376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I64StoF64: vex_printf("I64StoF64"); return;
377b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF64: vex_printf("I64UtoF64"); return;
378b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF32: vex_printf("I64UtoF32"); return;
379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoF64: vex_printf("I32UtoF64"); return;
381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF64: vex_printf("F32toF64"); return;
383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toF32: vex_printf("F64toF32"); return;
384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toInt: vex_printf("RoundF64toInt"); return;
386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32toInt: vex_printf("RoundF32toInt"); return;
387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF32: vex_printf("RoundF64toF32"); return;
388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF64asI64: vex_printf("ReinterpF64asI64"); return;
390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI64asF64: vex_printf("ReinterpI64asF64"); return;
391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF32asI32: vex_printf("ReinterpF32asI32"); return;
392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI32asF32: vex_printf("ReinterpI32asF32"); return;
393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoFx4: vex_printf("I32UtoFx4"); return;
395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx4: vex_printf("I32StoFx4"); return;
396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF16x4: vex_printf("F32toF16x4"); return;
398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F16toF32x4: vex_printf("F16toF32x4"); return;
399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx4: vex_printf("VRsqrte32Fx4"); return;
401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x4:  vex_printf("VRsqrte32x4"); return;
402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx2: vex_printf("VRsqrte32Fx2"); return;
403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x2:  vex_printf("VRsqrte32x2"); return;
404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Ux4_RZ: vex_printf("QFtoI32Ux4_RZ"); return;
406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Sx4_RZ: vex_printf("QFtoI32Sx4_RZ"); return;
407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Ux4_RZ: vex_printf("FtoI32Ux4_RZ"); return;
409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx4_RZ: vex_printf("FtoI32Sx4_RZ"); return;
410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoFx2: vex_printf("I32UtoFx2"); return;
412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx2: vex_printf("I32StoFx2"); return;
413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Ux2_RZ: vex_printf("FtoI32Ux2_RZ"); return;
415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx2_RZ: vex_printf("FtoI32Sx2_RZ"); return;
416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RM: vex_printf("RoundF32x4_RM"); return;
418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RP: vex_printf("RoundF32x4_RP"); return;
419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RN: vex_printf("RoundF32x4_RN"); return;
420ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RZ: vex_printf("RoundF32x4_RZ"); return;
421ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x8: vex_printf("Abs8x8"); return;
423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs16x4: vex_printf("Abs16x4"); return;
424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32x2: vex_printf("Abs32x2"); return;
425ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x8: vex_printf("Add8x8"); return;
426ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x4: vex_printf("Add16x4"); return;
427ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32x2: vex_printf("Add32x2"); return;
428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux8: vex_printf("QAdd8Ux8"); return;
429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Ux4: vex_printf("QAdd16Ux4"); return;
430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux2: vex_printf("QAdd32Ux2"); return;
431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Ux1: vex_printf("QAdd64Ux1"); return;
432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx8: vex_printf("QAdd8Sx8"); return;
433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx4: vex_printf("QAdd16Sx4"); return;
434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx2: vex_printf("QAdd32Sx2"); return;
435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Sx1: vex_printf("QAdd64Sx1"); return;
436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x8: vex_printf("PwAdd8x8"); return;
437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd16x4: vex_printf("PwAdd16x4"); return;
438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32x2: vex_printf("PwAdd32x2"); return;
439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32Fx2: vex_printf("PwAdd32Fx2"); return;
440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux8: vex_printf("PwAddL8Ux8"); return;
441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Ux4: vex_printf("PwAddL16Ux4"); return;
442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Ux2: vex_printf("PwAddL32Ux2"); return;
443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx8: vex_printf("PwAddL8Sx8"); return;
444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Sx4: vex_printf("PwAddL16Sx4"); return;
445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Sx2: vex_printf("PwAddL32Sx2"); return;
446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x8: vex_printf("Sub8x8"); return;
447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub16x4: vex_printf("Sub16x4"); return;
448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32x2: vex_printf("Sub32x2"); return;
449ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux8: vex_printf("QSub8Ux8"); return;
450ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Ux4: vex_printf("QSub16Ux4"); return;
451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux2: vex_printf("QSub32Ux2"); return;
452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Ux1: vex_printf("QSub64Ux1"); return;
453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx8: vex_printf("QSub8Sx8"); return;
454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx4: vex_printf("QSub16Sx4"); return;
455ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx2: vex_printf("QSub32Sx2"); return;
456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Sx1: vex_printf("QSub64Sx1"); return;
457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x8: vex_printf("Mul8x8"); return;
458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul16x4: vex_printf("Mul16x4"); return;
459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32x2: vex_printf("Mul32x2"); return;
460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx2: vex_printf("Mul32Fx2"); return;
461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x8: vex_printf("PolynomialMul8x8"); return;
462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Ux4: vex_printf("MulHi16Ux4"); return;
463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx4: vex_printf("MulHi16Sx4"); return;
464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx4: vex_printf("QDMulHi16Sx4"); return;
465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi32Sx2: vex_printf("QDMulHi32Sx2"); return;
466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx4: vex_printf("QRDMulHi16Sx4"); return;
467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi32Sx2: vex_printf("QRDMulHi32Sx2"); return;
468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulLong16Sx4: vex_printf("QDMulLong16Sx4"); return;
469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulLong32Sx2: vex_printf("QDMulLong32Sx2"); return;
470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux8: vex_printf("Avg8Ux8"); return;
471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg16Ux4: vex_printf("Avg16Ux4"); return;
472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx8: vex_printf("Max8Sx8"); return;
473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Sx4: vex_printf("Max16Sx4"); return;
474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Sx2: vex_printf("Max32Sx2"); return;
475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux8: vex_printf("Max8Ux8"); return;
476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Ux4: vex_printf("Max16Ux4"); return;
477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Ux2: vex_printf("Max32Ux2"); return;
478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx8: vex_printf("Min8Sx8"); return;
479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Sx4: vex_printf("Min16Sx4"); return;
480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Sx2: vex_printf("Min32Sx2"); return;
481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux8: vex_printf("Min8Ux8"); return;
482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Ux4: vex_printf("Min16Ux4"); return;
483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Ux2: vex_printf("Min32Ux2"); return;
484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Sx8: vex_printf("PwMax8Sx8"); return;
485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax16Sx4: vex_printf("PwMax16Sx4"); return;
486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Sx2: vex_printf("PwMax32Sx2"); return;
487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Ux8: vex_printf("PwMax8Ux8"); return;
488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax16Ux4: vex_printf("PwMax16Ux4"); return;
489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Ux2: vex_printf("PwMax32Ux2"); return;
490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Sx8: vex_printf("PwMin8Sx8"); return;
491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin16Sx4: vex_printf("PwMin16Sx4"); return;
492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Sx2: vex_printf("PwMin32Sx2"); return;
493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Ux8: vex_printf("PwMin8Ux8"); return;
494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin16Ux4: vex_printf("PwMin16Ux4"); return;
495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Ux2: vex_printf("PwMin32Ux2"); return;
496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x8: vex_printf("CmpEQ8x8"); return;
497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ16x4: vex_printf("CmpEQ16x4"); return;
498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32x2: vex_printf("CmpEQ32x2"); return;
499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux8: vex_printf("CmpGT8Ux8"); return;
500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Ux4: vex_printf("CmpGT16Ux4"); return;
501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Ux2: vex_printf("CmpGT32Ux2"); return;
502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx8: vex_printf("CmpGT8Sx8"); return;
503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Sx4: vex_printf("CmpGT16Sx4"); return;
504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Sx2: vex_printf("CmpGT32Sx2"); return;
505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x8: vex_printf("Cnt8x8"); return;
506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx8: vex_printf("Clz8Sx8"); return;
507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz16Sx4: vex_printf("Clz16Sx4"); return;
508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32Sx2: vex_printf("Clz32Sx2"); return;
509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx8: vex_printf("Cls8Sx8"); return;
510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls16Sx4: vex_printf("Cls16Sx4"); return;
511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls32Sx2: vex_printf("Cls32Sx2"); return;
512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN8x8: vex_printf("ShlN8x8"); return;
513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN16x4: vex_printf("ShlN16x4"); return;
514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x2: vex_printf("ShlN32x2"); return;
515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN8x8: vex_printf("ShrN8x8"); return;
516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN16x4: vex_printf("ShrN16x4"); return;
517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x2: vex_printf("ShrN32x2"); return;
518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN8x8: vex_printf("SarN8x8"); return;
519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN16x4: vex_printf("SarN16x4"); return;
520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x2: vex_printf("SarN32x2"); return;
521b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Ux8: vex_printf("QNarrowBin16Sto8Ux8"); return;
522b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx8: vex_printf("QNarrowBin16Sto8Sx8"); return;
523b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Sx4: vex_printf("QNarrowBin32Sto16Sx4"); return;
524b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x8: vex_printf("NarrowBin16to8x8"); return;
525b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin32to16x4: vex_printf("NarrowBin32to16x4"); return;
526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x8: vex_printf("InterleaveHI8x8"); return;
527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI16x4: vex_printf("InterleaveHI16x4"); return;
528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x2: vex_printf("InterleaveHI32x2"); return;
529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO8x8: vex_printf("InterleaveLO8x8"); return;
530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO16x4: vex_printf("InterleaveLO16x4"); return;
531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO32x2: vex_printf("InterleaveLO32x2"); return;
532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x8: vex_printf("CatOddLanes8x8"); return;
533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x4: vex_printf("CatOddLanes16x4"); return;
534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes8x8: vex_printf("CatEvenLanes8x8"); return;
535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes16x4: vex_printf("CatEvenLanes16x4"); return;
536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x8: vex_printf("InterleaveOddLanes8x8"); return;
537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x4: vex_printf("InterleaveOddLanes16x4"); return;
538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes8x8: vex_printf("InterleaveEvenLanes8x8"); return;
539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes16x4: vex_printf("InterleaveEvenLanes16x4"); return;
540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x8: vex_printf("Shl8x8"); return;
541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl16x4: vex_printf("Shl16x4"); return;
542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl32x2: vex_printf("Shl32x2"); return;
543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x8: vex_printf("Shr8x8"); return;
544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr16x4: vex_printf("Shr16x4"); return;
545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr32x2: vex_printf("Shr32x2"); return;
546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl8x8: vex_printf("QShl8x8"); return;
547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl16x4: vex_printf("QShl16x4"); return;
548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl32x2: vex_printf("QShl32x2"); return;
549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl64x1: vex_printf("QShl64x1"); return;
550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal8x8: vex_printf("QSal8x8"); return;
551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal16x4: vex_printf("QSal16x4"); return;
552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal32x2: vex_printf("QSal32x2"); return;
553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal64x1: vex_printf("QSal64x1"); return;
554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x8: vex_printf("QShlN8x8"); return;
555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16x4: vex_printf("QShlN16x4"); return;
556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x2: vex_printf("QShlN32x2"); return;
557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64x1: vex_printf("QShlN64x1"); return;
558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx8: vex_printf("QShlN8Sx8"); return;
559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16Sx4: vex_printf("QShlN16Sx4"); return;
560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx2: vex_printf("QShlN32Sx2"); return;
561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64Sx1: vex_printf("QShlN64Sx1"); return;
562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x8: vex_printf("QSalN8x8"); return;
563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN16x4: vex_printf("QSalN16x4"); return;
564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x2: vex_printf("QSalN32x2"); return;
565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN64x1: vex_printf("QSalN64x1"); return;
566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x8: vex_printf("Sar8x8"); return;
567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar16x4: vex_printf("Sar16x4"); return;
568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar32x2: vex_printf("Sar32x2"); return;
569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x8: vex_printf("Sal8x8"); return;
570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal16x4: vex_printf("Sal16x4"); return;
571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal32x2: vex_printf("Sal32x2"); return;
572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal64x1: vex_printf("Sal64x1"); return;
573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x8: vex_printf("Perm8x8"); return;
574ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x8: vex_printf("Reverse16_8x8"); return;
575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x8: vex_printf("Reverse32_8x8"); return;
576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_16x4: vex_printf("Reverse32_16x4"); return;
577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x8: vex_printf("Reverse64_8x8"); return;
578ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_16x4: vex_printf("Reverse64_16x4"); return;
579ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_32x2: vex_printf("Reverse64_32x2"); return;
580ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx2: vex_printf("Abs32Fx2"); return;
581ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
582ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x2: vex_printf("CmpNEZ32x2"); return;
583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x4: vex_printf("CmpNEZ16x4"); return;
584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x8:  vex_printf("CmpNEZ8x8"); return;
585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx4:  vex_printf("Add32Fx4"); return;
587ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx2:  vex_printf("Add32Fx2"); return;
588ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32F0x4: vex_printf("Add32F0x4"); return;
589ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64Fx2:  vex_printf("Add64Fx2"); return;
590ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64F0x2: vex_printf("Add64F0x2"); return;
591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div32Fx4:  vex_printf("Div32Fx4"); return;
593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div32F0x4: vex_printf("Div32F0x4"); return;
594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div64Fx2:  vex_printf("Div64Fx2"); return;
595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div64F0x2: vex_printf("Div64F0x2"); return;
596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
597663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Max32Fx8:  vex_printf("Max32Fx8"); return;
598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx4:  vex_printf("Max32Fx4"); return;
599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx2:  vex_printf("Max32Fx2"); return;
600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx4:  vex_printf("PwMax32Fx4"); return;
601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx2:  vex_printf("PwMax32Fx2"); return;
602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32F0x4: vex_printf("Max32F0x4"); return;
603663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Max64Fx4:  vex_printf("Max64Fx4"); return;
604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max64Fx2:  vex_printf("Max64Fx2"); return;
605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max64F0x2: vex_printf("Max64F0x2"); return;
606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
607663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Min32Fx8:  vex_printf("Min32Fx8"); return;
608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Fx4:  vex_printf("Min32Fx4"); return;
609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Fx2:  vex_printf("Min32Fx2"); return;
610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Fx4:  vex_printf("PwMin32Fx4"); return;
611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin32Fx2:  vex_printf("PwMin32Fx2"); return;
612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32F0x4: vex_printf("Min32F0x4"); return;
613663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Min64Fx4:  vex_printf("Min64Fx4"); return;
614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min64Fx2:  vex_printf("Min64Fx2"); return;
615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min64F0x2: vex_printf("Min64F0x2"); return;
616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx4:  vex_printf("Mul32Fx4"); return;
618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32F0x4: vex_printf("Mul32F0x4"); return;
619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul64Fx2:  vex_printf("Mul64Fx2"); return;
620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul64F0x2: vex_printf("Mul64F0x2"); return;
621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x2: vex_printf("Recip32x2"); return;
623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32Fx2:  vex_printf("Recip32Fx2"); return;
624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32Fx4:  vex_printf("Recip32Fx4"); return;
625663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Recip32Fx8:  vex_printf("Recip32Fx8"); return;
626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x4:  vex_printf("Recip32x4"); return;
627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32F0x4: vex_printf("Recip32F0x4"); return;
628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip64Fx2:  vex_printf("Recip64Fx2"); return;
629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip64F0x2: vex_printf("Recip64F0x2"); return;
630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx2:  vex_printf("VRecps32Fx2"); return;
631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx4:  vex_printf("VRecps32Fx4"); return;
632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx4:  vex_printf("Abs32Fx4"); return;
633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx4:  vex_printf("VRsqrts32Fx4"); return;
634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx2:  vex_printf("VRsqrts32Fx2"); return;
635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt32Fx4:  vex_printf("RSqrt32Fx4"); return;
637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt32F0x4: vex_printf("RSqrt32F0x4"); return;
638663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_RSqrt32Fx8:  vex_printf("RSqrt32Fx8"); return;
639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt64Fx2:  vex_printf("RSqrt64Fx2"); return;
640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt64F0x2: vex_printf("RSqrt64F0x2"); return;
641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt32Fx4:  vex_printf("Sqrt32Fx4"); return;
643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt32F0x4: vex_printf("Sqrt32F0x4"); return;
644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt64Fx2:  vex_printf("Sqrt64Fx2"); return;
645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt64F0x2: vex_printf("Sqrt64F0x2"); return;
646663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Sqrt32Fx8:  vex_printf("Sqrt32Fx8"); return;
647663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Sqrt64Fx4:  vex_printf("Sqrt64Fx4"); return;
648663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32Fx4:  vex_printf("Sub32Fx4"); return;
650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32Fx2:  vex_printf("Sub32Fx2"); return;
651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32F0x4: vex_printf("Sub32F0x4"); return;
652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64Fx2:  vex_printf("Sub64Fx2"); return;
653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64F0x2: vex_printf("Sub64F0x2"); return;
654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32Fx4: vex_printf("CmpEQ32Fx4"); return;
656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32Fx4: vex_printf("CmpLT32Fx4"); return;
657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32Fx4: vex_printf("CmpLE32Fx4"); return;
658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx4: vex_printf("CmpGT32Fx4"); return;
659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGE32Fx4: vex_printf("CmpGE32Fx4"); return;
660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN32Fx4: vex_printf("CmpUN32Fx4"); return;
661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64Fx2: vex_printf("CmpEQ64Fx2"); return;
662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64Fx2: vex_printf("CmpLT64Fx2"); return;
663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64Fx2: vex_printf("CmpLE64Fx2"); return;
664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN64Fx2: vex_printf("CmpUN64Fx2"); return;
665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx2: vex_printf("CmpGT32Fx2"); return;
666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32Fx2: vex_printf("CmpEQ32Fx2"); return;
667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGE32Fx2: vex_printf("CmpGE32Fx2"); return;
668ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
669ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32F0x4: vex_printf("CmpEQ32F0x4"); return;
670ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32F0x4: vex_printf("CmpLT32F0x4"); return;
671ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32F0x4: vex_printf("CmpLE32F0x4"); return;
672ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN32F0x4: vex_printf("CmpUN32F0x4"); return;
673ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64F0x2: vex_printf("CmpEQ64F0x2"); return;
674ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64F0x2: vex_printf("CmpLT64F0x2"); return;
675ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64F0x2: vex_printf("CmpLE64F0x2"); return;
676ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpUN64F0x2: vex_printf("CmpUN64F0x2"); return;
677ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
678ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx4: vex_printf("Neg32Fx4"); return;
679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx2: vex_printf("Neg32Fx2"); return;
680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to64:   vex_printf("V128to64");   return;
682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128HIto64: vex_printf("V128HIto64"); return;
683ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HLtoV128: vex_printf("64HLtoV128"); return;
684ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
685ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64UtoV128:   vex_printf("64UtoV128"); return;
686ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo64: vex_printf("SetV128lo64"); return;
687ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
688ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32UtoV128:   vex_printf("32UtoV128"); return;
689ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to32:    vex_printf("V128to32"); return;
690ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo32: vex_printf("SetV128lo32"); return;
691ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
692ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x16: vex_printf("Dup8x16"); return;
693ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x8: vex_printf("Dup16x8"); return;
694ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x4: vex_printf("Dup32x4"); return;
695ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x8: vex_printf("Dup8x8"); return;
696ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x4: vex_printf("Dup16x4"); return;
697ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x2: vex_printf("Dup32x2"); return;
698ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
699ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NotV128:    vex_printf("NotV128"); return;
700ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AndV128:    vex_printf("AndV128"); return;
701ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_OrV128:     vex_printf("OrV128");  return;
702ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_XorV128:    vex_printf("XorV128"); return;
703ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
704ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x16: vex_printf("CmpNEZ8x16"); return;
705ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x8: vex_printf("CmpNEZ16x8"); return;
706ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x4: vex_printf("CmpNEZ32x4"); return;
707ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ64x2: vex_printf("CmpNEZ64x2"); return;
708ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
709ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x16: vex_printf("Abs8x16"); return;
710ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs16x8: vex_printf("Abs16x8"); return;
711ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32x4: vex_printf("Abs32x4"); return;
712ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
713ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x16:   vex_printf("Add8x16"); return;
714ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x8:   vex_printf("Add16x8"); return;
715ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32x4:   vex_printf("Add32x4"); return;
716ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64x2:   vex_printf("Add64x2"); return;
717ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux16: vex_printf("QAdd8Ux16"); return;
718ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Ux8: vex_printf("QAdd16Ux8"); return;
719ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux4: vex_printf("QAdd32Ux4"); return;
720ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx16: vex_printf("QAdd8Sx16"); return;
721ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx8: vex_printf("QAdd16Sx8"); return;
722ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx4: vex_printf("QAdd32Sx4"); return;
723ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Ux2: vex_printf("QAdd64Ux2"); return;
724ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd64Sx2: vex_printf("QAdd64Sx2"); return;
725ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x16: vex_printf("PwAdd8x16"); return;
726ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd16x8: vex_printf("PwAdd16x8"); return;
727ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32x4: vex_printf("PwAdd32x4"); return;
728ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux16: vex_printf("PwAddL8Ux16"); return;
729ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Ux8: vex_printf("PwAddL16Ux8"); return;
730ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Ux4: vex_printf("PwAddL32Ux4"); return;
731ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx16: vex_printf("PwAddL8Sx16"); return;
732ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL16Sx8: vex_printf("PwAddL16Sx8"); return;
733ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL32Sx4: vex_printf("PwAddL32Sx4"); return;
734ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
735ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x16:   vex_printf("Sub8x16"); return;
736ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub16x8:   vex_printf("Sub16x8"); return;
737ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32x4:   vex_printf("Sub32x4"); return;
738ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64x2:   vex_printf("Sub64x2"); return;
739ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux16: vex_printf("QSub8Ux16"); return;
740ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Ux8: vex_printf("QSub16Ux8"); return;
741ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux4: vex_printf("QSub32Ux4"); return;
742ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx16: vex_printf("QSub8Sx16"); return;
743ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx8: vex_printf("QSub16Sx8"); return;
744ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx4: vex_printf("QSub32Sx4"); return;
745ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Ux2: vex_printf("QSub64Ux2"); return;
746ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub64Sx2: vex_printf("QSub64Sx2"); return;
747ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
748ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x16:    vex_printf("Mul8x16"); return;
749ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul16x8:    vex_printf("Mul16x8"); return;
750ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32x4:    vex_printf("Mul32x4"); return;
751ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull8Ux8:    vex_printf("Mull8Ux8"); return;
752ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull8Sx8:    vex_printf("Mull8Sx8"); return;
753ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull16Ux4:    vex_printf("Mull16Ux4"); return;
754ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull16Sx4:    vex_printf("Mull16Sx4"); return;
755ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull32Ux2:    vex_printf("Mull32Ux2"); return;
756ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull32Sx2:    vex_printf("Mull32Sx2"); return;
757ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x16: vex_printf("PolynomialMul8x16"); return;
758ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMull8x8: vex_printf("PolynomialMull8x8"); return;
759ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Ux8: vex_printf("MulHi16Ux8"); return;
760ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi32Ux4: vex_printf("MulHi32Ux4"); return;
761ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx8: vex_printf("MulHi16Sx8"); return;
762ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi32Sx4: vex_printf("MulHi32Sx4"); return;
763ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx8: vex_printf("QDMulHi16Sx8"); return;
764ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi32Sx4: vex_printf("QDMulHi32Sx4"); return;
765ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx8: vex_printf("QRDMulHi16Sx8"); return;
766ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi32Sx4: vex_printf("QRDMulHi32Sx4"); return;
767ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
768ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Ux16: vex_printf("MullEven8Ux16"); return;
769ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven16Ux8: vex_printf("MullEven16Ux8"); return;
770ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Sx16: vex_printf("MullEven8Sx16"); return;
771ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven16Sx8: vex_printf("MullEven16Sx8"); return;
772ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
773ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux16: vex_printf("Avg8Ux16"); return;
774ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg16Ux8: vex_printf("Avg16Ux8"); return;
775ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg32Ux4: vex_printf("Avg32Ux4"); return;
776ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Sx16: vex_printf("Avg8Sx16"); return;
777ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg16Sx8: vex_printf("Avg16Sx8"); return;
778ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg32Sx4: vex_printf("Avg32Sx4"); return;
779ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
780ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx16: vex_printf("Max8Sx16"); return;
781ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Sx8: vex_printf("Max16Sx8"); return;
782ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Sx4: vex_printf("Max32Sx4"); return;
783ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux16: vex_printf("Max8Ux16"); return;
784ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max16Ux8: vex_printf("Max16Ux8"); return;
785ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Ux4: vex_printf("Max32Ux4"); return;
786ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
787ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx16: vex_printf("Min8Sx16"); return;
788ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Sx8: vex_printf("Min16Sx8"); return;
789ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Sx4: vex_printf("Min32Sx4"); return;
790ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux16: vex_printf("Min8Ux16"); return;
791ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min16Ux8: vex_printf("Min16Ux8"); return;
792ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Ux4: vex_printf("Min32Ux4"); return;
793ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
794ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x16:  vex_printf("CmpEQ8x16"); return;
795ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ16x8:  vex_printf("CmpEQ16x8"); return;
796ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32x4:  vex_printf("CmpEQ32x4"); return;
797b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpEQ64x2:  vex_printf("CmpEQ64x2"); return;
798ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx16: vex_printf("CmpGT8Sx16"); return;
799ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Sx8: vex_printf("CmpGT16Sx8"); return;
800ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Sx4: vex_printf("CmpGT32Sx4"); return;
801ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT64Sx2: vex_printf("CmpGT64Sx2"); return;
802ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux16: vex_printf("CmpGT8Ux16"); return;
803ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT16Ux8: vex_printf("CmpGT16Ux8"); return;
804ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Ux4: vex_printf("CmpGT32Ux4"); return;
805ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
806ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x16: vex_printf("Cnt8x16"); return;
807ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx16: vex_printf("Clz8Sx16"); return;
808ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz16Sx8: vex_printf("Clz16Sx8"); return;
809ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32Sx4: vex_printf("Clz32Sx4"); return;
810ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx16: vex_printf("Cls8Sx16"); return;
811ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls16Sx8: vex_printf("Cls16Sx8"); return;
812ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls32Sx4: vex_printf("Cls32Sx4"); return;
813ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
814ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlV128: vex_printf("ShlV128"); return;
815ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrV128: vex_printf("ShrV128"); return;
816ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
817ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN8x16: vex_printf("ShlN8x16"); return;
818ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN16x8: vex_printf("ShlN16x8"); return;
819ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x4: vex_printf("ShlN32x4"); return;
820ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN64x2: vex_printf("ShlN64x2"); return;
821ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN8x16: vex_printf("ShrN8x16"); return;
822ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN16x8: vex_printf("ShrN16x8"); return;
823ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x4: vex_printf("ShrN32x4"); return;
824ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN64x2: vex_printf("ShrN64x2"); return;
825ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN8x16: vex_printf("SarN8x16"); return;
826ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN16x8: vex_printf("SarN16x8"); return;
827ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x4: vex_printf("SarN32x4"); return;
828ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN64x2: vex_printf("SarN64x2"); return;
829ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
830ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x16: vex_printf("Shl8x16"); return;
831ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl16x8: vex_printf("Shl16x8"); return;
832ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl32x4: vex_printf("Shl32x4"); return;
833ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl64x2: vex_printf("Shl64x2"); return;
834ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal8x16: vex_printf("QSal8x16"); return;
835ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal16x8: vex_printf("QSal16x8"); return;
836ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal32x4: vex_printf("QSal32x4"); return;
837ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal64x2: vex_printf("QSal64x2"); return;
838ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl8x16: vex_printf("QShl8x16"); return;
839ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl16x8: vex_printf("QShl16x8"); return;
840ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl32x4: vex_printf("QShl32x4"); return;
841ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl64x2: vex_printf("QShl64x2"); return;
842ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x16: vex_printf("QSalN8x16"); return;
843ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN16x8: vex_printf("QSalN16x8"); return;
844ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x4: vex_printf("QSalN32x4"); return;
845ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN64x2: vex_printf("QSalN64x2"); return;
846ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x16: vex_printf("QShlN8x16"); return;
847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16x8: vex_printf("QShlN16x8"); return;
848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x4: vex_printf("QShlN32x4"); return;
849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64x2: vex_printf("QShlN64x2"); return;
850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx16: vex_printf("QShlN8Sx16"); return;
851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN16Sx8: vex_printf("QShlN16Sx8"); return;
852ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx4: vex_printf("QShlN32Sx4"); return;
853ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN64Sx2: vex_printf("QShlN64Sx2"); return;
854ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x16: vex_printf("Shr8x16"); return;
855ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr16x8: vex_printf("Shr16x8"); return;
856ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr32x4: vex_printf("Shr32x4"); return;
857ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr64x2: vex_printf("Shr64x2"); return;
858ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x16: vex_printf("Sar8x16"); return;
859ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar16x8: vex_printf("Sar16x8"); return;
860ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar32x4: vex_printf("Sar32x4"); return;
861ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar64x2: vex_printf("Sar64x2"); return;
862ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x16: vex_printf("Sal8x16"); return;
863ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal16x8: vex_printf("Sal16x8"); return;
864ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal32x4: vex_printf("Sal32x4"); return;
865ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal64x2: vex_printf("Sal64x2"); return;
866ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol8x16: vex_printf("Rol8x16"); return;
867ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol16x8: vex_printf("Rol16x8"); return;
868ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol32x4: vex_printf("Rol32x4"); return;
869ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
870b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x16:    vex_printf("NarrowBin16to8x16"); return;
871b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin32to16x8:    vex_printf("NarrowBin32to16x8"); return;
872b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Uto8Ux16: vex_printf("QNarrowBin16Uto8Ux16"); return;
873b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Ux8: vex_printf("QNarrowBin32Sto16Ux8"); return;
874b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Ux16: vex_printf("QNarrowBin16Sto8Ux16"); return;
875b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Uto16Ux8: vex_printf("QNarrowBin32Uto16Ux8"); return;
876b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx16: vex_printf("QNarrowBin16Sto8Sx16"); return;
877b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Sx8: vex_printf("QNarrowBin32Sto16Sx8"); return;
878b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn16to8x8:     vex_printf("NarrowUn16to8x8");  return;
879b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn32to16x4:    vex_printf("NarrowUn32to16x4"); return;
880b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn64to32x2:    vex_printf("NarrowUn64to32x2"); return;
881b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Uto8Ux8:  vex_printf("QNarrowUn16Uto8Ux8");  return;
882b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Uto16Ux4: vex_printf("QNarrowUn32Uto16Ux4"); return;
883b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Uto32Ux2: vex_printf("QNarrowUn64Uto32Ux2"); return;
884b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Sx8:  vex_printf("QNarrowUn16Sto8Sx8");  return;
885b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Sx4: vex_printf("QNarrowUn32Sto16Sx4"); return;
886b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Sx2: vex_printf("QNarrowUn64Sto32Sx2"); return;
887b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Ux8:  vex_printf("QNarrowUn16Sto8Ux8");  return;
888b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Ux4: vex_printf("QNarrowUn32Sto16Ux4"); return;
889b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Ux2: vex_printf("QNarrowUn64Sto32Ux2"); return;
890b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Uto16x8:  vex_printf("Widen8Uto16x8");  return;
891b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Uto32x4: vex_printf("Widen16Uto32x4"); return;
892b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Uto64x2: vex_printf("Widen32Uto64x2"); return;
893b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Sto16x8:  vex_printf("Widen8Sto16x8");  return;
894b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Sto32x4: vex_printf("Widen16Sto32x4"); return;
895b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Sto64x2: vex_printf("Widen32Sto64x2"); return;
896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x16: vex_printf("InterleaveHI8x16"); return;
898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI16x8: vex_printf("InterleaveHI16x8"); return;
899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x4: vex_printf("InterleaveHI32x4"); return;
900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI64x2: vex_printf("InterleaveHI64x2"); return;
901ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO8x16: vex_printf("InterleaveLO8x16"); return;
902ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO16x8: vex_printf("InterleaveLO16x8"); return;
903ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO32x4: vex_printf("InterleaveLO32x4"); return;
904ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO64x2: vex_printf("InterleaveLO64x2"); return;
905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
906ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x16: vex_printf("CatOddLanes8x16"); return;
907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x8: vex_printf("CatOddLanes16x8"); return;
908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes32x4: vex_printf("CatOddLanes32x4"); return;
909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes8x16: vex_printf("CatEvenLanes8x16"); return;
910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes16x8: vex_printf("CatEvenLanes16x8"); return;
911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatEvenLanes32x4: vex_printf("CatEvenLanes32x4"); return;
912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x16: vex_printf("InterleaveOddLanes8x16"); return;
914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x8: vex_printf("InterleaveOddLanes16x8"); return;
915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes32x4: vex_printf("InterleaveOddLanes32x4"); return;
916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes8x16: vex_printf("InterleaveEvenLanes8x16"); return;
917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes16x8: vex_printf("InterleaveEvenLanes16x8"); return;
918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveEvenLanes32x4: vex_printf("InterleaveEvenLanes32x4"); return;
919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x16: vex_printf("GetElem8x16"); return;
921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x8: vex_printf("GetElem16x8"); return;
922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x4: vex_printf("GetElem32x4"); return;
923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem64x2: vex_printf("GetElem64x2"); return;
924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x8: vex_printf("GetElem8x8"); return;
926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x4: vex_printf("GetElem16x4"); return;
927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x2: vex_printf("GetElem32x2"); return;
928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem8x8: vex_printf("SetElem8x8"); return;
929ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem16x4: vex_printf("SetElem16x4"); return;
930ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem32x2: vex_printf("SetElem32x2"); return;
931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Extract64: vex_printf("Extract64"); return;
933ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ExtractV128: vex_printf("ExtractV128"); return;
934ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
935ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x16: vex_printf("Perm8x16"); return;
936663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Perm32x4: vex_printf("Perm32x4"); return;
937ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x16: vex_printf("Reverse16_8x16"); return;
938ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x16: vex_printf("Reverse32_8x16"); return;
939ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_16x8: vex_printf("Reverse32_16x8"); return;
940ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x16: vex_printf("Reverse64_8x16"); return;
941ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_16x8: vex_printf("Reverse64_16x8"); return;
942ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_32x4: vex_printf("Reverse64_32x4"); return;
943ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
944ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux4_RZ: vex_printf("F32ToFixed32Ux4_RZ"); return;
945ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx4_RZ: vex_printf("F32ToFixed32Sx4_RZ"); return;
946ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x4_RN: vex_printf("Fixed32UToF32x4_RN"); return;
947ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x4_RN: vex_printf("Fixed32SToF32x4_RN"); return;
948ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux2_RZ: vex_printf("F32ToFixed32Ux2_RZ"); return;
949ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx2_RZ: vex_printf("F32ToFixed32Sx2_RZ"); return;
950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x2_RN: vex_printf("Fixed32UToF32x2_RN"); return;
951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x2_RN: vex_printf("Fixed32SToF32x2_RN"); return;
952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
953663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D32toD64:  vex_printf("D32toD64");   return;
954663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64toD32:  vex_printf("D64toD32");   return;
955663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_AddD64:  vex_printf("AddD64");   return;
956663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SubD64:  vex_printf("SubD64");   return;
957663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_MulD64:  vex_printf("MulD64");   return;
958663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_DivD64:  vex_printf("DivD64");   return;
959663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShlD64:  vex_printf("ShlD64"); return;
960663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShrD64:  vex_printf("ShrD64"); return;
961663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64toI64S:  vex_printf("D64toI64S");  return;
962663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_I64StoD64:  vex_printf("I64StoD64");  return;
963663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_I64StoD128: vex_printf("I64StoD128"); return;
964663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64toD128:  vex_printf("D64toD128");  return;
965663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128toD64:  vex_printf("D128toD64");  return;
966663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128toI64S: vex_printf("D128toI64S"); return;
967663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_AddD128: vex_printf("AddD128");  return;
968663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SubD128: vex_printf("SubD128");  return;
969663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_MulD128: vex_printf("MulD128");  return;
970663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_DivD128: vex_printf("DivD128");  return;
971663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShlD128: vex_printf("ShlD128");  return;
972663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShrD128: vex_printf("ShrD128");  return;
973663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_RoundD64toInt:  vex_printf("Iop_RoundD64toInt");  return;
974663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_RoundD128toInt: vex_printf("Iop_RoundD128toInt"); return;
975663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QuantizeD64:    vex_printf("Iop_QuantizeD64");    return;
976663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QuantizeD128:   vex_printf("Iop_QuantizeD128");   return;
977663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ExtractExpD64:  vex_printf("Iop_ExtractExpD64");  return;
978663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ExtractExpD128: vex_printf("Iop_ExtractExpD128"); return;
979663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_InsertExpD64:   vex_printf("Iop_InsertExpD64");   return;
980663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_InsertExpD128:  vex_printf("Iop_InsertExpD128");  return;
981663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpD64:         vex_printf("CmpD64");    return;
982663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpD128:        vex_printf("CmpD128");   return;
983663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64HLtoD128: vex_printf("D64HLtoD128");  return;
984663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128HItoD64: vex_printf("D128HItoD64");  return;
985663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128LOtoD64: vex_printf("D128LOtoD64");  return;
986663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SignificanceRoundD64: vex_printf("Iop_SignificanceRoundD64");
987663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         return;
988663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SignificanceRoundD128: vex_printf("Iop_SignificanceRoundD128");
989663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         return;
990663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ReinterpI64asD64: vex_printf("ReinterpI64asD64"); return;
991663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ReinterpD64asI64: vex_printf("ReinterpD64asI64"); return;
992663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256to64_0: vex_printf("V256to64_0"); return;
993663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256to64_1: vex_printf("V256to64_1"); return;
994663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256to64_2: vex_printf("V256to64_2"); return;
995663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256to64_3: vex_printf("V256to64_3"); return;
996663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_64x4toV256: vex_printf("64x4toV256"); return;
997663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256toV128_0: vex_printf("V256toV128_0"); return;
998663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256toV128_1: vex_printf("V256toV128_1"); return;
999663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V128HLtoV256: vex_printf("V128HLtoV256"); return;
1000663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_DPBtoBCD: vex_printf("DPBtoBCD"); return;
1001663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_BCDtoDPB: vex_printf("BCDtoDPB"); return;
1002663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Add64Fx4: vex_printf("Add64Fx4"); return;
1003663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Sub64Fx4: vex_printf("Sub64Fx4"); return;
1004663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Mul64Fx4: vex_printf("Mul64Fx4"); return;
1005663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Div64Fx4: vex_printf("Div64Fx4"); return;
1006663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Add32Fx8: vex_printf("Add32Fx8"); return;
1007663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Sub32Fx8: vex_printf("Sub32Fx8"); return;
1008663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Mul32Fx8: vex_printf("Mul32Fx8"); return;
1009663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Div32Fx8: vex_printf("Div32Fx8"); return;
1010663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_AndV256: vex_printf("AndV256"); return;
1011663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_OrV256:  vex_printf("OrV256"); return;
1012663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_XorV256: vex_printf("XorV256"); return;
1013663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_NotV256: vex_printf("NotV256"); return;
1014663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpNEZ64x4: vex_printf("CmpNEZ64x4"); return;
1015663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpNEZ32x8: vex_printf("CmpNEZ32x8"); return;
1016ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIROp(1)");
1017ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1018ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1019ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(str);
1020ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (op - base) {
1021ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 0: vex_printf("%s",str); vex_printf("8"); break;
1022ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 1: vex_printf("%s",str); vex_printf("16"); break;
1023ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 2: vex_printf("%s",str); vex_printf("32"); break;
1024ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case 3: vex_printf("%s",str); vex_printf("64"); break;
1025ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIROp(2)");
1026ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1027ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1028ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1029ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRExpr ( IRExpr* e )
1030ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1031ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown  Int i;
1032ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown  switch (e->tag) {
1033ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Binder:
1034ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("BIND-%d", e->Iex.Binder.binder);
1035ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1036ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Get:
1037ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "GET:" );
1038ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(e->Iex.Get.ty);
1039ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("(%d)", e->Iex.Get.offset);
1040ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1041ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_GetI:
1042ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "GETI" );
1043ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRRegArray(e->Iex.GetI.descr);
1044ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("[");
1045ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.GetI.ix);
1046ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",%d]", e->Iex.GetI.bias);
1047ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1048ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_RdTmp:
1049ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(e->Iex.RdTmp.tmp);
1050ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1051663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng    case Iex_Qop: {
1052663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      IRQop *qop = e->Iex.Qop.details;
1053663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIROp(qop->op);
1054ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1055663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(qop->arg1);
1056ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
1057663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(qop->arg2);
1058ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
1059663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(qop->arg3);
1060ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
1061663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(qop->arg4);
1062ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1063ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1064663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng    }
1065663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng    case Iex_Triop: {
1066663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      IRTriop *triop = e->Iex.Triop.details;
1067663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIROp(triop->op);
1068ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1069663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(triop->arg1);
1070ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
1071663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(triop->arg2);
1072ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
1073663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      ppIRExpr(triop->arg3);
1074ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1075ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1076663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng    }
1077ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Binop:
1078ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIROp(e->Iex.Binop.op);
1079ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1080ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Binop.arg1);
1081ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "," );
1082ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Binop.arg2);
1083ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1084ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1085ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Unop:
1086ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIROp(e->Iex.Unop.op);
1087ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1088ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Unop.arg);
1089ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1090ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1091ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Load:
1092ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "LD%s:", e->Iex.Load.end==Iend_LE ? "le" : "be" );
1093ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(e->Iex.Load.ty);
1094ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "(" );
1095ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Load.addr);
1096ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ")" );
1097ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1098ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Const:
1099ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRConst(e->Iex.Const.con);
1100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_CCall:
1102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRCallee(e->Iex.CCall.cee);
1103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("(");
1104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; e->Iex.CCall.args[i] != NULL; i++) {
1105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown        ppIRExpr(e->Iex.CCall.args[i]);
1106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown        if (e->Iex.CCall.args[i+1] != NULL)
1107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown          vex_printf(",");
1108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
1109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("):");
1110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(e->Iex.CCall.retty);
1111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    case Iex_Mux0X:
1113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("Mux0X(");
1114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Mux0X.cond);
1115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Mux0X.expr0);
1117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(e->Iex.Mux0X.exprX);
1119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(")");
1120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      break;
1121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown    default:
1122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vpanic("ppIRExpr");
1123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown  }
1124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIREffect ( IREffect fx )
1127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (fx) {
1129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_None:   vex_printf("noFX"); return;
1130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_Read:   vex_printf("RdFX"); return;
1131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_Write:  vex_printf("WrFX"); return;
1132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ifx_Modify: vex_printf("MoFX"); return;
1133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("ppIREffect");
1134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRDirty ( IRDirty* d )
1138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
1140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (d->tmp != IRTemp_INVALID) {
1141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(d->tmp);
1142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" = ");
1143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("DIRTY ");
1145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(d->guard);
1146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (d->needsBBP)
1147ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" NeedsBBP");
1148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (d->mFx != Ifx_None) {
1149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" ");
1150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIREffect(d->mFx);
1151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("-mem(");
1152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(d->mAddr);
1153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",%d)", d->mSize);
1154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < d->nFxState; i++) {
1156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(" ");
1157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIREffect(d->fxState[i].fx);
1158663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      vex_printf("-gst(%u,%u", (UInt)d->fxState[i].offset,
1159663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                               (UInt)d->fxState[i].size);
1160663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      if (d->fxState[i].nRepeats > 0) {
1161663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         vex_printf(",reps%u,step%u", (UInt)d->fxState[i].nRepeats,
1162663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                      (UInt)d->fxState[i].repeatLen);
1163663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      }
1164663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      vex_printf(")");
1165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(" ::: ");
1167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRCallee(d->cee);
1168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("(");
1169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; d->args[i] != NULL; i++) {
1170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(d->args[i]);
1171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (d->args[i+1] != NULL) {
1172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(",");
1173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
1174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(")");
1176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRCAS ( IRCAS* cas )
1179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Print even structurally invalid constructions, as an aid to
1181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      debugging. */
1182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cas->oldHi != IRTemp_INVALID) {
1183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(cas->oldHi);
1184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRTemp(cas->oldLo);
1187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(" = CAS%s(", cas->end==Iend_LE ? "le" : "be" );
1188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(cas->addr);
1189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("::");
1190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cas->expdHi) {
1191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(cas->expdHi);
1192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(cas->expdLo);
1195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("->");
1196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cas->dataHi) {
1197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRExpr(cas->dataHi);
1198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf(",");
1199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr(cas->dataLo);
1201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf(")");
1202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1204663860b1408516d02ebfcb3a9999a134e6cfb223Ben Chengvoid ppIRPutI ( IRPutI* puti )
1205663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng{
1206663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   vex_printf( "PUTI" );
1207663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   ppIRRegArray(puti->descr);
1208663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   vex_printf("[");
1209663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   ppIRExpr(puti->ix);
1210663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   vex_printf(",%d] = ", puti->bias);
1211663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   ppIRExpr(puti->data);
1212663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng}
1213663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
1214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRJumpKind ( IRJumpKind kind )
1215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (kind) {
1217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Boring:       vex_printf("Boring"); break;
1218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Call:         vex_printf("Call"); break;
1219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Ret:          vex_printf("Return"); break;
1220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_ClientReq:    vex_printf("ClientReq"); break;
1221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Yield:        vex_printf("Yield"); break;
1222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_EmWarn:       vex_printf("EmWarn"); break;
1223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_EmFail:       vex_printf("EmFail"); break;
1224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_NoDecode:     vex_printf("NoDecode"); break;
1225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_MapFail:      vex_printf("MapFail"); break;
1226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_TInval:       vex_printf("Invalidate"); break;
1227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_NoRedir:      vex_printf("NoRedir"); break;
1228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_SigTRAP:      vex_printf("SigTRAP"); break;
1229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_SigSEGV:      vex_printf("SigSEGV"); break;
1230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_SigBUS:       vex_printf("SigBUS"); break;
1231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_syscall:  vex_printf("Sys_syscall"); break;
1232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int32:    vex_printf("Sys_int32"); break;
1233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int128:   vex_printf("Sys_int128"); break;
1234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int129:   vex_printf("Sys_int129"); break;
1235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_int130:   vex_printf("Sys_int130"); break;
1236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ijk_Sys_sysenter: vex_printf("Sys_sysenter"); break;
1237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:               vpanic("ppIRJumpKind");
1238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRMBusEvent ( IRMBusEvent event )
1242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (event) {
1244b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Imbe_Fence:
1245b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vex_printf("Fence"); break;
1246b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Imbe_CancelReservation:
1247b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vex_printf("CancelReservation"); break;
1248b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      default:
1249b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vpanic("ppIRMBusEvent");
1250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1252ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRStmt ( IRStmt* s )
1254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (!s) {
1256ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("!!! IRStmt* which is NULL !!!");
1257ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return;
1258ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1259ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (s->tag) {
1260ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
1261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("IR-NoOp");
1262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
1264b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         vex_printf( "------ IMark(0x%llx, %d, %u) ------",
1265b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     s->Ist.IMark.addr, s->Ist.IMark.len,
1266b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                     (UInt)s->Ist.IMark.delta);
1267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
1269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("====== AbiHint(");
1270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.AbiHint.base);
1271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(", %d, ", s->Ist.AbiHint.len);
1272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.AbiHint.nia);
1273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf(") ======");
1274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1275ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
1276ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "PUT(%d) = ", s->Ist.Put.offset);
1277ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Put.data);
1278ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1279ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
1280663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ppIRPutI(s->Ist.PutI.details);
1281ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1282ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
1283ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRTemp(s->Ist.WrTmp.tmp);
1284ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( " = " );
1285ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.WrTmp.data);
1286ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1287ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
1288ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "ST%s(", s->Ist.Store.end==Iend_LE ? "le" : "be" );
1289ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Store.addr);
1290ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( ") = ");
1291ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Store.data);
1292ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1293ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
1294ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRCAS(s->Ist.CAS.details);
1295ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1296ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
1297ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (s->Ist.LLSC.storedata == NULL) {
1298ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRTemp(s->Ist.LLSC.result);
1299ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" = LD%s-Linked(",
1300ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                       s->Ist.LLSC.end==Iend_LE ? "le" : "be");
1301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRExpr(s->Ist.LLSC.addr);
1302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")");
1303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
1304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRTemp(s->Ist.LLSC.result);
1305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" = ( ST%s-Cond(",
1306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                       s->Ist.LLSC.end==Iend_LE ? "le" : "be");
1307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRExpr(s->Ist.LLSC.addr);
1308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") = ");
1309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRExpr(s->Ist.LLSC.storedata);
1310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" )");
1311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
1312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
1314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRDirty(s->Ist.Dirty.details);
1315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
1317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("IR-");
1318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRMBusEvent(s->Ist.MBE.event);
1319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
1321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "if (" );
1322ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(s->Ist.Exit.guard);
1323663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         vex_printf( ") { PUT(%d) = ", s->Ist.Exit.offsIP);
1324ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRConst(s->Ist.Exit.dst);
1325663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         vex_printf("; exit-");
1326663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ppIRJumpKind(s->Ist.Exit.jk);
1327663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         vex_printf(" } ");
1328ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
1329ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
1330ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("ppIRStmt");
1331ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1332ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRTypeEnv ( IRTypeEnv* env ) {
1335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   UInt i;
1336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < env->types_used; i++) {
1337ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (i % 8 == 0)
1338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "   ");
1339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRTemp(i);
1340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( ":");
1341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRType(env->types[i]);
1342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (i % 8 == 7)
1343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "\n");
1344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      else
1345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf( "   ");
1346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (env->types_used > 0 && env->types_used % 8 != 7)
1348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "\n");
1349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1350ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid ppIRSB ( IRSB* bb )
1352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
1354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("IRSB {\n");
1355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRTypeEnv(bb->tyenv);
1356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("\n");
1357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb->stmts_used; i++) {
1358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "   ");
1359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRStmt(bb->stmts[i]);
1360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf( "\n");
1361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1362663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   vex_printf( "   PUT(%d) = ", bb->offsIP );
1363ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRExpr( bb->next );
1364663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   vex_printf( "; exit-");
1365663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   ppIRJumpKind(bb->jumpkind);
1366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf( "\n}\n");
1367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1370ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1371ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Constructors                                            ---*/
1372ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRConst */
1376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U1 ( Bool bit )
1378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U1;
1381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U1  = bit;
1382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* call me paranoid; I don't care :-) */
1383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(bit == False || bit == True);
1384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U8 ( UChar u8 )
1387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U8;
1390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U8  = u8;
1391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U16 ( UShort u16 )
1394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U16;
1397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U16 = u16;
1398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U32 ( UInt u32 )
1401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U32;
1404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U32 = u32;
1405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_U64 ( ULong u64 )
1408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_U64;
1411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.U64 = u64;
1412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1414b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy StepanovIRConst* IRConst_F32 ( Float f32 )
1415b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov{
1416b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1417b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->tag     = Ico_F32;
1418b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->Ico.F32 = f32;
1419b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   return c;
1420b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov}
1421b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy StepanovIRConst* IRConst_F32i ( UInt f32i )
1422b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov{
1423b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1424b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->tag      = Ico_F32i;
1425b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   c->Ico.F32i = f32i;
1426b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   return c;
1427b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov}
1428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_F64 ( Double f64 )
1429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c = LibVEX_Alloc(sizeof(IRConst));
1431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag     = Ico_F64;
1432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.F64 = f64;
1433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_F64i ( ULong f64i )
1436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag      = Ico_F64i;
1439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.F64i = f64i;
1440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* IRConst_V128 ( UShort con )
1443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->tag      = Ico_V128;
1446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   c->Ico.V128 = con;
1447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return c;
1448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1449663860b1408516d02ebfcb3a9999a134e6cfb223Ben ChengIRConst* IRConst_V256 ( UInt con )
1450663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng{
1451663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRConst* c  = LibVEX_Alloc(sizeof(IRConst));
1452663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   c->tag      = Ico_V256;
1453663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   c->Ico.V256 = con;
1454663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   return c;
1455663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng}
1456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRCallee */
1458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCallee* mkIRCallee ( Int regparms, HChar* name, void* addr )
1460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCallee* ce = LibVEX_Alloc(sizeof(IRCallee));
1462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->regparms = regparms;
1463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->name     = name;
1464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->addr     = addr;
1465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce->mcx_mask = 0;
1466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(regparms >= 0 && regparms <= 3);
1467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(name != NULL);
1468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(addr != 0);
1469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return ce;
1470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRRegArray */
1474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRRegArray* mkIRRegArray ( Int base, IRType elemTy, Int nElems )
1476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRRegArray* arr = LibVEX_Alloc(sizeof(IRRegArray));
1478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   arr->base       = base;
1479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   arr->elemTy     = elemTy;
1480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   arr->nElems     = nElems;
1481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(!(arr->base < 0 || arr->base > 10000 /* somewhat arbitrary */));
1482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(!(arr->elemTy == Ity_I1));
1483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(!(arr->nElems <= 0 || arr->nElems > 500 /* somewhat arbitrary */));
1484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return arr;
1485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRExpr */
1489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Binder ( Int binder ) {
1491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e            = LibVEX_Alloc(sizeof(IRExpr));
1492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag               = Iex_Binder;
1493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binder.binder = binder;
1494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Get ( Int off, IRType ty ) {
1497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_Get;
1499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Get.offset = off;
1500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Get.ty     = ty;
1501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_GetI ( IRRegArray* descr, IRExpr* ix, Int bias ) {
1504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_GetI;
1506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.GetI.descr = descr;
1507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.GetI.ix    = ix;
1508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.GetI.bias  = bias;
1509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_RdTmp ( IRTemp tmp ) {
1512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e        = LibVEX_Alloc(sizeof(IRExpr));
1513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag           = Iex_RdTmp;
1514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.RdTmp.tmp = tmp;
1515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Qop ( IROp op, IRExpr* arg1, IRExpr* arg2,
1518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                              IRExpr* arg3, IRExpr* arg4 ) {
1519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e       = LibVEX_Alloc(sizeof(IRExpr));
1520663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRQop*  qop     = LibVEX_Alloc(sizeof(IRQop));
1521663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   qop->op         = op;
1522663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   qop->arg1       = arg1;
1523663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   qop->arg2       = arg2;
1524663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   qop->arg3       = arg3;
1525663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   qop->arg4       = arg4;
1526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag          = Iex_Qop;
1527663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   e->Iex.Qop.details = qop;
1528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Triop  ( IROp op, IRExpr* arg1,
1531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                 IRExpr* arg2, IRExpr* arg3 ) {
1532663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRExpr*  e         = LibVEX_Alloc(sizeof(IRExpr));
1533663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRTriop* triop     = LibVEX_Alloc(sizeof(IRTriop));
1534663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   triop->op         = op;
1535663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   triop->arg1       = arg1;
1536663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   triop->arg2       = arg2;
1537663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   triop->arg3       = arg3;
1538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_Triop;
1539663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   e->Iex.Triop.details = triop;
1540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Binop ( IROp op, IRExpr* arg1, IRExpr* arg2 ) {
1543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e         = LibVEX_Alloc(sizeof(IRExpr));
1544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag            = Iex_Binop;
1545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binop.op   = op;
1546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binop.arg1 = arg1;
1547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Binop.arg2 = arg2;
1548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Unop ( IROp op, IRExpr* arg ) {
1551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e       = LibVEX_Alloc(sizeof(IRExpr));
1552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag          = Iex_Unop;
1553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Unop.op  = op;
1554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Unop.arg = arg;
1555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Load ( IREndness end, IRType ty, IRExpr* addr ) {
1558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e        = LibVEX_Alloc(sizeof(IRExpr));
1559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag           = Iex_Load;
1560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Load.end  = end;
1561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Load.ty   = ty;
1562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Load.addr = addr;
1563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(end == Iend_LE || end == Iend_BE);
1564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Const ( IRConst* con ) {
1567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e        = LibVEX_Alloc(sizeof(IRExpr));
1568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag           = Iex_Const;
1569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Const.con = con;
1570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_CCall ( IRCallee* cee, IRType retty, IRExpr** args ) {
1573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e          = LibVEX_Alloc(sizeof(IRExpr));
1574ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag             = Iex_CCall;
1575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.CCall.cee   = cee;
1576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.CCall.retty = retty;
1577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.CCall.args  = args;
1578ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1579ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1580ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* IRExpr_Mux0X ( IRExpr* cond, IRExpr* expr0, IRExpr* exprX ) {
1581ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr* e          = LibVEX_Alloc(sizeof(IRExpr));
1582ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->tag             = Iex_Mux0X;
1583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Mux0X.cond  = cond;
1584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Mux0X.expr0 = expr0;
1585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   e->Iex.Mux0X.exprX = exprX;
1586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return e;
1587ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1588ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1589ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1590ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors for NULL-terminated IRExpr expression vectors,
1591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   suitable for use as arg lists in clean/dirty helper calls. */
1592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_0 ( void ) {
1594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(1 * sizeof(IRExpr*));
1595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = NULL;
1596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_1 ( IRExpr* arg1 ) {
1599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(2 * sizeof(IRExpr*));
1600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = NULL;
1602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_2 ( IRExpr* arg1, IRExpr* arg2 ) {
1605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(3 * sizeof(IRExpr*));
1606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = NULL;
1609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_3 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3 ) {
1612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(4 * sizeof(IRExpr*));
1613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = NULL;
1617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_4 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4 ) {
1621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(5 * sizeof(IRExpr*));
1622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1625ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = NULL;
1627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_5 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5 ) {
1631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(6 * sizeof(IRExpr*));
1632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = NULL;
1638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_6 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5, IRExpr* arg6 ) {
1642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(7 * sizeof(IRExpr*));
1643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = arg6;
1649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[6] = NULL;
1650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_7 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5, IRExpr* arg6,
1654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg7 ) {
1655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(8 * sizeof(IRExpr*));
1656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = arg6;
1662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[6] = arg7;
1663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[7] = NULL;
1664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** mkIRExprVec_8 ( IRExpr* arg1, IRExpr* arg2, IRExpr* arg3,
1667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg4, IRExpr* arg5, IRExpr* arg6,
1668ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         IRExpr* arg7, IRExpr* arg8 ) {
1669ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** vec = LibVEX_Alloc(9 * sizeof(IRExpr*));
1670ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[0] = arg1;
1671ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[1] = arg2;
1672ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[2] = arg3;
1673ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[3] = arg4;
1674ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[4] = arg5;
1675ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[5] = arg6;
1676ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[6] = arg7;
1677ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[7] = arg8;
1678ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vec[8] = NULL;
1679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return vec;
1680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1683ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRDirty */
1684ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1685ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* emptyIRDirty ( void ) {
1686ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d = LibVEX_Alloc(sizeof(IRDirty));
1687ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->cee      = NULL;
1688ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->guard    = NULL;
1689ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->args     = NULL;
1690ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->tmp      = IRTemp_INVALID;
1691ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->mFx      = Ifx_None;
1692ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->mAddr    = NULL;
1693ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->mSize    = 0;
1694ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->needsBBP = False;
1695ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->nFxState = 0;
1696ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d;
1697ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1698ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1699ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1700ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRCAS */
1701ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1702ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCAS* mkIRCAS ( IRTemp oldHi, IRTemp oldLo,
1703ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                 IREndness end, IRExpr* addr,
1704ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                 IRExpr* expdHi, IRExpr* expdLo,
1705ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                 IRExpr* dataHi, IRExpr* dataLo ) {
1706ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS* cas = LibVEX_Alloc(sizeof(IRCAS));
1707ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->oldHi  = oldHi;
1708ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->oldLo  = oldLo;
1709ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->end    = end;
1710ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->addr   = addr;
1711ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->expdHi = expdHi;
1712ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->expdLo = expdLo;
1713ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->dataHi = dataHi;
1714ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   cas->dataLo = dataLo;
1715ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return cas;
1716ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1717ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1718ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1719663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng/* Constructors -- IRPutI */
1720663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
1721663860b1408516d02ebfcb3a9999a134e6cfb223Ben ChengIRPutI* mkIRPutI ( IRRegArray* descr, IRExpr* ix,
1722663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                   Int bias, IRExpr* data )
1723663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng{
1724663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRPutI* puti = LibVEX_Alloc(sizeof(IRPutI));
1725663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   puti->descr  = descr;
1726663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   puti->ix     = ix;
1727663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   puti->bias   = bias;
1728663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   puti->data   = data;
1729663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   return puti;
1730663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng}
1731663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
1732663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
1733ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRStmt */
1734ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1735ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_NoOp ( void )
1736ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1737ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Just use a single static closure. */
1738ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   static IRStmt static_closure;
1739ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   static_closure.tag = Ist_NoOp;
1740ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return &static_closure;
1741ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1742b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy StepanovIRStmt* IRStmt_IMark ( Addr64 addr, Int len, UChar delta ) {
1743b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   IRStmt* s          = LibVEX_Alloc(sizeof(IRStmt));
1744b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->tag             = Ist_IMark;
1745b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->Ist.IMark.addr  = addr;
1746b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->Ist.IMark.len   = len;
1747b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov   s->Ist.IMark.delta = delta;
1748ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1749ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1750ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_AbiHint ( IRExpr* base, Int len, IRExpr* nia ) {
1751ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s           = LibVEX_Alloc(sizeof(IRStmt));
1752ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag              = Ist_AbiHint;
1753ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.AbiHint.base = base;
1754ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.AbiHint.len  = len;
1755ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.AbiHint.nia  = nia;
1756ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1757ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1758ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Put ( Int off, IRExpr* data ) {
1759ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1760ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_Put;
1761ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Put.offset = off;
1762ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Put.data   = data;
1763ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1764ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1765663860b1408516d02ebfcb3a9999a134e6cfb223Ben ChengIRStmt* IRStmt_PutI ( IRPutI* details ) {
1766663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRStmt* s          = LibVEX_Alloc(sizeof(IRStmt));
1767663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->tag             = Ist_PutI;
1768663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->Ist.PutI.details = details;
1769ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1770ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1771ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_WrTmp ( IRTemp tmp, IRExpr* data ) {
1772ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1773ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_WrTmp;
1774ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.WrTmp.tmp  = tmp;
1775ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.WrTmp.data = data;
1776ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1777ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1778ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Store ( IREndness end, IRExpr* addr, IRExpr* data ) {
1779ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s         = LibVEX_Alloc(sizeof(IRStmt));
1780ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag            = Ist_Store;
1781ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Store.end  = end;
1782ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Store.addr = addr;
1783ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Store.data = data;
1784ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(end == Iend_LE || end == Iend_BE);
1785ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1786ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1787ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_CAS ( IRCAS* cas ) {
1788ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s          = LibVEX_Alloc(sizeof(IRStmt));
1789ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag             = Ist_CAS;
1790ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.CAS.details = cas;
1791ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1792ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1793ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_LLSC ( IREndness end,
1794ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      IRTemp result, IRExpr* addr, IRExpr* storedata ) {
1795ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s = LibVEX_Alloc(sizeof(IRStmt));
1796ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag                = Ist_LLSC;
1797ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.end       = end;
1798ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.result    = result;
1799ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.addr      = addr;
1800ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.LLSC.storedata = storedata;
1801ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1802ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1803ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_Dirty ( IRDirty* d )
1804ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1805ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s            = LibVEX_Alloc(sizeof(IRStmt));
1806ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag               = Ist_Dirty;
1807ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.Dirty.details = d;
1808ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1809ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1810ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* IRStmt_MBE ( IRMBusEvent event )
1811ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1812ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* s        = LibVEX_Alloc(sizeof(IRStmt));
1813ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->tag           = Ist_MBE;
1814ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   s->Ist.MBE.event = event;
1815ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1816ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1817663860b1408516d02ebfcb3a9999a134e6cfb223Ben ChengIRStmt* IRStmt_Exit ( IRExpr* guard, IRJumpKind jk, IRConst* dst,
1818663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                      Int offsIP ) {
1819663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRStmt* s          = LibVEX_Alloc(sizeof(IRStmt));
1820663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->tag             = Ist_Exit;
1821663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->Ist.Exit.guard  = guard;
1822663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->Ist.Exit.jk     = jk;
1823663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->Ist.Exit.dst    = dst;
1824663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   s->Ist.Exit.offsIP = offsIP;
1825ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return s;
1826ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1827ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1828ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1829ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRTypeEnv */
1830ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1831ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRTypeEnv* emptyIRTypeEnv ( void )
1832ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1833ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* env   = LibVEX_Alloc(sizeof(IRTypeEnv));
1834ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   env->types       = LibVEX_Alloc(8 * sizeof(IRType));
1835ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   env->types_size  = 8;
1836ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   env->types_used  = 0;
1837ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return env;
1838ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1839ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1840ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1841ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Constructors -- IRSB */
1842ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1843ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRSB* emptyIRSB ( void )
1844ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1845ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRSB* bb       = LibVEX_Alloc(sizeof(IRSB));
1846ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->tyenv      = emptyIRTypeEnv();
1847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts_used = 0;
1848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts_size = 8;
1849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts      = LibVEX_Alloc(bb->stmts_size * sizeof(IRStmt*));
1850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->next       = NULL;
1851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->jumpkind   = Ijk_Boring;
1852663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   bb->offsIP     = 0;
1853ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return bb;
1854ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1855ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1856ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1857ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1858ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- (Deep) copy constructors.  These make complete copies   ---*/
1859ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- the original, which can be modified without affecting   ---*/
1860ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- the original.                                           ---*/
1861ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
1862ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1863ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Copying IR Expr vectors (for call args). */
1864ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1865ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Shallow copy of an IRExpr vector */
1866ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1867ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** shallowCopyIRExprVec ( IRExpr** vec )
1868ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1869ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1870ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** newvec;
1871ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; vec[i]; i++)
1872ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ;
1873ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   newvec = LibVEX_Alloc((i+1)*sizeof(IRExpr*));
1874ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; vec[i]; i++)
1875ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      newvec[i] = vec[i];
1876ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   newvec[i] = NULL;
1877ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return newvec;
1878ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1879ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1880ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Deep copy of an IRExpr vector */
1881ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1882ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr** deepCopyIRExprVec ( IRExpr** vec )
1883ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1884ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1885ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr** newvec = shallowCopyIRExprVec( vec );
1886ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; newvec[i]; i++)
1887ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      newvec[i] = deepCopyIRExpr(newvec[i]);
1888ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return newvec;
1889ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1890ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1891ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Deep copy constructors for all heap-allocated IR types follow. */
1892ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1893ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRConst* deepCopyIRConst ( IRConst* c )
1894ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1895ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (c->tag) {
1896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:   return IRConst_U1(c->Ico.U1);
1897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:   return IRConst_U8(c->Ico.U8);
1898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16:  return IRConst_U16(c->Ico.U16);
1899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32:  return IRConst_U32(c->Ico.U32);
1900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64:  return IRConst_U64(c->Ico.U64);
1901b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32:  return IRConst_F32(c->Ico.F32);
1902b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i: return IRConst_F32i(c->Ico.F32i);
1903ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64:  return IRConst_F64(c->Ico.F64);
1904ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i: return IRConst_F64i(c->Ico.F64i);
1905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128: return IRConst_V128(c->Ico.V128);
1906ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("deepCopyIRConst");
1907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCallee* deepCopyIRCallee ( IRCallee* ce )
1911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCallee* ce2 = mkIRCallee(ce->regparms, ce->name, ce->addr);
1913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ce2->mcx_mask = ce->mcx_mask;
1914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return ce2;
1915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRRegArray* deepCopyIRRegArray ( IRRegArray* d )
1918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return mkIRRegArray(d->base, d->elemTy, d->nElems);
1920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* deepCopyIRExpr ( IRExpr* e )
1923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (e->tag) {
1925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
1926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Get(e->Iex.Get.offset, e->Iex.Get.ty);
1927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
1928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_GetI(deepCopyIRRegArray(e->Iex.GetI.descr),
1929ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(e->Iex.GetI.ix),
1930ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            e->Iex.GetI.bias);
1931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
1932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_RdTmp(e->Iex.RdTmp.tmp);
1933663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iex_Qop: {
1934663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         IRQop* qop = e->Iex.Qop.details;
1935663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
1936663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         return IRExpr_Qop(qop->op,
1937663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                           deepCopyIRExpr(qop->arg1),
1938663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                           deepCopyIRExpr(qop->arg2),
1939663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                           deepCopyIRExpr(qop->arg3),
1940663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                           deepCopyIRExpr(qop->arg4));
1941663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      }
1942663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iex_Triop:  {
1943663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         IRTriop *triop = e->Iex.Triop.details;
1944663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
1945663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         return IRExpr_Triop(triop->op,
1946663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                             deepCopyIRExpr(triop->arg1),
1947663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                             deepCopyIRExpr(triop->arg2),
1948663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                             deepCopyIRExpr(triop->arg3));
1949663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      }
1950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop:
1951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Binop(e->Iex.Binop.op,
1952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Binop.arg1),
1953ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Binop.arg2));
1954ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
1955ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Unop(e->Iex.Unop.op,
1956ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(e->Iex.Unop.arg));
1957ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
1958ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Load(e->Iex.Load.end,
1959ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            e->Iex.Load.ty,
1960ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(e->Iex.Load.addr));
1961ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
1962ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Const(deepCopyIRConst(e->Iex.Const.con));
1963ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
1964ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_CCall(deepCopyIRCallee(e->Iex.CCall.cee),
1965ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             e->Iex.CCall.retty,
1966ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExprVec(e->Iex.CCall.args));
1967ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1968ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
1969ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRExpr_Mux0X(deepCopyIRExpr(e->Iex.Mux0X.cond),
1970ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Mux0X.expr0),
1971ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(e->Iex.Mux0X.exprX));
1972ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
1973ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("deepCopyIRExpr");
1974ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
1975ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1976ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1977ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* deepCopyIRDirty ( IRDirty* d )
1978ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1979ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
1980ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d2 = emptyIRDirty();
1981ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->cee   = deepCopyIRCallee(d->cee);
1982ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->guard = deepCopyIRExpr(d->guard);
1983ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->args  = deepCopyIRExprVec(d->args);
1984ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->tmp   = d->tmp;
1985ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->mFx   = d->mFx;
1986ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->mAddr = d->mAddr==NULL ? NULL : deepCopyIRExpr(d->mAddr);
1987ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->mSize = d->mSize;
1988ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->needsBBP = d->needsBBP;
1989ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d2->nFxState = d->nFxState;
1990ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < d2->nFxState; i++)
1991ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      d2->fxState[i] = d->fxState[i];
1992ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d2;
1993ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
1994ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
1995ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRCAS* deepCopyIRCAS ( IRCAS* cas )
1996ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
1997ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return mkIRCAS( cas->oldHi, cas->oldLo, cas->end,
1998ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   deepCopyIRExpr(cas->addr),
1999ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   cas->expdHi==NULL ? NULL : deepCopyIRExpr(cas->expdHi),
2000ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   deepCopyIRExpr(cas->expdLo),
2001ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   cas->dataHi==NULL ? NULL : deepCopyIRExpr(cas->dataHi),
2002ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   deepCopyIRExpr(cas->dataLo) );
2003ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2004ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2005663860b1408516d02ebfcb3a9999a134e6cfb223Ben ChengIRPutI* deepCopyIRPutI ( IRPutI * puti )
2006663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng{
2007663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng  return mkIRPutI( deepCopyIRRegArray(puti->descr),
2008663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                   deepCopyIRExpr(puti->ix),
2009663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                   puti->bias,
2010663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                   deepCopyIRExpr(puti->data));
2011663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng}
2012663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2013ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRStmt* deepCopyIRStmt ( IRStmt* s )
2014ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2015ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (s->tag) {
2016ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
2017ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_NoOp();
2018ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
2019ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_AbiHint(deepCopyIRExpr(s->Ist.AbiHint.base),
2020ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               s->Ist.AbiHint.len,
2021ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               deepCopyIRExpr(s->Ist.AbiHint.nia));
2022ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
2023b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         return IRStmt_IMark(s->Ist.IMark.addr,
2024b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                             s->Ist.IMark.len,
2025b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                             s->Ist.IMark.delta);
2026ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
2027ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Put(s->Ist.Put.offset,
2028ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                           deepCopyIRExpr(s->Ist.Put.data));
2029ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
2030663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         return IRStmt_PutI(deepCopyIRPutI(s->Ist.PutI.details));
2031ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
2032ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_WrTmp(s->Ist.WrTmp.tmp,
2033ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(s->Ist.WrTmp.data));
2034ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
2035ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Store(s->Ist.Store.end,
2036ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(s->Ist.Store.addr),
2037ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             deepCopyIRExpr(s->Ist.Store.data));
2038ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
2039ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_CAS(deepCopyIRCAS(s->Ist.CAS.details));
2040ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
2041ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_LLSC(s->Ist.LLSC.end,
2042ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.LLSC.result,
2043ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            deepCopyIRExpr(s->Ist.LLSC.addr),
2044ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.LLSC.storedata
2045ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               ? deepCopyIRExpr(s->Ist.LLSC.storedata)
2046ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               : NULL);
2047ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
2048ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Dirty(deepCopyIRDirty(s->Ist.Dirty.details));
2049ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
2050ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_MBE(s->Ist.MBE.event);
2051ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
2052ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return IRStmt_Exit(deepCopyIRExpr(s->Ist.Exit.guard),
2053ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                            s->Ist.Exit.jk,
2054663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                            deepCopyIRConst(s->Ist.Exit.dst),
2055663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                            s->Ist.Exit.offsIP);
2056ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2057ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("deepCopyIRStmt");
2058ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2059ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2060ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2061ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRTypeEnv* deepCopyIRTypeEnv ( IRTypeEnv* src )
2062ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2063ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int        i;
2064ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* dst = LibVEX_Alloc(sizeof(IRTypeEnv));
2065ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   dst->types_size = src->types_size;
2066ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   dst->types_used = src->types_used;
2067ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   dst->types = LibVEX_Alloc(dst->types_size * sizeof(IRType));
2068ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < src->types_used; i++)
2069ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      dst->types[i] = src->types[i];
2070ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return dst;
2071ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2072ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2073ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRSB* deepCopyIRSB ( IRSB* bb )
2074ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2075ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
2076ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt** sts2;
2077ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRSB* bb2 = deepCopyIRSBExceptStmts(bb);
2078ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->stmts_used = bb2->stmts_size = bb->stmts_used;
2079ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   sts2 = LibVEX_Alloc(bb2->stmts_used * sizeof(IRStmt*));
2080ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb2->stmts_used; i++)
2081ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sts2[i] = deepCopyIRStmt(bb->stmts[i]);
2082663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   bb2->stmts = sts2;
2083ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return bb2;
2084ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2085ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2086ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRSB* deepCopyIRSBExceptStmts ( IRSB* bb )
2087ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2088ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRSB* bb2     = emptyIRSB();
2089ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->tyenv    = deepCopyIRTypeEnv(bb->tyenv);
2090ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->next     = deepCopyIRExpr(bb->next);
2091ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb2->jumpkind = bb->jumpkind;
2092663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   bb2->offsIP   = bb->offsIP;
2093ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return bb2;
2094ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2095ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2096ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2097ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2098ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Primop types                                            ---*/
2099ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
2102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid typeOfPrimop ( IROp op,
2103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    /*OUTs*/
2104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    IRType* t_dst,
2105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    IRType* t_arg1, IRType* t_arg2,
2106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    IRType* t_arg3, IRType* t_arg4 )
2107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define UNARY(_ta1,_td)                                      \
2109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      *t_dst = (_td); *t_arg1 = (_ta1); break
2110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define BINARY(_ta1,_ta2,_td)                                \
2111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = (_td); *t_arg1 = (_ta1); *t_arg2 = (_ta2); break
2112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define TERNARY(_ta1,_ta2,_ta3,_td)                          \
2113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = (_td); *t_arg1 = (_ta1);                         \
2114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_arg2 = (_ta2); *t_arg3 = (_ta3); break
2115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define QUATERNARY(_ta1,_ta2,_ta3,_ta4,_td)                  \
2116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = (_td); *t_arg1 = (_ta1);                         \
2117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_arg2 = (_ta2); *t_arg3 = (_ta3);                       \
2118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_arg4 = (_ta4); break
2119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define COMPARISON(_ta)                                      \
2120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = Ity_I1; *t_arg1 = *t_arg2 = (_ta); break;
2121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  define UNARY_COMPARISON(_ta)                                \
2122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown     *t_dst = Ity_I1; *t_arg1 = (_ta); break;
2123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Rounding mode values are always Ity_I32, encoded as per
2125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRRoundingMode */
2126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   const IRType ity_RMode = Ity_I32;
2127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_dst  = Ity_INVALID;
2129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg1 = Ity_INVALID;
2130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg2 = Ity_INVALID;
2131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg3 = Ity_INVALID;
2132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   *t_arg4 = Ity_INVALID;
2133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (op) {
2134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8: case Iop_Sub8: case Iop_Mul8:
2135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or8:  case Iop_And8: case Iop_Xor8:
2136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I8);
2137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16: case Iop_Sub16: case Iop_Mul16:
2139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or16:  case Iop_And16: case Iop_Xor16:
2140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I16, Ity_I16);
2141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32U:
2143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD32S:
2144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32: case Iop_Sub32: case Iop_Mul32:
2145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or32:  case Iop_And32: case Iop_Xor32:
2146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32U:
2147663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QAdd32S: case Iop_QSub32S:
2148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add16x2: case Iop_Sub16x2:
2149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd16Sx2: case Iop_QAdd16Ux2:
2150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub16Sx2: case Iop_QSub16Ux2:
2151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd16Ux2: case Iop_HAdd16Sx2:
2152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub16Ux2: case Iop_HSub16Sx2:
2153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x4: case Iop_Sub8x4:
2154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx4: case Iop_QAdd8Ux4:
2155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx4: case Iop_QSub8Ux4:
2156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HAdd8Ux4: case Iop_HAdd8Sx4:
2157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_HSub8Ux4: case Iop_HSub8Sx4:
2158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sad8Ux4:
2159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I32);
2160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64: case Iop_Sub64: case Iop_Mul64:
2162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Or64:  case Iop_And64: case Iop_Xor64:
2163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64U:
2164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpORD64S:
2165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux8: case Iop_Avg16Ux4:
2166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x8: case Iop_Add16x4: case Iop_Add32x2:
2167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx2: case Iop_Sub32Fx2:
2168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x8: case Iop_CmpEQ16x4: case Iop_CmpEQ32x2:
2169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx8: case Iop_CmpGT16Sx4: case Iop_CmpGT32Sx2:
2170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux8: case Iop_CmpGT16Ux4: case Iop_CmpGT32Ux2:
2171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx2: case Iop_CmpEQ32Fx2: case Iop_CmpGE32Fx2:
2172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x8: case Iop_InterleaveLO8x8:
2173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI16x4: case Iop_InterleaveLO16x4:
2174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x2: case Iop_InterleaveLO32x2:
2175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x8: case Iop_CatEvenLanes8x8:
2176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x4: case Iop_CatEvenLanes16x4:
2177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x8: case Iop_InterleaveEvenLanes8x8:
2178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x4: case Iop_InterleaveEvenLanes16x4:
2179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Perm8x8:
2180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux8: case Iop_Max16Ux4: case Iop_Max32Ux2:
2181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx8: case Iop_Max16Sx4: case Iop_Max32Sx2:
2182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx2: case Iop_Min32Fx2:
2183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx2: case Iop_PwMin32Fx2:
2184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux8: case Iop_Min16Ux4: case Iop_Min32Ux2:
2185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx8: case Iop_Min16Sx4: case Iop_Min32Sx2:
2186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Ux8: case Iop_PwMax16Ux4: case Iop_PwMax32Ux2:
2187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax8Sx8: case Iop_PwMax16Sx4: case Iop_PwMax32Sx2:
2188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Ux8: case Iop_PwMin16Ux4: case Iop_PwMin32Ux2:
2189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMin8Sx8: case Iop_PwMin16Sx4: case Iop_PwMin32Sx2:
2190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x8: case Iop_Mul16x4: case Iop_Mul32x2:
2191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx2:
2192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x8:
2193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx4: case Iop_MulHi16Ux4:
2194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx4: case Iop_QDMulHi32Sx2:
2195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx4: case Iop_QRDMulHi32Sx2:
2196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx8: case Iop_QAdd16Sx4:
2197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx2: case Iop_QAdd64Sx1:
2198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux8: case Iop_QAdd16Ux4:
2199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux2: case Iop_QAdd64Ux1:
2200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x8: case Iop_PwAdd16x4: case Iop_PwAdd32x2:
2201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd32Fx2:
2202b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin32Sto16Sx4:
2203b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx8: case Iop_QNarrowBin16Sto8Ux8:
2204b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x8: case Iop_NarrowBin32to16x4:
2205ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x8: case Iop_Sub16x4: case Iop_Sub32x2:
2206ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx8: case Iop_QSub16Sx4:
2207ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx2: case Iop_QSub64Sx1:
2208ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux8: case Iop_QSub16Ux4:
2209ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux2: case Iop_QSub64Ux1:
2210ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x8: case Iop_Shl16x4: case Iop_Shl32x2:
2211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x8: case Iop_Shr16x4: case Iop_Shr32x2:
2212ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x8: case Iop_Sar16x4: case Iop_Sar32x2:
2213ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x8: case Iop_Sal16x4: case Iop_Sal32x2: case Iop_Sal64x1:
2214ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShl8x8: case Iop_QShl16x4: case Iop_QShl32x2: case Iop_QShl64x1:
2215ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSal8x8: case Iop_QSal16x4: case Iop_QSal32x2: case Iop_QSal64x1:
2216ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx2:
2217ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx2:
2218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I64);
2219ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x2: case Iop_ShlN16x4: case Iop_ShlN8x8:
2221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x2: case Iop_ShrN16x4: case Iop_ShrN8x8:
2222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x2: case Iop_SarN16x4: case Iop_SarN8x8:
2223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x8: case Iop_QShlN16x4:
2224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x2: case Iop_QShlN64x1:
2225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx8: case Iop_QShlN16Sx4:
2226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx2: case Iop_QShlN64Sx1:
2227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x8: case Iop_QSalN16x4:
2228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x2: case Iop_QSalN64x1:
2229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I8, Ity_I64);
2230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8: case Iop_Shr8: case Iop_Sar8:
2232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I8);
2233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl16: case Iop_Shr16: case Iop_Sar16:
2234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I8, Ity_I16);
2235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl32: case Iop_Shr32: case Iop_Sar32:
2236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I8, Ity_I32);
2237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl64: case Iop_Shr64: case Iop_Sar64:
2238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I8, Ity_I64);
2239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not8:
2241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I8);
2242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not16:
2243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I16);
2244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not32:
2245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16x2: case Iop_CmpNEZ8x4:
2246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I32);
2247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not64:
2249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x2: case Iop_CmpNEZ16x4: case Iop_CmpNEZ8x8:
2250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x8:
2251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx8: case Iop_Clz16Sx4: case Iop_Clz32Sx2:
2252ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx8: case Iop_Cls16Sx4: case Iop_Cls32Sx2:
2253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux8: case Iop_PwAddL16Ux4: case Iop_PwAddL32Ux2:
2254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx8: case Iop_PwAddL16Sx4: case Iop_PwAddL32Sx2:
2255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x8: case Iop_Reverse64_16x4: case Iop_Reverse64_32x2:
2256ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x8: case Iop_Reverse32_16x4:
2257ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x8:
2258ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx2_RZ: case Iop_FtoI32Ux2_RZ:
2259ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx2: case Iop_I32UtoFx2:
2260ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x2: case Iop_Recip32Fx2:
2261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx2:
2262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx2:
2263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x2:
2264ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx2:
2265ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x8: case Iop_Abs16x4: case Iop_Abs32x2:
2266ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I64);
2267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8: case Iop_CmpNE8:
2269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ8: case Iop_CasCmpNE8:
2270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I8);
2271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ16: case Iop_CmpNE16:
2272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ16: case Iop_CasCmpNE16:
2273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I16);
2274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32: case Iop_CmpNE32:
2275ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ32: case Iop_CasCmpNE32:
2276ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32S: case Iop_CmpLE32S:
2277ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT32U: case Iop_CmpLE32U:
2278ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I32);
2279ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64: case Iop_CmpNE64:
2280ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CasCmpEQ64: case Iop_CasCmpNE64:
2281ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64S: case Iop_CmpLE64S:
2282ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLT64U: case Iop_CmpLE64U:
2283ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         COMPARISON(Ity_I64);
2284ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2285ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8:  UNARY_COMPARISON(Ity_I8);
2286ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ16: UNARY_COMPARISON(Ity_I16);
2287ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32: UNARY_COMPARISON(Ity_I32);
2288ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ64: UNARY_COMPARISON(Ity_I64);
2289ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2290ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left8:  UNARY(Ity_I8, Ity_I8);
2291ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Left16: UNARY(Ity_I16,Ity_I16);
2292ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ32: case Iop_Left32: UNARY(Ity_I32,Ity_I32);
2293ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpwNEZ64: case Iop_Left64: UNARY(Ity_I64,Ity_I64);
2294ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2295ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU8: case Iop_MullS8:
2296ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I16);
2297ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU16: case Iop_MullS16:
2298ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I16, Ity_I32);
2299ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU32: case Iop_MullS32:
2300ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I64);
2301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullU64: case Iop_MullS64:
2302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I128);
2303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz32: case Iop_Ctz32:
2305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I32);
2306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz64: case Iop_Ctz64:
2308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I64);
2309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2310b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU32: case Iop_DivS32: case Iop_DivU32E: case Iop_DivS32E:
2311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I32);
2312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2313b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivU64: case Iop_DivS64: case Iop_DivS64E: case Iop_DivU64E:
2314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I64);
2315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU64to32: case Iop_DivModS64to32:
2317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I32, Ity_I64);
2318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_DivModU128to64: case Iop_DivModS128to64:
2320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I128,Ity_I64, Ity_I128);
2321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2322b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivModS64to64:
2323b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_I64,Ity_I64, Ity_I128);
2324b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2325ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HIto8: case Iop_16to8:
2326ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I8);
2327ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8HLto16:
2328ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I8,Ity_I8, Ity_I16);
2329ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2330ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HIto16: case Iop_32to16:
2331ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I16);
2332ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16HLto32:
2333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I16,Ity_I16, Ity_I32);
2334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HIto32: case Iop_64to32:
2336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I32);
2337ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32HLto64:
2338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I32,Ity_I32, Ity_I64);
2339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_128HIto64: case Iop_128to64:
2341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I128, Ity_I64);
2342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64HLto128:
2343ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64,Ity_I64, Ity_I128);
2344ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2345ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Not1:   UNARY(Ity_I1, Ity_I1);
2346ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto8:  UNARY(Ity_I1, Ity_I8);
2347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto8:  UNARY(Ity_I1, Ity_I8);
2348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto16: UNARY(Ity_I1, Ity_I16);
2349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Uto32: case Iop_1Sto32: UNARY(Ity_I1, Ity_I32);
2350ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_1Sto64: case Iop_1Uto64: UNARY(Ity_I1, Ity_I64);
2351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to1:  UNARY(Ity_I32, Ity_I1);
2352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to1:  UNARY(Ity_I64, Ity_I1);
2353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto32: case Iop_8Sto32:
2355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I32);
2356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto16: case Iop_8Sto16:
2358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I16);
2359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto32: case Iop_16Sto32:
2361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I32);
2362ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2363ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32Sto64: case Iop_32Uto64:
2364ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I32, Ity_I64);
2365ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_8Uto64: case Iop_8Sto64:
2367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I8, Ity_I64);
2368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_16Uto64: case Iop_16Sto64:
2370ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I16, Ity_I64);
2371ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to16:
2372ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_I16);
2373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32to8: UNARY(Ity_I32, Ity_I8);
2375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64to8: UNARY(Ity_I64, Ity_I8);
2376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64:    case Iop_SubF64:
2378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64:    case Iop_DivF64:
2379ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF64r32: case Iop_SubF64r32:
2380ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF64r32: case Iop_DivF64r32:
2381ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F64,Ity_F64, Ity_F64);
2382ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2383ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AddF32: case Iop_SubF32:
2384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulF32: case Iop_DivF32:
2385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F32,Ity_F32, Ity_F32);
2386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF64: case Iop_AbsF64:
2388ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_F64);
2389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NegF32: case Iop_AbsF32:
2391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F32, Ity_F32);
2392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF64:
2394ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF64r32:
2395ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(ity_RMode,Ity_F64, Ity_F64);
2396ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SqrtF32:
2398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32toInt:
2399ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(ity_RMode,Ity_F32, Ity_F32);
2400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2401b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF32:
2402b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_F32,Ity_F32, Ity_I32);
2403b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpF64:
2405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_F64,Ity_F64, Ity_I32);
2406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2407b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpF128:
2408b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_F128,Ity_F128, Ity_I32);
2409b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI16S: BINARY(ity_RMode,Ity_F64, Ity_I16);
2411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32S: BINARY(ity_RMode,Ity_F64, Ity_I32);
2412b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toI64S: case Iop_F64toI64U:
2413b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(ity_RMode,Ity_F64, Ity_I64);
2414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toI32U: BINARY(ity_RMode,Ity_F64, Ity_I32);
2416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I16StoF64: UNARY(Ity_I16, Ity_F64);
2418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoF64: UNARY(Ity_I32, Ity_F64);
2419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I64StoF64: BINARY(ity_RMode,Ity_I64, Ity_F64);
2420b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF64: BINARY(ity_RMode,Ity_I64, Ity_F64);
2421b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64UtoF32: BINARY(ity_RMode,Ity_I64, Ity_F32);
2422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoF64: UNARY(Ity_I32, Ity_F64);
2424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2425b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI16S: BINARY(ity_RMode,Ity_F32, Ity_I16);
2426b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI32S: BINARY(ity_RMode,Ity_F32, Ity_I32);
2427b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toI64S: BINARY(ity_RMode,Ity_F32, Ity_I64);
2428b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2429b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I16StoF32: UNARY(Ity_I16, Ity_F32);
2430b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF32: BINARY(ity_RMode,Ity_I32, Ity_F32);
2431b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF32: BINARY(ity_RMode,Ity_I64, Ity_F32);
2432b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF64: UNARY(Ity_F32, Ity_F64);
2434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F64toF32: BINARY(ity_RMode,Ity_F64, Ity_F32);
2435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI64asF64: UNARY(Ity_I64, Ity_F64);
2437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF64asI64: UNARY(Ity_F64, Ity_I64);
2438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpI32asF32: UNARY(Ity_I32, Ity_F32);
2439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ReinterpF32asI32: UNARY(Ity_F32, Ity_I32);
2440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AtanF64: case Iop_Yl2xF64:  case Iop_Yl2xp1F64:
2442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ScaleF64: case Iop_PRemF64: case Iop_PRem1F64:
2443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F64,Ity_F64, Ity_F64);
2444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PRemC3210F64: case Iop_PRem1C3210F64:
2446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(ity_RMode,Ity_F64,Ity_F64, Ity_I32);
2447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SinF64: case Iop_CosF64: case Iop_TanF64:
2449ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_2xm1F64:
2450ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toInt: BINARY(ity_RMode,Ity_F64, Ity_F64);
2451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64: case Iop_MSubF64:
2453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MAddF64r32: case Iop_MSubF64r32:
2454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         QUATERNARY(ity_RMode,Ity_F64,Ity_F64,Ity_F64, Ity_F64);
2455ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Est5FRSqrt:
2457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_NEAREST: case Iop_RoundF64toF64_NegINF:
2458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF64_PosINF: case Iop_RoundF64toF64_ZERO:
2459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_F64);
2460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF64toF32:
2461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(ity_RMode,Ity_F64, Ity_F64);
2462ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CalcFPRF:
2463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_I32);
2464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_TruncF64asF32:
2465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_F64, Ity_F32);
2466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32UtoFx4:
2468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_I32StoFx4:
2469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Ux4_RZ:
2470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QFtoI32Sx4_RZ:
2471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Ux4_RZ:
2472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_FtoI32Sx4_RZ:
2473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RM:
2474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RP:
2475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RN:
2476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RoundF32x4_RZ:
2477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs32Fx4:
2478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32Fx4:
2479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrte32x4:
2480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_V128, Ity_V128);
2481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2482b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_64HLtoV128:
2483b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(Ity_I64,Ity_I64, Ity_V128);
2484b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to64: case Iop_V128HIto64:
2486b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn16to8x8:
2487b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn32to16x4:
2488b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowUn64to32x2:
2489b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Uto8Ux8:
2490b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Uto16Ux4:
2491b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Uto32Ux2:
2492b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Sx8:
2493b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Sx4:
2494b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Sx2:
2495b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn16Sto8Ux8:
2496b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn32Sto16Ux4:
2497b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowUn64Sto32Ux2:
2498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32toF16x4:
2499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_V128, Ity_I64);
2500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2501b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Uto16x8:
2502b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Uto32x4:
2503b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Uto64x2:
2504b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen8Sto16x8:
2505b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen16Sto32x4:
2506b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_Widen32Sto64x2:
2507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F16toF32x4:
2508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_I64, Ity_V128);
2509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_V128to32:    UNARY(Ity_V128, Ity_I32);
2511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_32UtoV128:   UNARY(Ity_I32, Ity_V128);
2512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_64UtoV128:   UNARY(Ity_I64, Ity_V128);
2513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo32: BINARY(Ity_V128,Ity_I32, Ity_V128);
2514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetV128lo64: BINARY(Ity_V128,Ity_I64, Ity_V128);
2515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x16: UNARY(Ity_I8, Ity_V128);
2517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x8: UNARY(Ity_I16, Ity_V128);
2518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x4: UNARY(Ity_I32, Ity_V128);
2519ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup8x8:  UNARY(Ity_I8, Ity_I64);
2520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup16x4: UNARY(Ity_I16, Ity_I64);
2521ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Dup32x2: UNARY(Ity_I32, Ity_I64);
2522ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2523ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32Fx4: case Iop_CmpLT32Fx4:
2524ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64Fx2: case Iop_CmpLT64Fx2:
2525ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32Fx4: case Iop_CmpUN32Fx4:
2526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64Fx2: case Iop_CmpUN64Fx2:
2527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT32Fx4: case Iop_CmpGE32Fx4:
2528ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ32F0x4: case Iop_CmpLT32F0x4:
2529ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ64F0x2: case Iop_CmpLT64F0x2:
2530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE32F0x4: case Iop_CmpUN32F0x4:
2531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpLE64F0x2: case Iop_CmpUN64F0x2:
2532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32Fx4: case Iop_Add32F0x4:
2533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add64Fx2: case Iop_Add64F0x2:
2534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div32Fx4: case Iop_Div32F0x4:
2535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Div64Fx2: case Iop_Div64F0x2:
2536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max32Fx4: case Iop_Max32F0x4:
2537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwMax32Fx4: case Iop_PwMin32Fx4:
2538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max64Fx2: case Iop_Max64F0x2:
2539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min32Fx4: case Iop_Min32F0x4:
2540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min64Fx2: case Iop_Min64F0x2:
2541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul32Fx4: case Iop_Mul32F0x4:
2542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul64Fx2: case Iop_Mul64F0x2:
2543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32Fx4: case Iop_Sub32F0x4:
2544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub64Fx2: case Iop_Sub64F0x2:
2545ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_AndV128: case Iop_OrV128: case Iop_XorV128:
2546ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add8x16:   case Iop_Add16x8:
2547ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Add32x4:   case Iop_Add64x2:
2548ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Ux16: case Iop_QAdd16Ux8:
2549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Ux4: //case Iop_QAdd64Ux2:
2550ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd8Sx16: case Iop_QAdd16Sx8:
2551ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QAdd32Sx4: case Iop_QAdd64Sx2:
2552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAdd8x16: case Iop_PwAdd16x8: case Iop_PwAdd32x4:
2553ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub8x16:   case Iop_Sub16x8:
2554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sub32x4:   case Iop_Sub64x2:
2555ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Ux16: case Iop_QSub16Ux8:
2556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Ux4: //case Iop_QSub64Ux2:
2557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub8Sx16: case Iop_QSub16Sx8:
2558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSub32Sx4: case Iop_QSub64Sx2:
2559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mul8x16: case Iop_Mul16x8: case Iop_Mul32x4:
2560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMul8x16:
2561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Ux8: case Iop_MulHi32Ux4:
2562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MulHi16Sx8: case Iop_MulHi32Sx4:
2563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulHi16Sx8: case Iop_QDMulHi32Sx4:
2564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QRDMulHi16Sx8: case Iop_QRDMulHi32Sx4:
2565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Ux16: case Iop_MullEven16Ux8:
2566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_MullEven8Sx16: case Iop_MullEven16Sx8:
2567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Ux16: case Iop_Avg16Ux8: case Iop_Avg32Ux4:
2568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Avg8Sx16: case Iop_Avg16Sx8: case Iop_Avg32Sx4:
2569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Sx16: case Iop_Max16Sx8: case Iop_Max32Sx4:
2570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Max8Ux16: case Iop_Max16Ux8: case Iop_Max32Ux4:
2571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Sx16: case Iop_Min16Sx8: case Iop_Min32Sx4:
2572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Min8Ux16: case Iop_Min16Ux8: case Iop_Min32Ux4:
2573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpEQ8x16:  case Iop_CmpEQ16x8:  case Iop_CmpEQ32x4:
2574b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_CmpEQ64x2:
2575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Sx16: case Iop_CmpGT16Sx8: case Iop_CmpGT32Sx4:
2576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT64Sx2:
2577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpGT8Ux16: case Iop_CmpGT16Ux8: case Iop_CmpGT32Ux4:
2578ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shl8x16: case Iop_Shl16x8: case Iop_Shl32x4: case Iop_Shl64x2:
2579b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QShl8x16: case Iop_QShl16x8:
2580b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QShl32x4: case Iop_QShl64x2:
2581b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QSal8x16: case Iop_QSal16x8:
2582b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QSal32x4: case Iop_QSal64x2:
2583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Shr8x16: case Iop_Shr16x8: case Iop_Shr32x4: case Iop_Shr64x2:
2584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sar8x16: case Iop_Sar16x8: case Iop_Sar32x4: case Iop_Sar64x2:
2585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sal8x16: case Iop_Sal16x8: case Iop_Sal32x4: case Iop_Sal64x2:
2586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rol8x16: case Iop_Rol16x8: case Iop_Rol32x4:
2587b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Ux16: case Iop_QNarrowBin32Sto16Ux8:
2588b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Sto8Sx16: case Iop_QNarrowBin32Sto16Sx8:
2589b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_QNarrowBin16Uto8Ux16: case Iop_QNarrowBin32Uto16Ux8:
2590b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NarrowBin16to8x16:   case Iop_NarrowBin32to16x8:
2591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI8x16: case Iop_InterleaveHI16x8:
2592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveHI32x4: case Iop_InterleaveHI64x2:
2593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO8x16: case Iop_InterleaveLO16x8:
2594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveLO32x4: case Iop_InterleaveLO64x2:
2595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes8x16: case Iop_CatEvenLanes8x16:
2596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes16x8: case Iop_CatEvenLanes16x8:
2597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CatOddLanes32x4: case Iop_CatEvenLanes32x4:
2598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes8x16: case Iop_InterleaveEvenLanes8x16:
2599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes16x8: case Iop_InterleaveEvenLanes16x8:
2600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_InterleaveOddLanes32x4: case Iop_InterleaveEvenLanes32x4:
2601663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Perm8x16: case Iop_Perm32x4:
2602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recps32Fx4:
2603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Rsqrts32Fx4:
2604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128,Ity_V128, Ity_V128);
2605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PolynomialMull8x8:
2607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull8Ux8: case Iop_Mull8Sx8:
2608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull16Ux4: case Iop_Mull16Sx4:
2609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Mull32Ux2: case Iop_Mull32Sx2:
2610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I64, Ity_V128);
2611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_NotV128:
2613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32Fx4: case Iop_Recip32F0x4:
2614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip32x4:
2615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Recip64Fx2: case Iop_Recip64F0x2:
2616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt32Fx4: case Iop_RSqrt32F0x4:
2617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_RSqrt64Fx2: case Iop_RSqrt64F0x2:
2618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt32Fx4:  case Iop_Sqrt32F0x4:
2619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Sqrt64Fx2:  case Iop_Sqrt64F0x2:
2620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ8x16: case Iop_CmpNEZ16x8:
2621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_CmpNEZ32x4: case Iop_CmpNEZ64x2:
2622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cnt8x16:
2623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Clz8Sx16: case Iop_Clz16Sx8: case Iop_Clz32Sx4:
2624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Cls8Sx16: case Iop_Cls16Sx8: case Iop_Cls32Sx4:
2625ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Ux16: case Iop_PwAddL16Ux8: case Iop_PwAddL32Ux4:
2626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_PwAddL8Sx16: case Iop_PwAddL16Sx8: case Iop_PwAddL32Sx4:
2627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse64_8x16: case Iop_Reverse64_16x8: case Iop_Reverse64_32x4:
2628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse32_8x16: case Iop_Reverse32_16x8:
2629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Reverse16_8x16:
2630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Neg32Fx4:
2631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Abs8x16: case Iop_Abs16x8: case Iop_Abs32x4:
2632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         UNARY(Ity_V128, Ity_V128);
2633ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2634ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlV128: case Iop_ShrV128:
2635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN8x16: case Iop_ShlN16x8:
2636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShlN32x4: case Iop_ShlN64x2:
2637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN8x16: case Iop_ShrN16x8:
2638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ShrN32x4: case Iop_ShrN64x2:
2639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN8x16: case Iop_SarN16x8:
2640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SarN32x4: case Iop_SarN64x2:
2641ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8x16: case Iop_QShlN16x8:
2642ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32x4: case Iop_QShlN64x2:
2643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN8Sx16: case Iop_QShlN16Sx8:
2644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QShlN32Sx4: case Iop_QShlN64Sx2:
2645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN8x16: case Iop_QSalN16x8:
2646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QSalN32x4: case Iop_QSalN64x2:
2647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128,Ity_I8, Ity_V128);
2648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux4_RZ:
2650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx4_RZ:
2651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x4_RN:
2652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x4_RN:
2653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_V128);
2654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Ux2_RZ:
2656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_F32ToFixed32Sx2_RZ:
2657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32UToF32x2_RN:
2658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Fixed32SToF32x2_RN:
2659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I64);
2660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x16:
2662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I8);
2663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x8:
2664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I16);
2665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x4:
2666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I32);
2667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem64x2:
2668ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_V128, Ity_I8, Ity_I64);
2669ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem8x8:
2670ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I8);
2671ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem16x4:
2672ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I16);
2673ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_GetElem32x2:
2674ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I8, Ity_I32);
2675ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem8x8:
2676ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I8, Ity_I8, Ity_I64);
2677ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem16x4:
2678ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I8, Ity_I16, Ity_I64);
2679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_SetElem32x2:
2680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I8, Ity_I32, Ity_I64);
2681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_Extract64:
2683ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_I64, Ity_I64, Ity_I8, Ity_I64);
2684ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_ExtractV128:
2685ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         TERNARY(Ity_V128, Ity_V128, Ity_I8, Ity_V128);
2686ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2687ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iop_QDMulLong16Sx4: case Iop_QDMulLong32Sx2:
2688ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         BINARY(Ity_I64, Ity_I64, Ity_V128);
2689ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2690b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         /* s390 specific */
2691b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MAddF32:
2692b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MSubF32:
2693b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         QUATERNARY(ity_RMode,Ity_F32,Ity_F32,Ity_F32, Ity_F32);
2694b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2695b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64HLtoF128:
2696b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        BINARY(Ity_F64,Ity_F64, Ity_F128);
2697b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2698b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128HItoF64:
2699b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128LOtoF64:
2700b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov        UNARY(Ity_F128, Ity_F64);
2701b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2702b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AddF128:
2703b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SubF128:
2704b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_MulF128:
2705b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_DivF128:
2706b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         TERNARY(ity_RMode,Ity_F128,Ity_F128, Ity_F128);
2707b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2708b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_NegF128:
2709b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_AbsF128:
2710b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         UNARY(Ity_F128, Ity_F128);
2711b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2712b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_SqrtF128:
2713b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         BINARY(ity_RMode,Ity_F128, Ity_F128);
2714b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2715b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I32StoF128: UNARY(Ity_I32, Ity_F128);
2716b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_I64StoF128: UNARY(Ity_I64, Ity_F128);
2717b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2718b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI32S: BINARY(ity_RMode,Ity_F128, Ity_I32);
2719b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toI64S: BINARY(ity_RMode,Ity_F128, Ity_I64);
2720b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2721b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F32toF128: UNARY(Ity_F32, Ity_F128);
2722b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F64toF128: UNARY(Ity_F64, Ity_F128);
2723b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2724b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF32: BINARY(ity_RMode,Ity_F128, Ity_F32);
2725b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Iop_F128toF64: BINARY(ity_RMode,Ity_F128, Ity_F64);
2726b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov
2727663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D32toD64:
2728663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ExtractExpD64:
2729663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_D64, Ity_D64);
2730663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2731663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_InsertExpD64:
2732663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D64,Ity_D64, Ity_D64);
2733663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2734663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ExtractExpD128:
2735663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_D128, Ity_D64);
2736663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2737663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_InsertExpD128:
2738663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D64,Ity_D128, Ity_D128);
2739663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2740663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64toD128:
2741663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_D64, Ity_D128);
2742663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2743663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ReinterpD64asI64:
2744663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng	UNARY(Ity_D64, Ity_I64);
2745663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2746663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ReinterpI64asD64:
2747663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_I64, Ity_D64);
2748663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2749663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_RoundD64toInt:
2750663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(ity_RMode,Ity_D64, Ity_D64);
2751663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2752663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_RoundD128toInt:
2753663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(ity_RMode,Ity_D128, Ity_D128);
2754663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2755663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_I64StoD128:    /* I64 bit pattern stored in Float register */
2756663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_D64, Ity_D128);
2757663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2758663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_DPBtoBCD:
2759663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_BCDtoDPB:
2760663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_I64, Ity_I64);
2761663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2762663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128HItoD64:
2763663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128LOtoD64:
2764663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_D128, Ity_D64);
2765663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2766663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128toI64S:
2767663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(ity_RMode, Ity_D128, Ity_D64);
2768663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2769663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64HLtoD128:
2770663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D64, Ity_D64, Ity_D128);
2771663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2772663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShlD64:
2773663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShrD64:
2774663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D64, Ity_I8, Ity_D64 );
2775663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2776663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64toD32:
2777663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D64toI64S:
2778663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(ity_RMode, Ity_D64, Ity_D64);
2779663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2780663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_I64StoD64:  /* I64 bit pattern stored in Float register */
2781663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(ity_RMode, Ity_D64, Ity_D64);
2782663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2783663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpD64:
2784663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D64,Ity_D64, Ity_I32);
2785663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2786663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpD128:
2787663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D128,Ity_D128, Ity_I32);
2788663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2789663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QuantizeD64:
2790663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SignificanceRoundD64:
2791663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         TERNARY(ity_RMode,Ity_D64,Ity_D64, Ity_D64);
2792663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2793663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_QuantizeD128:
2794663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SignificanceRoundD128:
2795663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         TERNARY(ity_RMode,Ity_D128,Ity_D128, Ity_D128);
2796663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2797663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShlD128:
2798663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_ShrD128:
2799663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_D128, Ity_I8, Ity_D128 );
2800663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2801663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_AddD64:
2802663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SubD64:
2803663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_MulD64:
2804663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_DivD64:
2805663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         TERNARY( ity_RMode, Ity_D64, Ity_D64, Ity_D64 );
2806663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2807663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_D128toD64:
2808663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY( ity_RMode, Ity_D128, Ity_D64 );
2809663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2810663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_AddD128:
2811663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_SubD128:
2812663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_MulD128:
2813663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_DivD128:
2814663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         TERNARY(ity_RMode,Ity_D128,Ity_D128, Ity_D128);
2815663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2816663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256to64_0: case Iop_V256to64_1:
2817663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256to64_2: case Iop_V256to64_3:
2818663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_V256, Ity_I64);
2819663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2820663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_64x4toV256:
2821663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         QUATERNARY(Ity_I64, Ity_I64, Ity_I64, Ity_I64, Ity_V256);
2822663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2823663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Add64Fx4: case Iop_Sub64Fx4:
2824663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Mul64Fx4: case Iop_Div64Fx4:
2825663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Add32Fx8: case Iop_Sub32Fx8:
2826663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Mul32Fx8: case Iop_Div32Fx8:
2827663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_AndV256:  case Iop_OrV256:
2828663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_XorV256:
2829663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Max32Fx8: case Iop_Min32Fx8:
2830663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Max64Fx4: case Iop_Min64Fx4:
2831663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_V256,Ity_V256, Ity_V256);
2832663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2833663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V256toV128_1: case Iop_V256toV128_0:
2834663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_V256, Ity_V128);
2835663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2836663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_V128HLtoV256:
2837663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         BINARY(Ity_V128,Ity_V128, Ity_V256);
2838663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2839663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_NotV256:
2840663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_RSqrt32Fx8:
2841663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Sqrt32Fx8:
2842663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Sqrt64Fx4:
2843663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_Recip32Fx8:
2844663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iop_CmpNEZ64x4: case Iop_CmpNEZ32x8:
2845663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         UNARY(Ity_V256, Ity_V256);
2846663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
2847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIROp(op);
2849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("typeOfPrimop");
2850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef UNARY
2852ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef BINARY
2853ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef TERNARY
2854ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef COMPARISON
2855ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown#  undef UNARY_COMPARISON
2856ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2857ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2858ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2859ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2860ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Helper functions for the IR -- IR Basic Blocks          ---*/
2861ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2862ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2863ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid addStmtToIRSB ( IRSB* bb, IRStmt* st )
2864ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2865ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
2866ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (bb->stmts_used == bb->stmts_size) {
2867ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRStmt** stmts2 = LibVEX_Alloc(2 * bb->stmts_size * sizeof(IRStmt*));
2868ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; i < bb->stmts_size; i++)
2869ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         stmts2[i] = bb->stmts[i];
2870ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      bb->stmts = stmts2;
2871ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      bb->stmts_size *= 2;
2872ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2873ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(bb->stmts_used < bb->stmts_size);
2874ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts[bb->stmts_used] = st;
2875ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bb->stmts_used++;
2876ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2877ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2878ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2879ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2880ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Helper functions for the IR -- IR Type Environments     ---*/
2881ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2882ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2883ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Allocate a new IRTemp, given its type. */
2884ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2885ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRTemp newIRTemp ( IRTypeEnv* env, IRType ty )
2886ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2887ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env);
2888ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env->types_used >= 0);
2889ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env->types_size >= 0);
2890ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(env->types_used <= env->types_size);
2891ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (env->types_used < env->types_size) {
2892ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      env->types[env->types_used] = ty;
2893ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return env->types_used++;
2894ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   } else {
2895ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      Int i;
2896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      Int new_size = env->types_size==0 ? 8 : 2*env->types_size;
2897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRType* new_types
2898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         = LibVEX_Alloc(new_size * sizeof(IRType));
2899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; i < env->types_used; i++)
2900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         new_types[i] = env->types[i];
2901ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      env->types      = new_types;
2902ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      env->types_size = new_size;
2903ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return newIRTemp(env, ty);
2904ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2906ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Helper functions for the IR -- finding types of exprs   ---*/
2910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
2911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Browninline
2913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRType typeOfIRTemp ( IRTypeEnv* env, IRTemp tmp )
2914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(tmp >= 0);
2916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(tmp < env->types_used);
2917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return env->types[tmp];
2918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRType typeOfIRConst ( IRConst* con )
2922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (con->tag) {
2924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:    return Ity_I1;
2925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:    return Ity_I8;
2926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16:   return Ity_I16;
2927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32:   return Ity_I32;
2928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64:   return Ity_I64;
2929b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32:   return Ity_F32;
2930b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i:  return Ity_F32;
2931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64:   return Ity_F64;
2932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i:  return Ity_F64;
2933ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128:  return Ity_V128;
2934663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ico_V256:  return Ity_V256;
2935ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("typeOfIRConst");
2936ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2937ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2938ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2939ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRType typeOfIRExpr ( IRTypeEnv* tyenv, IRExpr* e )
2940ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2941ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRType t_dst, t_arg1, t_arg2, t_arg3, t_arg4;
2942ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown start:
2943ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (e->tag) {
2944ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
2945ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.Load.ty;
2946ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
2947ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.Get.ty;
2948ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
2949ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.GetI.descr->elemTy;
2950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
2951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return typeOfIRTemp(tyenv, e->Iex.RdTmp.tmp);
2952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
2953ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return typeOfIRConst(e->Iex.Const.con);
2954ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Qop:
2955663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         typeOfPrimop(e->Iex.Qop.details->op,
2956ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2957ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2958ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Triop:
2959663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         typeOfPrimop(e->Iex.Triop.details->op,
2960ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2961ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2962ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop:
2963ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(e->Iex.Binop.op,
2964ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2965ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2966ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
2967ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(e->Iex.Unop.op,
2968ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
2969ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return t_dst;
2970ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
2971ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return e->Iex.CCall.retty;
2972ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
2973ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         e = e->Iex.Mux0X.expr0;
2974ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         goto start;
2975ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* return typeOfIRExpr(tyenv, e->Iex.Mux0X.expr0); */
2976ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binder:
2977ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("typeOfIRExpr: Binder is not a valid expression");
2978ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2979ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ppIRExpr(e);
2980ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("typeOfIRExpr");
2981ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2982ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2983ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
2984ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Is this any value actually in the enumeration 'IRType' ? */
2985ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool isPlausibleIRType ( IRType ty )
2986ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
2987ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (ty) {
2988ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_INVALID: case Ity_I1:
2989ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I8: case Ity_I16: case Ity_I32:
2990ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I64: case Ity_I128:
2991b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ity_F32: case Ity_F64: case Ity_F128:
2992663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D32: case Ity_D64: case Ity_D128:
2993663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_V128: case Ity_V256:
2994ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
2995ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
2996ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return False;
2997ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
2998ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
2999ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3000ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3001ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3002ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Sanity checking -- FLATNESS                             ---*/
3003ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3004ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3005ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Check that the canonical flatness constraints hold on an
3006ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt. The only place where any expression is allowed to be
3007ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   non-atomic is the RHS of IRStmt_Tmp. */
3008ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3009ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Relies on:
3010ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   inline static Bool isAtom ( IRExpr* e ) {
3011ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return e->tag == Iex_RdTmp || e->tag == Iex_Const;
3012ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3013ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown*/
3014ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3015ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool isFlatIRStmt ( IRStmt* st )
3016ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3017ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
3018ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRExpr*  e;
3019ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* di;
3020ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS*   cas;
3021663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRPutI*  puti;
3022663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRQop*   qop;
3023663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRTriop* triop;
3024ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3025ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (st->tag) {
3026ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
3027ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return isIRAtom(st->Ist.AbiHint.base)
3028ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                && isIRAtom(st->Ist.AbiHint.nia);
3029ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
3030ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return isIRAtom(st->Ist.Put.data);
3031ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
3032663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         puti = st->Ist.PutI.details;
3033663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         return toBool( isIRAtom(puti->ix)
3034663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                        && isIRAtom(puti->data) );
3035ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3036ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* This is the only interesting case.  The RHS can be any
3037ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            expression, *but* all its subexpressions *must* be
3038ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            atoms. */
3039ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         e = st->Ist.WrTmp.data;
3040ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         switch (e->tag) {
3041ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Binder: return True;
3042ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Get:    return True;
3043ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_GetI:   return isIRAtom(e->Iex.GetI.ix);
3044ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_RdTmp:  return True;
3045663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            case Iex_Qop:    qop = e->Iex.Qop.details;
3046663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                             return toBool(
3047663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    isIRAtom(qop->arg1)
3048663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    && isIRAtom(qop->arg2)
3049663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    && isIRAtom(qop->arg3)
3050663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    && isIRAtom(qop->arg4));
3051663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            case Iex_Triop:  triop = e->Iex.Triop.details;
3052663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                             return toBool(
3053663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    isIRAtom(triop->arg1)
3054663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    && isIRAtom(triop->arg2)
3055663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                                    && isIRAtom(triop->arg3));
3056ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Binop:  return toBool(
3057ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    isIRAtom(e->Iex.Binop.arg1)
3058ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Binop.arg2));
3059ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Unop:   return isIRAtom(e->Iex.Unop.arg);
3060ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Load:   return isIRAtom(e->Iex.Load.addr);
3061ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Const:  return True;
3062ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_CCall:  for (i = 0; e->Iex.CCall.args[i]; i++)
3063ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                if (!isIRAtom(e->Iex.CCall.args[i]))
3064ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                   return False;
3065ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             return True;
3066ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            case Iex_Mux0X:  return toBool (
3067ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    isIRAtom(e->Iex.Mux0X.cond)
3068ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Mux0X.expr0)
3069ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    && isIRAtom(e->Iex.Mux0X.exprX));
3070ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            default:         vpanic("isFlatIRStmt(e)");
3071ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3072ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /*notreached*/
3073ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vassert(0);
3074ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3075ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(st->Ist.Store.addr)
3076ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(st->Ist.Store.data) );
3077ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3078ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = st->Ist.CAS.details;
3079ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(cas->addr)
3080ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && (cas->expdHi ? isIRAtom(cas->expdHi) : True)
3081ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(cas->expdLo)
3082ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && (cas->dataHi ? isIRAtom(cas->dataHi) : True)
3083ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && isIRAtom(cas->dataLo) );
3084ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
3085ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( isIRAtom(st->Ist.LLSC.addr)
3086ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        && (st->Ist.LLSC.storedata
3087ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               ? isIRAtom(st->Ist.LLSC.storedata) : True) );
3088ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3089ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         di = st->Ist.Dirty.details;
3090ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!isIRAtom(di->guard))
3091ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            return False;
3092ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; di->args[i]; i++)
3093ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (!isIRAtom(di->args[i]))
3094ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               return False;
3095ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (di->mAddr && !isIRAtom(di->mAddr))
3096ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            return False;
3097ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
3098ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
3099ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
3100ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
3101ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
3102ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
3103ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return isIRAtom(st->Ist.Exit.guard);
3104ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3105ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("isFlatIRStmt(st)");
3106ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3107ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3108ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3109ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3110ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3111ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Sanity checking                                         ---*/
3112ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3113ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3114ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Checks:
3115ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3116ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Everything is type-consistent.  No ill-typed anything.
3117ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   The target address at the end of the BB is a 32- or 64-
3118ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   bit expression, depending on the guest's word size.
3119ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3120ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Each temp is assigned only once, before its uses.
3121ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown*/
3122ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3123ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic inline Int countArgs ( IRExpr** args )
3124ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3125ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
3126ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; args[i]; i++)
3127ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ;
3128ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return i;
3129ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3130ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3131ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3132ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown__attribute((noreturn))
3133ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid sanityCheckFail ( IRSB* bb, IRStmt* stmt, HChar* what )
3134ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3135ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("\nIR SANITY CHECK FAILURE\n\n");
3136ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   ppIRSB(bb);
3137ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (stmt) {
3138ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("\nIN STATEMENT:\n\n");
3139ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      ppIRStmt(stmt);
3140ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3141ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vex_printf("\n\nERROR = %s\n\n", what );
3142ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vpanic("sanityCheckFail: exiting due to bad IR");
3143ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3144ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3145ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic Bool saneIRRegArray ( IRRegArray* arr )
3146ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3147ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (arr->base < 0 || arr->base > 10000 /* somewhat arbitrary */)
3148ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3149ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (arr->elemTy == Ity_I1)
3150ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3151ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (arr->nElems <= 0 || arr->nElems > 500 /* somewhat arbitrary */)
3152ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3153ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return True;
3154ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3155ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3156ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic Bool saneIRCallee ( IRCallee* cee )
3157ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3158ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cee->name == NULL)
3159ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3160ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cee->addr == 0)
3161ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3162ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (cee->regparms < 0 || cee->regparms > 3)
3163ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3164ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return True;
3165ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3166ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3167ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic Bool saneIRConst ( IRConst* con )
3168ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3169ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (con->tag) {
3170ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:
3171ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return toBool( con->Ico.U1 == True || con->Ico.U1 == False );
3172ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3173ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* Is there anything we can meaningfully check?  I don't
3174ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            think so. */
3175ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         return True;
3176ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3177ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3178ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3179ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/* Traverse a Stmt/Expr, inspecting IRTemp uses.  Report any out of
3180ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   range ones.  Report any which are read and for which the current
3181ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   def_count is zero. */
3182ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3183ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3184ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid useBeforeDef_Temp ( IRSB* bb, IRStmt* stmt, IRTemp tmp, Int* def_counts )
3185ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3186ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (tmp < 0 || tmp >= bb->tyenv->types_used)
3187ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sanityCheckFail(bb,stmt, "out of range Temp in IRExpr");
3188ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (def_counts[tmp] < 1)
3189ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sanityCheckFail(bb,stmt, "IRTemp use before def in IRExpr");
3190ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3191ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3192ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3193ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid useBeforeDef_Expr ( IRSB* bb, IRStmt* stmt, IRExpr* expr, Int* def_counts )
3194ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3195ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int i;
3196ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (expr->tag) {
3197ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
3198ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3199ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
3200ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.GetI.ix,def_counts);
3201ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3202ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
3203ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Temp(bb,stmt,expr->Iex.RdTmp.tmp,def_counts);
3204ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3205663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iex_Qop: {
3206663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         IRQop* qop = expr->Iex.Qop.details;
3207663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,qop->arg1,def_counts);
3208663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,qop->arg2,def_counts);
3209663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,qop->arg3,def_counts);
3210663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,qop->arg4,def_counts);
3211ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3212663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      }
3213663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Iex_Triop: {
3214663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         IRTriop* triop = expr->Iex.Triop.details;
3215663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,triop->arg1,def_counts);
3216663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,triop->arg2,def_counts);
3217663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,triop->arg3,def_counts);
3218ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3219663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      }
3220ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop:
3221ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Binop.arg1,def_counts);
3222ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Binop.arg2,def_counts);
3223ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3224ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
3225ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Unop.arg,def_counts);
3226ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3227ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
3228ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Load.addr,def_counts);
3229ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3230ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
3231ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3232ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
3233ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; expr->Iex.CCall.args[i]; i++)
3234ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,expr->Iex.CCall.args[i],def_counts);
3235ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3236ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
3237ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.cond,def_counts);
3238ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.expr0,def_counts);
3239ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,expr->Iex.Mux0X.exprX,def_counts);
3240ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3241ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3242ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("useBeforeDef_Expr");
3243ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3244ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3245ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3246ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3247ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid useBeforeDef_Stmt ( IRSB* bb, IRStmt* stmt, Int* def_counts )
3248ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3249ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int      i;
3250ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d;
3251ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS*   cas;
3252663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRPutI*  puti;
3253ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (stmt->tag) {
3254ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
3255ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3256ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
3257ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.base,def_counts);
3258ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.AbiHint.nia,def_counts);
3259ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3260ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
3261ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Put.data,def_counts);
3262ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3263ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
3264663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         puti = stmt->Ist.PutI.details;
3265663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,puti->ix,def_counts);
3266663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         useBeforeDef_Expr(bb,stmt,puti->data,def_counts);
3267ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3268ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3269ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.WrTmp.data,def_counts);
3270ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3271ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3272ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Store.addr,def_counts);
3273ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Store.data,def_counts);
3274ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3275ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3276ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = stmt->Ist.CAS.details;
3277ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,cas->addr,def_counts);
3278ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->expdHi)
3279ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,cas->expdHi,def_counts);
3280ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,cas->expdLo,def_counts);
3281ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->dataHi)
3282ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,cas->dataHi,def_counts);
3283ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,cas->dataLo,def_counts);
3284ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3285ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
3286ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.LLSC.addr,def_counts);
3287ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.storedata != NULL)
3288ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,stmt->Ist.LLSC.storedata,def_counts);
3289ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3290ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3291ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         d = stmt->Ist.Dirty.details;
3292ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; d->args[i] != NULL; i++)
3293ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,d->args[i],def_counts);
3294ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->mFx != Ifx_None)
3295ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            useBeforeDef_Expr(bb,stmt,d->mAddr,def_counts);
3296ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3297ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
3298ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
3299ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3300ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
3301ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         useBeforeDef_Expr(bb,stmt,stmt->Ist.Exit.guard,def_counts);
3302ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3303ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3304ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("useBeforeDef_Stmt");
3305ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3306ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3307ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3308ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3309ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid tcExpr ( IRSB* bb, IRStmt* stmt, IRExpr* expr, IRType gWordTy )
3310ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3311ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int        i;
3312ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRType     t_dst, t_arg1, t_arg2, t_arg3, t_arg4;
3313ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* tyenv = bb->tyenv;
3314ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (expr->tag) {
3315ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Get:
3316ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_RdTmp:
3317ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3318ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_GetI:
3319ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.GetI.ix, gWordTy );
3320ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,expr->Iex.GetI.ix) != Ity_I32)
3321ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRExpr.GetI.ix: not :: Ity_I32");
3322ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRRegArray(expr->Iex.GetI.descr))
3323ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRExpr.GetI.descr: invalid descr");
3324ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3325ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Qop: {
3326ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType ttarg1, ttarg2, ttarg3, ttarg4;
3327663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         IRQop* qop = expr->Iex.Qop.details;
3328663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, qop->arg1, gWordTy );
3329663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, qop->arg2, gWordTy );
3330663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, qop->arg3, gWordTy );
3331663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, qop->arg4, gWordTy );
3332663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         typeOfPrimop(qop->op,
3333ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3334ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 == Ity_INVALID
3335ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 == Ity_INVALID || t_arg4 == Ity_INVALID) {
3336ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: " );
3337663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            ppIROp(qop->op);
3338ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3339ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3340ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Qop: wrong arity op\n"
3341ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... name of op precedes BB printout\n");
3342ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3343663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg1 = typeOfIRExpr(tyenv, qop->arg1);
3344663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg2 = typeOfIRExpr(tyenv, qop->arg2);
3345663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg3 = typeOfIRExpr(tyenv, qop->arg3);
3346663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg4 = typeOfIRExpr(tyenv, qop->arg4);
3347ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != ttarg1 || t_arg2 != ttarg2
3348ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 != ttarg3 || t_arg4 != ttarg4) {
3349ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: ");
3350663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            ppIROp(qop->op);
3351ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3352ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op type is (");
3353ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg1);
3354ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3355ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg2);
3356ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3357ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg3);
3358ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3359ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg4);
3360ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") -> ");
3361ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType (t_dst);
3362ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\narg tys are (");
3363ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg1);
3364ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3365ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg2);
3366ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3367ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg3);
3368ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3369ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg4);
3370ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")\n");
3371ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3372ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Qop: arg tys don't match op tys\n"
3373ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... additional details precede BB printout\n");
3374ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3375ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3376ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3377ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Triop: {
3378ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType ttarg1, ttarg2, ttarg3;
3379663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         IRTriop *triop = expr->Iex.Triop.details;
3380663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, triop->arg1, gWordTy );
3381663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, triop->arg2, gWordTy );
3382663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr(bb,stmt, triop->arg3, gWordTy );
3383663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         typeOfPrimop(triop->op,
3384ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3385ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 == Ity_INVALID
3386ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 == Ity_INVALID || t_arg4 != Ity_INVALID) {
3387ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: " );
3388663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            ppIROp(triop->op);
3389ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3390ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3391ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Triop: wrong arity op\n"
3392ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... name of op precedes BB printout\n");
3393ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3394663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg1 = typeOfIRExpr(tyenv, triop->arg1);
3395663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg2 = typeOfIRExpr(tyenv, triop->arg2);
3396663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         ttarg3 = typeOfIRExpr(tyenv, triop->arg3);
3397ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != ttarg1 || t_arg2 != ttarg2 || t_arg3 != ttarg3) {
3398ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: ");
3399663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            ppIROp(triop->op);
3400ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3401ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op type is (");
3402ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg1);
3403ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3404ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg2);
3405ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3406ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg3);
3407ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") -> ");
3408ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType (t_dst);
3409ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\narg tys are (");
3410ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg1);
3411ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3412ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg2);
3413ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3414ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg3);
3415ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")\n");
3416ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3417ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Triop: arg tys don't match op tys\n"
3418ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... additional details precede BB printout\n");
3419ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3420ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3421ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3422ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Binop: {
3423ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType ttarg1, ttarg2;
3424ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Binop.arg1, gWordTy );
3425ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Binop.arg2, gWordTy );
3426ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         typeOfPrimop(expr->Iex.Binop.op,
3427ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3428ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 == Ity_INVALID
3429ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 != Ity_INVALID || t_arg4 != Ity_INVALID) {
3430ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: " );
3431ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Binop.op);
3432ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3433ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3434ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Binop: wrong arity op\n"
3435ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... name of op precedes BB printout\n");
3436ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3437ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg1 = typeOfIRExpr(tyenv, expr->Iex.Binop.arg1);
3438ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         ttarg2 = typeOfIRExpr(tyenv, expr->Iex.Binop.arg2);
3439ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != ttarg1 || t_arg2 != ttarg2) {
3440ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op name: ");
3441ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIROp(expr->Iex.Binop.op);
3442ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\n");
3443ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(" op type is (");
3444ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg1);
3445ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3446ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(t_arg2);
3447ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(") -> ");
3448ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType (t_dst);
3449ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf("\narg tys are (");
3450ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg1);
3451ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(",");
3452ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            ppIRType(ttarg2);
3453ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            vex_printf(")\n");
3454ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,
3455ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "Iex.Binop: arg tys don't match op tys\n"
3456ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "... additional details precede BB printout\n");
3457ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3458ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3459ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3460ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Unop:
3461ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Unop.arg, gWordTy );
3462663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         typeOfPrimop(expr->Iex.Unop.op,
3463ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                      &t_dst, &t_arg1, &t_arg2, &t_arg3, &t_arg4);
3464ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 == Ity_INVALID || t_arg2 != Ity_INVALID
3465ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || t_arg3 != Ity_INVALID || t_arg4 != Ity_INVALID)
3466ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Unop: wrong arity op");
3467ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (t_arg1 != typeOfIRExpr(tyenv, expr->Iex.Unop.arg))
3468ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Unop: arg ty doesn't match op ty");
3469ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3470ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Load:
3471ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Load.addr, gWordTy);
3472ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, expr->Iex.Load.addr) != gWordTy)
3473ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Load.addr: not :: guest word type");
3474ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (expr->Iex.Load.end != Iend_LE && expr->Iex.Load.end != Iend_BE)
3475ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Load.end: bogus endianness");
3476ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3477ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_CCall:
3478ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRCallee(expr->Iex.CCall.cee))
3479ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.CCall.cee: bad IRCallee");
3480ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (expr->Iex.CCall.cee->regparms > countArgs(expr->Iex.CCall.args))
3481ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.CCall.cee: #regparms > #args");
3482ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; expr->Iex.CCall.args[i]; i++) {
3483ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (i >= 32)
3484ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Iex.CCall: > 32 args");
3485ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tcExpr(bb,stmt, expr->Iex.CCall.args[i], gWordTy);
3486ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3487ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (expr->Iex.CCall.retty == Ity_I1)
3488ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.CCall.retty: cannot return :: Ity_I1");
3489ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; expr->Iex.CCall.args[i]; i++)
3490ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (typeOfIRExpr(tyenv, expr->Iex.CCall.args[i]) == Ity_I1)
3491ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Iex.CCall.arg: arg :: Ity_I1");
3492ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3493ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Const:
3494ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRConst(expr->Iex.Const.con))
3495ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Const.con: invalid const");
3496ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3497ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Iex_Mux0X:
3498ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Mux0X.cond, gWordTy);
3499ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Mux0X.expr0, gWordTy);
3500ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr(bb,stmt, expr->Iex.Mux0X.exprX, gWordTy);
3501ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, expr->Iex.Mux0X.cond) != Ity_I8)
3502ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Mux0X.cond: cond :: Ity_I8");
3503ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, expr->Iex.Mux0X.expr0)
3504ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             != typeOfIRExpr(tyenv, expr->Iex.Mux0X.exprX))
3505ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Iex.Mux0X: expr0/exprX mismatch");
3506ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3507ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown       default:
3508ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("tcExpr");
3509ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3510ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3511ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3512ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3513ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownstatic
3514ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid tcStmt ( IRSB* bb, IRStmt* stmt, IRType gWordTy )
3515ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3516ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int        i;
3517ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty*   d;
3518ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRCAS*     cas;
3519663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   IRPutI*    puti;
3520ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRType     tyExpd, tyData;
3521ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRTypeEnv* tyenv = bb->tyenv;
3522ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (stmt->tag) {
3523ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_IMark:
3524ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* Somewhat heuristic, but rule out totally implausible
3525b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            instruction sizes and deltas. */
3526ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.IMark.len < 0 || stmt->Ist.IMark.len > 20)
3527ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.IMark.len: implausible");
3528b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov         if (stmt->Ist.IMark.delta > 1)
3529b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            sanityCheckFail(bb,stmt,"IRStmt.IMark.delta: implausible");
3530ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3531ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_AbiHint:
3532ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.AbiHint.base) != gWordTy)
3533ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.AbiHint.base: "
3534ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    "not :: guest word type");
3535ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.AbiHint.nia) != gWordTy)
3536ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.AbiHint.nia: "
3537ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                                    "not :: guest word type");
3538ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3539ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Put:
3540ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Put.data, gWordTy );
3541ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.Put.data) == Ity_I1)
3542ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Put.data: cannot Put :: Ity_I1");
3543ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3544ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_PutI:
3545663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         puti = stmt->Ist.PutI.details;
3546663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr( bb, stmt, puti->data, gWordTy );
3547663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         tcExpr( bb, stmt, puti->ix, gWordTy );
3548663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         if (typeOfIRExpr(tyenv,puti->data) == Ity_I1)
3549ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.data: cannot PutI :: Ity_I1");
3550663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         if (typeOfIRExpr(tyenv,puti->data)
3551663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng             != puti->descr->elemTy)
3552ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.data: data ty != elem ty");
3553663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         if (typeOfIRExpr(tyenv,puti->ix) != Ity_I32)
3554ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.ix: not :: Ity_I32");
3555663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         if (!saneIRRegArray(puti->descr))
3556ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.PutI.descr: invalid descr");
3557ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3558ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3559ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.WrTmp.data, gWordTy );
3560ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRTemp(tyenv, stmt->Ist.WrTmp.tmp)
3561ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             != typeOfIRExpr(tyenv, stmt->Ist.WrTmp.data))
3562ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Put.Tmp: tmp and expr do not match");
3563ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3564ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3565ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Store.addr, gWordTy );
3566ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Store.data, gWordTy );
3567ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.Store.addr) != gWordTy)
3568ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Store.addr: not :: guest word type");
3569ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.Store.data) == Ity_I1)
3570ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Store.data: cannot Store :: Ity_I1");
3571ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.Store.end != Iend_LE && stmt->Ist.Store.end != Iend_BE)
3572ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Ist.Store.end: bogus endianness");
3573ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3574ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3575ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = stmt->Ist.CAS.details;
3576ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* make sure it's definitely either a CAS or a DCAS */
3577ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi == IRTemp_INVALID
3578ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             && cas->expdHi == NULL && cas->dataHi == NULL) {
3579ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* fine; it's a single cas */
3580ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3581ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         else
3582ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi != IRTemp_INVALID
3583ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             && cas->expdHi != NULL && cas->dataHi != NULL) {
3584ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* fine; it's a double cas */
3585ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3586ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         else {
3587ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* it's some el-mutanto hybrid */
3588ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_cas;
3589ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3590ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check the address type */
3591ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, cas->addr, gWordTy );
3592ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, cas->addr) != gWordTy) goto bad_cas;
3593ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check types on the {old,expd,data}Lo components agree */
3594ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tyExpd = typeOfIRExpr(tyenv, cas->expdLo);
3595ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tyData = typeOfIRExpr(tyenv, cas->dataLo);
3596ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (tyExpd != tyData) goto bad_cas;
3597ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (tyExpd != typeOfIRTemp(tyenv, cas->oldLo))
3598ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_cas;
3599ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* check the base element type is sane */
3600ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (tyExpd == Ity_I8 || tyExpd == Ity_I16 || tyExpd == Ity_I32
3601ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             || (gWordTy == Ity_I64 && tyExpd == Ity_I64)) {
3602ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* fine */
3603ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
3604ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_cas;
3605ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3606ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* If it's a DCAS, check types on the {old,expd,data}Hi
3607ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            components too */
3608ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi != IRTemp_INVALID) {
3609ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tyExpd = typeOfIRExpr(tyenv, cas->expdHi);
3610ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tyData = typeOfIRExpr(tyenv, cas->dataHi);
3611ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (tyExpd != tyData) goto bad_cas;
3612ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (tyExpd != typeOfIRTemp(tyenv, cas->oldHi))
3613ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_cas;
3614ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* and finally check that oldLo and oldHi have the same
3615ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               type.  This forces equivalence amongst all 6 types. */
3616ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (typeOfIRTemp(tyenv, cas->oldHi)
3617ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                != typeOfIRTemp(tyenv, cas->oldLo))
3618ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_cas;
3619ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3620ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3621ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         bad_cas:
3622ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb,stmt,"IRStmt.CAS: ill-formed");
3623ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3624ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC: {
3625ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         IRType tyRes;
3626ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, stmt->Ist.LLSC.addr) != gWordTy)
3627ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.LLSC.addr: not :: guest word type");
3628ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.end != Iend_LE && stmt->Ist.LLSC.end != Iend_BE)
3629ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"Ist.LLSC.end: bogus endianness");
3630ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tyRes = typeOfIRTemp(tyenv, stmt->Ist.LLSC.result);
3631ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.storedata == NULL) {
3632ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* it's a LL */
3633b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            if (tyRes != Ity_I64 && tyRes != Ity_I32
3634b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                && tyRes != Ity_I16 && tyRes != Ity_I8)
3635ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Ist.LLSC(LL).result :: bogus");
3636ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
3637ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            /* it's a SC */
3638ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (tyRes != Ity_I1)
3639ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"Ist.LLSC(SC).result: not :: Ity_I1");
3640ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            tyData = typeOfIRExpr(tyenv, stmt->Ist.LLSC.storedata);
3641b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            if (tyData != Ity_I64 && tyData != Ity_I32
3642b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov                && tyData != Ity_I16 && tyData != Ity_I8)
3643ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,
3644ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                               "Ist.LLSC(SC).result :: storedata bogus");
3645ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3646ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3647ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3648ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3649ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* Mostly check for various kinds of ill-formed dirty calls. */
3650ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         d = stmt->Ist.Dirty.details;
3651ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->cee == NULL) goto bad_dirty;
3652ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRCallee(d->cee)) goto bad_dirty;
3653ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->cee->regparms > countArgs(d->args)) goto bad_dirty;
3654ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->mFx == Ifx_None) {
3655ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->mAddr != NULL || d->mSize != 0)
3656ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_dirty;
3657ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         } else {
3658ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->mAddr == NULL || d->mSize == 0)
3659ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               goto bad_dirty;
3660ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3661ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->nFxState < 0 || d->nFxState > VEX_N_FXSTATE)
3662ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_dirty;
3663ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->nFxState == 0 && d->needsBBP)
3664ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            goto bad_dirty;
3665ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; i < d->nFxState; i++) {
3666ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->fxState[i].fx == Ifx_None) goto bad_dirty;
3667ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->fxState[i].size <= 0) goto bad_dirty;
3668663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            if (d->fxState[i].nRepeats == 0) {
3669663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng               if (d->fxState[i].repeatLen != 0) goto bad_dirty;
3670663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            } else {
3671663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng               if (d->fxState[i].repeatLen <= d->fxState[i].size)
3672663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                  goto bad_dirty;
3673663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng               /* the % is safe because of the .size check above */
3674663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng               if ((d->fxState[i].repeatLen % d->fxState[i].size) != 0)
3675663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                  goto bad_dirty;
3676663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            }
3677ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3678663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         /* check guard */
3679ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->guard == NULL) goto bad_dirty;
3680ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, d->guard, gWordTy );
3681ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv, d->guard) != Ity_I1)
3682ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Dirty.guard not :: Ity_I1");
3683663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         /* A dirty helper that is executed conditionally (or not at
3684663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            all) may not return a value.  Hence if .tmp is not
3685663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            IRTemp_INVALID, .guard must be manifestly True at JIT
3686663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            time. */
3687663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         if (d->tmp != IRTemp_INVALID
3688663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng             && (d->guard->tag != Iex_Const
3689663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                 || d->guard->Iex.Const.con->Ico.U1 == 0))
3690663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            sanityCheckFail(bb,stmt,"IRStmt.Dirty with a return value"
3691663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng                            " is executed under a condition");
3692663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         /* check types, minimally */
3693ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (d->tmp != IRTemp_INVALID
3694ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             && typeOfIRTemp(tyenv, d->tmp) == Ity_I1)
3695ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Dirty.dst :: Ity_I1");
3696ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         for (i = 0; d->args[i] != NULL; i++) {
3697ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (i >= 32)
3698ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"IRStmt.Dirty: > 32 args");
3699ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (typeOfIRExpr(tyenv, d->args[i]) == Ity_I1)
3700ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb,stmt,"IRStmt.Dirty.arg[i] :: Ity_I1");
3701ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3702ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3703ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         bad_dirty:
3704ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb,stmt,"IRStmt.Dirty: ill-formed");
3705ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3706ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_NoOp:
3707ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3708ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_MBE:
3709ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         switch (stmt->Ist.MBE.event) {
3710b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov            case Imbe_Fence: case Imbe_CancelReservation:
3711ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               break;
3712ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            default: sanityCheckFail(bb,stmt,"IRStmt.MBE.event: unknown");
3713ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               break;
3714ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3715ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3716ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Exit:
3717ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcExpr( bb, stmt, stmt->Ist.Exit.guard, gWordTy );
3718ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRExpr(tyenv,stmt->Ist.Exit.guard) != Ity_I1)
3719ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Exit.guard: not :: Ity_I1");
3720ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!saneIRConst(stmt->Ist.Exit.dst))
3721ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: bad dst");
3722ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (typeOfIRConst(stmt->Ist.Exit.dst) != gWordTy)
3723ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb,stmt,"IRStmt.Exit.dst: not :: guest word type");
3724663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         /* because it would intersect with host_EvC_* */
3725663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng         if (stmt->Ist.Exit.offsIP < 16)
3726663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng            sanityCheckFail(bb,stmt,"IRStmt.Exit.offsIP: too low");
3727ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3728ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3729ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vpanic("tcStmt");
3730ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3731ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3732ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3733ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brownvoid sanityCheckIRSB ( IRSB* bb,          HChar* caller,
3734ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                       Bool require_flat, IRType guest_word_size )
3735ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3736ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int     i;
3737ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRStmt* stmt;
3738ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int     n_temps    = bb->tyenv->types_used;
3739ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   Int*    def_counts = LibVEX_Alloc(n_temps * sizeof(Int));
3740ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3741ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (0)
3742ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vex_printf("sanityCheck: %s\n", caller);
3743ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3744ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(guest_word_size == Ity_I32
3745ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown           || guest_word_size == Ity_I64);
3746ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3747ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (bb->stmts_used < 0 || bb->stmts_size < 8
3748ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown       || bb->stmts_used > bb->stmts_size)
3749ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* this BB is so strange we can't even print it */
3750ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      vpanic("sanityCheckIRSB: stmts array limits wierd");
3751ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3752ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Ensure each temp has a plausible type. */
3753ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < n_temps; i++) {
3754ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRType ty = typeOfIRTemp(bb->tyenv,(IRTemp)i);
3755ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (!isPlausibleIRType(ty)) {
3756ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         vex_printf("Temp t%d declared with implausible type 0x%x\n",
3757ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                    i, (UInt)ty);
3758ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb,NULL,"Temp declared with implausible type");
3759ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3760ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3761ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3762ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Check for flatness, if required. */
3763ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (require_flat) {
3764ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      for (i = 0; i < bb->stmts_used; i++) {
3765ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         stmt = bb->stmts[i];
3766ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!stmt)
3767ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt, "IRStmt: is NULL");
3768ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (!isFlatIRStmt(stmt))
3769ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt, "IRStmt: is not flat");
3770ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3771ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (!isIRAtom(bb->next))
3772ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         sanityCheckFail(bb, NULL, "bb->next is not an atom");
3773ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3774ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3775ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Count the defs of each temp.  Only one def is allowed.
3776ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      Also, check that each used temp has already been defd. */
3777ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3778ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < n_temps; i++)
3779ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      def_counts[i] = 0;
3780ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3781ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb->stmts_used; i++) {
3782ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRDirty* d;
3783ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      IRCAS*   cas;
3784ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      stmt = bb->stmts[i];
3785ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* Check any temps used by this statement. */
3786ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      useBeforeDef_Stmt(bb,stmt,def_counts);
3787ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3788ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      /* Now make note of any temps defd by this statement. */
3789ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      switch (stmt->tag) {
3790ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_WrTmp:
3791ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.WrTmp.tmp < 0 || stmt->Ist.WrTmp.tmp >= n_temps)
3792ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3793ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.Tmp: destination tmp is out of range");
3794ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         def_counts[stmt->Ist.WrTmp.tmp]++;
3795ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (def_counts[stmt->Ist.WrTmp.tmp] > 1)
3796ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3797ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.Tmp: destination tmp is assigned more than once");
3798ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3799ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Store:
3800ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3801ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_Dirty:
3802ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.Dirty.details->tmp != IRTemp_INVALID) {
3803ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            d = stmt->Ist.Dirty.details;
3804ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (d->tmp < 0 || d->tmp >= n_temps)
3805ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb, stmt,
3806ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  "IRStmt.Dirty: destination tmp is out of range");
3807ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            def_counts[d->tmp]++;
3808ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (def_counts[d->tmp] > 1)
3809ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               sanityCheckFail(bb, stmt,
3810ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  "IRStmt.Dirty: destination tmp is assigned more than once");
3811ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3812ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3813ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_CAS:
3814ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         cas = stmt->Ist.CAS.details;
3815ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldHi != IRTemp_INVALID) {
3816ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            if (cas->oldHi < 0 || cas->oldHi >= n_temps)
3817ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                sanityCheckFail(bb, stmt,
3818ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   "IRStmt.CAS: destination tmpHi is out of range");
3819ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             def_counts[cas->oldHi]++;
3820ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown             if (def_counts[cas->oldHi] > 1)
3821ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                sanityCheckFail(bb, stmt,
3822ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                   "IRStmt.CAS: destination tmpHi is assigned more than once");
3823ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         }
3824ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (cas->oldLo < 0 || cas->oldLo >= n_temps)
3825ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3826ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.CAS: destination tmpLo is out of range");
3827ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         def_counts[cas->oldLo]++;
3828ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (def_counts[cas->oldLo] > 1)
3829ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3830ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.CAS: destination tmpLo is assigned more than once");
3831ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3832ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ist_LLSC:
3833ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (stmt->Ist.LLSC.result < 0 || stmt->Ist.LLSC.result >= n_temps)
3834ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3835ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.LLSC: destination tmp is out of range");
3836ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         def_counts[stmt->Ist.LLSC.result]++;
3837ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         if (def_counts[stmt->Ist.LLSC.result] > 1)
3838ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown            sanityCheckFail(bb, stmt,
3839ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               "IRStmt.LLSC: destination tmp is assigned more than once");
3840ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3841ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default:
3842ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         /* explicitly handle the rest, so as to keep gcc quiet */
3843ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         break;
3844ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      }
3845ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3846ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3847ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   /* Typecheck everything. */
3848ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   for (i = 0; i < bb->stmts_used; i++)
3849ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      if (bb->stmts[i])
3850ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown         tcStmt( bb, bb->stmts[i], guest_word_size );
3851ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (typeOfIRExpr(bb->tyenv,bb->next) != guest_word_size)
3852ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      sanityCheckFail(bb, NULL, "bb->next field has wrong type");
3853663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   /* because it would intersect with host_EvC_* */
3854663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng   if (bb->offsIP < 16)
3855663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      sanityCheckFail(bb, NULL, "bb->offsIP: too low");
3856663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng
3857ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3858ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3859ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3860ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- Misc helper functions                                   ---*/
3861ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3862ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3863ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool eqIRConst ( IRConst* c1, IRConst* c2 )
3864ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3865ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (c1->tag != c2->tag)
3866ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return False;
3867ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3868ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (c1->tag) {
3869ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U1:  return toBool( (1 & c1->Ico.U1) == (1 & c2->Ico.U1) );
3870ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U8:  return toBool( c1->Ico.U8  == c2->Ico.U8 );
3871ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U16: return toBool( c1->Ico.U16 == c2->Ico.U16 );
3872ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U32: return toBool( c1->Ico.U32 == c2->Ico.U32 );
3873ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_U64: return toBool( c1->Ico.U64 == c2->Ico.U64 );
3874b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32: return toBool( c1->Ico.F32 == c2->Ico.F32 );
3875b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ico_F32i: return toBool( c1->Ico.F32i == c2->Ico.F32i );
3876ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64: return toBool( c1->Ico.F64 == c2->Ico.F64 );
3877ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_F64i: return toBool( c1->Ico.F64i == c2->Ico.F64i );
3878ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ico_V128: return toBool( c1->Ico.V128 == c2->Ico.V128 );
3879663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ico_V256: return toBool( c1->Ico.V256 == c2->Ico.V256 );
3880ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vpanic("eqIRConst");
3881ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3882ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3883ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3884ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool eqIRRegArray ( IRRegArray* descr1, IRRegArray* descr2 )
3885ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3886ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return toBool( descr1->base == descr2->base
3887ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  && descr1->elemTy == descr2->elemTy
3888ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                  && descr1->nElems == descr2->nElems );
3889ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3890ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3891ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownInt sizeofIRType ( IRType ty )
3892ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3893ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   switch (ty) {
3894ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I8:   return 1;
3895ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I16:  return 2;
3896ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I32:  return 4;
3897ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I64:  return 8;
3898ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_I128: return 16;
3899ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_F32:  return 4;
3900ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_F64:  return 8;
3901b32f58018498ea2225959b0ba11c18f0c433deefEvgeniy Stepanov      case Ity_F128: return 16;
3902663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D32:  return 4;
3903663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D64:  return 8;
3904663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_D128: return 16;
3905ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      case Ity_V128: return 16;
3906663860b1408516d02ebfcb3a9999a134e6cfb223Ben Cheng      case Ity_V256: return 32;
3907ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      default: vex_printf("\n"); ppIRType(ty); vex_printf("\n");
3908ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown               vpanic("sizeofIRType");
3909ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   }
3910ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3911ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3912ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* mkIRExpr_HWord ( HWord hw )
3913ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3914ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(sizeof(void*) == sizeof(HWord));
3915ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (sizeof(HWord) == 4)
3916ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return IRExpr_Const(IRConst_U32((UInt)hw));
3917ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (sizeof(HWord) == 8)
3918ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return IRExpr_Const(IRConst_U64((ULong)hw));
3919ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vpanic("mkIRExpr_HWord");
3920ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3921ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3922ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* unsafeIRDirty_0_N ( Int regparms, HChar* name, void* addr,
3923ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             IRExpr** args )
3924ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3925ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d = emptyIRDirty();
3926ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->cee   = mkIRCallee ( regparms, name, addr );
3927ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->guard = IRExpr_Const(IRConst_U1(True));
3928ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->args  = args;
3929ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d;
3930ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3931ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3932ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRDirty* unsafeIRDirty_1_N ( IRTemp dst,
3933ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             Int regparms, HChar* name, void* addr,
3934ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                             IRExpr** args )
3935ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3936ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   IRDirty* d = emptyIRDirty();
3937ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->cee   = mkIRCallee ( regparms, name, addr );
3938ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->guard = IRExpr_Const(IRConst_U1(True));
3939ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->args  = args;
3940ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   d->tmp   = dst;
3941ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return d;
3942ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3943ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3944ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownIRExpr* mkIRExprCCall ( IRType retty,
3945ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        Int regparms, HChar* name, void* addr,
3946ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                        IRExpr** args )
3947ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3948ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return IRExpr_CCall ( mkIRCallee ( regparms, name, addr ),
3949ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown                         retty, args );
3950ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3951ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3952ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff BrownBool eqIRAtom ( IRExpr* a1, IRExpr* a2 )
3953ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown{
3954ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(isIRAtom(a1));
3955ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   vassert(isIRAtom(a2));
3956ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (a1->tag == Iex_RdTmp && a2->tag == Iex_RdTmp)
3957ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return toBool(a1->Iex.RdTmp.tmp == a2->Iex.RdTmp.tmp);
3958ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   if (a1->tag == Iex_Const && a2->tag == Iex_Const)
3959ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown      return eqIRConst(a1->Iex.Const.con, a2->Iex.Const.con);
3960ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown   return False;
3961ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown}
3962ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown
3963ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3964ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*--- end                                           ir_defs.c ---*/
3965ed07e00d438c74b7a23c01bfffde77e3968305e4Jeff Brown/*---------------------------------------------------------------*/
3966