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