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