buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "Dalvik.h" |
| 18 | #include "Dataflow.h" |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 19 | |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 20 | namespace art { |
| 21 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 22 | /* |
| 23 | * Main table containing data flow attributes for each bytecode. The |
| 24 | * first kNumPackedOpcodes entries are for Dalvik bytecode |
| 25 | * instructions, where extended opcode at the MIR level are appended |
| 26 | * afterwards. |
| 27 | * |
| 28 | * TODO - many optimization flags are incomplete - they will only limit the |
| 29 | * scope of optimizations but will not cause mis-optimizations. |
| 30 | */ |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 31 | const int oatDataFlowAttributes[kMirOpLast] = { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 32 | // 00 NOP |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 33 | DF_NOP, |
| 34 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 35 | // 01 MOVE vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 36 | DF_DA | DF_UB | DF_IS_MOVE, |
| 37 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 38 | // 02 MOVE_FROM16 vAA, vBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 39 | DF_DA | DF_UB | DF_IS_MOVE, |
| 40 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 41 | // 03 MOVE_16 vAAAA, vBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 42 | DF_DA | DF_UB | DF_IS_MOVE, |
| 43 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 44 | // 04 MOVE_WIDE vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 45 | DF_DA_WIDE | DF_UB_WIDE | DF_IS_MOVE, |
| 46 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 47 | // 05 MOVE_WIDE_FROM16 vAA, vBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 48 | DF_DA_WIDE | DF_UB_WIDE | DF_IS_MOVE, |
| 49 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 50 | // 06 MOVE_WIDE_16 vAAAA, vBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 51 | DF_DA_WIDE | DF_UB_WIDE | DF_IS_MOVE, |
| 52 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 53 | // 07 MOVE_OBJECT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 54 | DF_DA | DF_UB | DF_NULL_TRANSFER_0 | DF_IS_MOVE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 55 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 56 | // 08 MOVE_OBJECT_FROM16 vAA, vBBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 57 | DF_DA | DF_UB | DF_NULL_TRANSFER_0 | DF_IS_MOVE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 58 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 59 | // 09 MOVE_OBJECT_16 vAAAA, vBBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 60 | DF_DA | DF_UB | DF_NULL_TRANSFER_0 | DF_IS_MOVE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 61 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 62 | // 0A MOVE_RESULT vAA |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 63 | DF_DA, |
| 64 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 65 | // 0B MOVE_RESULT_WIDE vAA |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 66 | DF_DA_WIDE, |
| 67 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 68 | // 0C MOVE_RESULT_OBJECT vAA |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 69 | DF_DA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 70 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 71 | // 0D MOVE_EXCEPTION vAA |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 72 | DF_DA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 73 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 74 | // 0E RETURN_VOID |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 75 | DF_NOP, |
| 76 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 77 | // 0F RETURN vAA |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 78 | DF_UA, |
| 79 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 80 | // 10 RETURN_WIDE vAA |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 81 | DF_UA_WIDE, |
| 82 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 83 | // 11 RETURN_OBJECT vAA |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 84 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 85 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 86 | // 12 CONST_4 vA, #+B |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 87 | DF_DA | DF_SETS_CONST, |
| 88 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 89 | // 13 CONST_16 vAA, #+BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 90 | DF_DA | DF_SETS_CONST, |
| 91 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 92 | // 14 CONST vAA, #+BBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 93 | DF_DA | DF_SETS_CONST, |
| 94 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 95 | // 15 CONST_HIGH16 VAA, #+BBBB0000 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 96 | DF_DA | DF_SETS_CONST, |
| 97 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 98 | // 16 CONST_WIDE_16 vAA, #+BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 99 | DF_DA_WIDE | DF_SETS_CONST, |
| 100 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 101 | // 17 CONST_WIDE_32 vAA, #+BBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 102 | DF_DA_WIDE | DF_SETS_CONST, |
| 103 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 104 | // 18 CONST_WIDE vAA, #+BBBBBBBBBBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 105 | DF_DA_WIDE | DF_SETS_CONST, |
| 106 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 107 | // 19 CONST_WIDE_HIGH16 vAA, #+BBBB000000000000 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 108 | DF_DA_WIDE | DF_SETS_CONST, |
| 109 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 110 | // 1A CONST_STRING vAA, string@BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 111 | DF_DA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 112 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 113 | // 1B CONST_STRING_JUMBO vAA, string@BBBBBBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 114 | DF_DA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 115 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 116 | // 1C CONST_CLASS vAA, type@BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 117 | DF_DA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 118 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 119 | // 1D MONITOR_ENTER vAA |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 120 | DF_UA | DF_NULL_CHK_0 | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 121 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 122 | // 1E MONITOR_EXIT vAA |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 123 | DF_UA | DF_NULL_CHK_0 | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 124 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 125 | // 1F CHK_CAST vAA, type@BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 126 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 127 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 128 | // 20 INSTANCE_OF vA, vB, type@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 129 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 130 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 131 | // 21 ARRAY_LENGTH vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 132 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 133 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 134 | // 22 NEW_INSTANCE vAA, type@BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 135 | DF_DA | DF_NON_NULL_DST | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 136 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 137 | // 23 NEW_ARRAY vA, vB, type@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 138 | DF_DA | DF_UB | DF_NON_NULL_DST | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 139 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 140 | // 24 FILLED_NEW_ARRAY {vD, vE, vF, vG, vA} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 141 | DF_FORMAT_35C | DF_NON_NULL_RET, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 142 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 143 | // 25 FILLED_NEW_ARRAY_RANGE {vCCCC .. vNNNN}, type@BBBB |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 144 | DF_FORMAT_3RC | DF_NON_NULL_RET, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 145 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 146 | // 26 FILL_ARRAY_DATA vAA, +BBBBBBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 147 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 148 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 149 | // 27 THROW vAA |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 150 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 151 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 152 | // 28 GOTO |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 153 | DF_NOP, |
| 154 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 155 | // 29 GOTO_16 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 156 | DF_NOP, |
| 157 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 158 | // 2A GOTO_32 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 159 | DF_NOP, |
| 160 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 161 | // 2B PACKED_SWITCH vAA, +BBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 162 | DF_UA, |
| 163 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 164 | // 2C SPARSE_SWITCH vAA, +BBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 165 | DF_UA, |
| 166 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 167 | // 2D CMPL_FLOAT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 168 | DF_DA | DF_UB | DF_UC | DF_FP_B | DF_FP_C | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 169 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 170 | // 2E CMPG_FLOAT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 171 | DF_DA | DF_UB | DF_UC | DF_FP_B | DF_FP_C | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 172 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 173 | // 2F CMPL_DOUBLE vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 174 | DF_DA | DF_UB_WIDE | DF_UC_WIDE | DF_FP_B | DF_FP_C | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 175 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 176 | // 30 CMPG_DOUBLE vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 177 | DF_DA | DF_UB_WIDE | DF_UC_WIDE | DF_FP_B | DF_FP_C | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 178 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 179 | // 31 CMP_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 180 | DF_DA | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 181 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 182 | // 32 IF_EQ vA, vB, +CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 183 | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 184 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 185 | // 33 IF_NE vA, vB, +CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 186 | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 187 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 188 | // 34 IF_LT vA, vB, +CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 189 | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 190 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 191 | // 35 IF_GE vA, vB, +CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 192 | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 193 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 194 | // 36 IF_GT vA, vB, +CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 195 | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 196 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 197 | // 37 IF_LE vA, vB, +CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 198 | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 199 | |
| 200 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 201 | // 38 IF_EQZ vAA, +BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 202 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 203 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 204 | // 39 IF_NEZ vAA, +BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 205 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 206 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 207 | // 3A IF_LTZ vAA, +BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 208 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 209 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 210 | // 3B IF_GEZ vAA, +BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 211 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 212 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 213 | // 3C IF_GTZ vAA, +BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 214 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 215 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 216 | // 3D IF_LEZ vAA, +BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 217 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 218 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 219 | // 3E UNUSED_3E |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 220 | DF_NOP, |
| 221 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 222 | // 3F UNUSED_3F |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 223 | DF_NOP, |
| 224 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 225 | // 40 UNUSED_40 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 226 | DF_NOP, |
| 227 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 228 | // 41 UNUSED_41 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 229 | DF_NOP, |
| 230 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 231 | // 42 UNUSED_42 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 232 | DF_NOP, |
| 233 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 234 | // 43 UNUSED_43 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 235 | DF_NOP, |
| 236 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 237 | // 44 AGET vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 238 | DF_DA | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 239 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 240 | // 45 AGET_WIDE vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 241 | DF_DA_WIDE | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 242 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 243 | // 46 AGET_OBJECT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 244 | DF_DA | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 245 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 246 | // 47 AGET_BOOLEAN vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 247 | DF_DA | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 248 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 249 | // 48 AGET_BYTE vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 250 | DF_DA | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 251 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 252 | // 49 AGET_CHAR vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 253 | DF_DA | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 254 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 255 | // 4A AGET_SHORT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 256 | DF_DA | DF_UB | DF_UC | DF_NULL_CHK_0 | DF_RANGE_CHK_1 | DF_IS_GETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 257 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 258 | // 4B APUT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 259 | DF_UA | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 260 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 261 | // 4C APUT_WIDE vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 262 | DF_UA_WIDE | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 263 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 264 | // 4D APUT_OBJECT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 265 | DF_UA | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 266 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 267 | // 4E APUT_BOOLEAN vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 268 | DF_UA | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 269 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 270 | // 4F APUT_BYTE vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 271 | DF_UA | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 272 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 273 | // 50 APUT_CHAR vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 274 | DF_UA | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 275 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 276 | // 51 APUT_SHORT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 277 | DF_UA | DF_UB | DF_UC | DF_NULL_CHK_1 | DF_RANGE_CHK_2 | DF_IS_SETTER | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 278 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 279 | // 52 IGET vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 280 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 281 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 282 | // 53 IGET_WIDE vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 283 | DF_DA_WIDE | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 284 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 285 | // 54 IGET_OBJECT vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 286 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 287 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 288 | // 55 IGET_BOOLEAN vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 289 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 290 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 291 | // 56 IGET_BYTE vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 292 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 293 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 294 | // 57 IGET_CHAR vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 295 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 296 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 297 | // 58 IGET_SHORT vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 298 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 299 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 300 | // 59 IPUT vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 301 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 302 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 303 | // 5A IPUT_WIDE vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 304 | DF_UA_WIDE | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 305 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 306 | // 5B IPUT_OBJECT vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 307 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 308 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 309 | // 5C IPUT_BOOLEAN vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 310 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 311 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 312 | // 5D IPUT_BYTE vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 313 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 314 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 315 | // 5E IPUT_CHAR vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 316 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 317 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 318 | // 5F IPUT_SHORT vA, vB, field@CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 319 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 320 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 321 | // 60 SGET vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 322 | DF_DA | DF_IS_GETTER, |
| 323 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 324 | // 61 SGET_WIDE vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 325 | DF_DA_WIDE | DF_IS_GETTER, |
| 326 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 327 | // 62 SGET_OBJECT vAA, field@BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 328 | DF_DA | DF_IS_GETTER | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 329 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 330 | // 63 SGET_BOOLEAN vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 331 | DF_DA | DF_IS_GETTER, |
| 332 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 333 | // 64 SGET_BYTE vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 334 | DF_DA | DF_IS_GETTER, |
| 335 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 336 | // 65 SGET_CHAR vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 337 | DF_DA | DF_IS_GETTER, |
| 338 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 339 | // 66 SGET_SHORT vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 340 | DF_DA | DF_IS_GETTER, |
| 341 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 342 | // 67 SPUT vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 343 | DF_UA | DF_IS_SETTER, |
| 344 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 345 | // 68 SPUT_WIDE vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 346 | DF_UA_WIDE | DF_IS_SETTER, |
| 347 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 348 | // 69 SPUT_OBJECT vAA, field@BBBB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 349 | DF_UA | DF_IS_SETTER | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 350 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 351 | // 6A SPUT_BOOLEAN vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 352 | DF_UA | DF_IS_SETTER, |
| 353 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 354 | // 6B SPUT_BYTE vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 355 | DF_UA | DF_IS_SETTER, |
| 356 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 357 | // 6C SPUT_CHAR vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 358 | DF_UA | DF_IS_SETTER, |
| 359 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 360 | // 6D SPUT_SHORT vAA, field@BBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 361 | DF_UA | DF_IS_SETTER, |
| 362 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 363 | // 6E INVOKE_VIRTUAL {vD, vE, vF, vG, vA} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 364 | DF_FORMAT_35C | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 365 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 366 | // 6F INVOKE_SUPER {vD, vE, vF, vG, vA} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 367 | DF_FORMAT_35C | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 368 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 369 | // 70 INVOKE_DIRECT {vD, vE, vF, vG, vA} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 370 | DF_FORMAT_35C | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 371 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 372 | // 71 INVOKE_STATIC {vD, vE, vF, vG, vA} |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 373 | DF_FORMAT_35C, |
| 374 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 375 | // 72 INVOKE_INTERFACE {vD, vE, vF, vG, vA} |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 376 | DF_FORMAT_35C, |
| 377 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 378 | // 73 UNUSED_73 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 379 | DF_NOP, |
| 380 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 381 | // 74 INVOKE_VIRTUAL_RANGE {vCCCC .. vNNNN} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 382 | DF_FORMAT_3RC | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 383 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 384 | // 75 INVOKE_SUPER_RANGE {vCCCC .. vNNNN} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 385 | DF_FORMAT_3RC | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 386 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 387 | // 76 INVOKE_DIRECT_RANGE {vCCCC .. vNNNN} |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 388 | DF_FORMAT_3RC | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 389 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 390 | // 77 INVOKE_STATIC_RANGE {vCCCC .. vNNNN} |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 391 | DF_FORMAT_3RC, |
| 392 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 393 | // 78 INVOKE_INTERFACE_RANGE {vCCCC .. vNNNN} |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 394 | DF_FORMAT_3RC, |
| 395 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 396 | // 79 UNUSED_79 |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 397 | DF_NOP, |
| 398 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 399 | // 7A UNUSED_7A |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 400 | DF_NOP, |
| 401 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 402 | // 7B NEG_INT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 403 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 404 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 405 | // 7C NOT_INT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 406 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 407 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 408 | // 7D NEG_LONG vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 409 | DF_DA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 410 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 411 | // 7E NOT_LONG vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 412 | DF_DA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 413 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 414 | // 7F NEG_FLOAT vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 415 | DF_DA | DF_UB | DF_FP_A | DF_FP_B, |
| 416 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 417 | // 80 NEG_DOUBLE vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 418 | DF_DA_WIDE | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 419 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 420 | // 81 INT_TO_LONG vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 421 | DF_DA_WIDE | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 422 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 423 | // 82 INT_TO_FLOAT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 424 | DF_DA | DF_UB | DF_FP_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 425 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 426 | // 83 INT_TO_DOUBLE vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 427 | DF_DA_WIDE | DF_UB | DF_FP_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 428 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 429 | // 84 LONG_TO_INT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 430 | DF_DA | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 431 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 432 | // 85 LONG_TO_FLOAT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 433 | DF_DA | DF_UB_WIDE | DF_FP_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 434 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 435 | // 86 LONG_TO_DOUBLE vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 436 | DF_DA_WIDE | DF_UB_WIDE | DF_FP_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 437 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 438 | // 87 FLOAT_TO_INT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 439 | DF_DA | DF_UB | DF_FP_B | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 440 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 441 | // 88 FLOAT_TO_LONG vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 442 | DF_DA_WIDE | DF_UB | DF_FP_B | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 443 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 444 | // 89 FLOAT_TO_DOUBLE vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 445 | DF_DA_WIDE | DF_UB | DF_FP_A | DF_FP_B, |
| 446 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 447 | // 8A DOUBLE_TO_INT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 448 | DF_DA | DF_UB_WIDE | DF_FP_B | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 449 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 450 | // 8B DOUBLE_TO_LONG vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 451 | DF_DA_WIDE | DF_UB_WIDE | DF_FP_B | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 452 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 453 | // 8C DOUBLE_TO_FLOAT vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 454 | DF_DA | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 455 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 456 | // 8D INT_TO_BYTE vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 457 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 458 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 459 | // 8E INT_TO_CHAR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 460 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 461 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 462 | // 8F INT_TO_SHORT vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 463 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 464 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 465 | // 90 ADD_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 466 | DF_DA | DF_UB | DF_UC | DF_IS_LINEAR | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 467 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 468 | // 91 SUB_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 469 | DF_DA | DF_UB | DF_UC | DF_IS_LINEAR | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 470 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 471 | // 92 MUL_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 472 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 473 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 474 | // 93 DIV_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 475 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 476 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 477 | // 94 REM_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 478 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 479 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 480 | // 95 AND_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 481 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 482 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 483 | // 96 OR_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 484 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 485 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 486 | // 97 XOR_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 487 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 488 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 489 | // 98 SHL_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 490 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 491 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 492 | // 99 SHR_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 493 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 494 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 495 | // 9A USHR_INT vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 496 | DF_DA | DF_UB | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 497 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 498 | // 9B ADD_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 499 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 500 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 501 | // 9C SUB_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 502 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 503 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 504 | // 9D MUL_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 505 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 506 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 507 | // 9E DIV_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 508 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 509 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 510 | // 9F REM_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 511 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 512 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 513 | // A0 AND_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 514 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 515 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 516 | // A1 OR_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 517 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 518 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 519 | // A2 XOR_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 520 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 521 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 522 | // A3 SHL_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 523 | DF_DA_WIDE | DF_UB_WIDE | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 524 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 525 | // A4 SHR_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 526 | DF_DA_WIDE | DF_UB_WIDE | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 527 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 528 | // A5 USHR_LONG vAA, vBB, vCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 529 | DF_DA_WIDE | DF_UB_WIDE | DF_UC | DF_CORE_A | DF_CORE_B | DF_CORE_C, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 530 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 531 | // A6 ADD_FLOAT vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 532 | DF_DA | DF_UB | DF_UC | DF_FP_A | DF_FP_B | DF_FP_C, |
| 533 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 534 | // A7 SUB_FLOAT vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 535 | DF_DA | DF_UB | DF_UC | DF_FP_A | DF_FP_B | DF_FP_C, |
| 536 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 537 | // A8 MUL_FLOAT vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 538 | DF_DA | DF_UB | DF_UC | DF_FP_A | DF_FP_B | DF_FP_C, |
| 539 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 540 | // A9 DIV_FLOAT vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 541 | DF_DA | DF_UB | DF_UC | DF_FP_A | DF_FP_B | DF_FP_C, |
| 542 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 543 | // AA REM_FLOAT vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 544 | DF_DA | DF_UB | DF_UC | DF_FP_A | DF_FP_B | DF_FP_C, |
| 545 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 546 | // AB ADD_DOUBLE vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 547 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_FP_A | DF_FP_B | DF_FP_C, |
| 548 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 549 | // AC SUB_DOUBLE vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 550 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_FP_A | DF_FP_B | DF_FP_C, |
| 551 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 552 | // AD MUL_DOUBLE vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 553 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_FP_A | DF_FP_B | DF_FP_C, |
| 554 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 555 | // AE DIV_DOUBLE vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 556 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_FP_A | DF_FP_B | DF_FP_C, |
| 557 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 558 | // AF REM_DOUBLE vAA, vBB, vCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 559 | DF_DA_WIDE | DF_UB_WIDE | DF_UC_WIDE | DF_FP_A | DF_FP_B | DF_FP_C, |
| 560 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 561 | // B0 ADD_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 562 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 563 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 564 | // B1 SUB_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 565 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 566 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 567 | // B2 MUL_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 568 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 569 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 570 | // B3 DIV_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 571 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 572 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 573 | // B4 REM_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 574 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 575 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 576 | // B5 AND_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 577 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 578 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 579 | // B6 OR_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 580 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 581 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 582 | // B7 XOR_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 583 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 584 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 585 | // B8 SHL_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 586 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 587 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 588 | // B9 SHR_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 589 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 590 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 591 | // BA USHR_INT_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 592 | DF_DA | DF_UA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 593 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 594 | // BB ADD_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 595 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 596 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 597 | // BC SUB_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 598 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 599 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 600 | // BD MUL_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 601 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 602 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 603 | // BE DIV_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 604 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 605 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 606 | // BF REM_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 607 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 608 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 609 | // C0 AND_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 610 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 611 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 612 | // C1 OR_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 613 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 614 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 615 | // C2 XOR_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 616 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 617 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 618 | // C3 SHL_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 619 | DF_DA_WIDE | DF_UA_WIDE | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 620 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 621 | // C4 SHR_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 622 | DF_DA_WIDE | DF_UA_WIDE | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 623 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 624 | // C5 USHR_LONG_2ADDR vA, vB |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 625 | DF_DA_WIDE | DF_UA_WIDE | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 626 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 627 | // C6 ADD_FLOAT_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 628 | DF_DA | DF_UA | DF_UB | DF_FP_A | DF_FP_B, |
| 629 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 630 | // C7 SUB_FLOAT_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 631 | DF_DA | DF_UA | DF_UB | DF_FP_A | DF_FP_B, |
| 632 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 633 | // C8 MUL_FLOAT_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 634 | DF_DA | DF_UA | DF_UB | DF_FP_A | DF_FP_B, |
| 635 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 636 | // C9 DIV_FLOAT_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 637 | DF_DA | DF_UA | DF_UB | DF_FP_A | DF_FP_B, |
| 638 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 639 | // CA REM_FLOAT_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 640 | DF_DA | DF_UA | DF_UB | DF_FP_A | DF_FP_B, |
| 641 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 642 | // CB ADD_DOUBLE_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 643 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 644 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 645 | // CC SUB_DOUBLE_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 646 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 647 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 648 | // CD MUL_DOUBLE_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 649 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 650 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 651 | // CE DIV_DOUBLE_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 652 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 653 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 654 | // CF REM_DOUBLE_2ADDR vA, vB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 655 | DF_DA_WIDE | DF_UA_WIDE | DF_UB_WIDE | DF_FP_A | DF_FP_B, |
| 656 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 657 | // D0 ADD_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 658 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 659 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 660 | // D1 RSUB_INT vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 661 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 662 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 663 | // D2 MUL_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 664 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 665 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 666 | // D3 DIV_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 667 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 668 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 669 | // D4 REM_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 670 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 671 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 672 | // D5 AND_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 673 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 674 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 675 | // D6 OR_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 676 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 677 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 678 | // D7 XOR_INT_LIT16 vA, vB, #+CCCC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 679 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 680 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 681 | // D8 ADD_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 682 | DF_DA | DF_UB | DF_IS_LINEAR | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 683 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 684 | // D9 RSUB_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 685 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 686 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 687 | // DA MUL_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 688 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 689 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 690 | // DB DIV_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 691 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 692 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 693 | // DC REM_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 694 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 695 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 696 | // DD AND_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 697 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 698 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 699 | // DE OR_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 700 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 701 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 702 | // DF XOR_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 703 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 704 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 705 | // E0 SHL_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 706 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 707 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 708 | // E1 SHR_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 709 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 710 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 711 | // E2 USHR_INT_LIT8 vAA, vBB, #+CC |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 712 | DF_DA | DF_UB | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 713 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 714 | // E3 IGET_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 715 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 716 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 717 | // E4 IPUT_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 718 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 719 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 720 | // E5 SGET_VOLATILE |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 721 | DF_DA, |
| 722 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 723 | // E6 SPUT_VOLATILE |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 724 | DF_UA, |
| 725 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 726 | // E7 IGET_OBJECT_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 727 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 728 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 729 | // E8 IGET_WIDE_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 730 | DF_DA_WIDE | DF_UB | DF_NULL_CHK_0 | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 731 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 732 | // E9 IPUT_WIDE_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 733 | DF_UA_WIDE | DF_UB | DF_NULL_CHK_1 | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 734 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 735 | // EA SGET_WIDE_VOLATILE |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 736 | DF_DA_WIDE, |
| 737 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 738 | // EB SPUT_WIDE_VOLATILE |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 739 | DF_UA_WIDE, |
| 740 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 741 | // EC BREAKPOINT |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 742 | DF_NOP, |
| 743 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 744 | // ED THROW_VERIFICATION_ERROR |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 745 | DF_NOP, |
| 746 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 747 | // EE EXECUTE_INLINE |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 748 | DF_FORMAT_35C, |
| 749 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 750 | // EF EXECUTE_INLINE_RANGE |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 751 | DF_FORMAT_3RC, |
| 752 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 753 | // F0 INVOKE_OBJECT_INIT_RANGE |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 754 | DF_NOP | DF_NULL_CHK_0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 755 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 756 | // F1 RETURN_VOID_BARRIER |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 757 | DF_NOP, |
| 758 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 759 | // F2 IGET_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 760 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 761 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 762 | // F3 IGET_WIDE_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 763 | DF_DA_WIDE | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 764 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 765 | // F4 IGET_OBJECT_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 766 | DF_DA | DF_UB | DF_NULL_CHK_0 | DF_IS_GETTER, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 767 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 768 | // F5 IPUT_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 769 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 770 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 771 | // F6 IPUT_WIDE_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 772 | DF_UA_WIDE | DF_UB | DF_NULL_CHK_1 |DF_IS_SETTER, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 773 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 774 | // F7 IPUT_OBJECT_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 775 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_IS_SETTER, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 776 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 777 | // F8 INVOKE_VIRTUAL_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 778 | DF_FORMAT_35C | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 779 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 780 | // F9 INVOKE_VIRTUAL_QUICK_RANGE |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 781 | DF_FORMAT_3RC | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 782 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 783 | // FA INVOKE_SUPER_QUICK |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 784 | DF_FORMAT_35C | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 785 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 786 | // FB INVOKE_SUPER_QUICK_RANGE |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 787 | DF_FORMAT_3RC | DF_NULL_CHK_OUT0, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 788 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 789 | // FC IPUT_OBJECT_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 790 | DF_UA | DF_UB | DF_NULL_CHK_1 | DF_CORE_A | DF_CORE_B, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 791 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 792 | // FD SGET_OBJECT_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 793 | DF_DA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 794 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 795 | // FE SPUT_OBJECT_VOLATILE |
buzbee | 67bc236 | 2011-10-11 18:08:40 -0700 | [diff] [blame] | 796 | DF_UA | DF_CORE_A, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 797 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 798 | // FF UNUSED_FF |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 799 | DF_NOP, |
| 800 | |
| 801 | // Beginning of extended MIR opcodes |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 802 | // 100 MIR_PHI |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 803 | DF_PHI | DF_DA | DF_NULL_TRANSFER_N, |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 804 | /* |
| 805 | * For extended MIR inserted at the MIR2LIR stage, it is okay to have |
| 806 | * undefined values here. |
| 807 | */ |
| 808 | }; |
| 809 | |
| 810 | /* Return the Dalvik register/subscript pair of a given SSA register */ |
| 811 | int oatConvertSSARegToDalvik(const CompilationUnit* cUnit, int ssaReg) |
| 812 | { |
| 813 | return GET_ELEM_N(cUnit->ssaToDalvikMap, int, ssaReg); |
| 814 | } |
| 815 | |
| 816 | /* |
| 817 | * Utility function to convert encoded SSA register value into Dalvik register |
| 818 | * and subscript pair. Each SSA register can be used to index the |
| 819 | * ssaToDalvikMap list to get the subscript[31..16]/dalvik_reg[15..0] mapping. |
| 820 | */ |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 821 | char* oatGetDalvikDisassembly(CompilationUnit* cUnit, |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 822 | const DecodedInstruction& insn, const char* note) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 823 | { |
| 824 | char buffer[256]; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 825 | Instruction::Code opcode = insn.opcode; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 826 | int dfAttributes = oatDataFlowAttributes[opcode]; |
| 827 | int flags; |
| 828 | char* ret; |
| 829 | |
| 830 | buffer[0] = 0; |
| 831 | if ((int)opcode >= (int)kMirOpFirst) { |
| 832 | if ((int)opcode == (int)kMirOpPhi) { |
| 833 | strcpy(buffer, "PHI"); |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 834 | } else { |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 835 | sprintf(buffer, "Opcode %#x", opcode); |
| 836 | } |
| 837 | flags = 0; |
| 838 | } else { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 839 | strcpy(buffer, Instruction::Name(opcode)); |
| 840 | flags = Instruction::Flags(opcode); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 841 | } |
| 842 | |
| 843 | if (note) |
| 844 | strcat(buffer, note); |
| 845 | |
| 846 | /* For branches, decode the instructions to print out the branch targets */ |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 847 | if (flags & Instruction::kBranch) { |
| 848 | Instruction::Format dalvikFormat = Instruction::FormatOf(insn.opcode); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 849 | int offset = 0; |
| 850 | switch (dalvikFormat) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 851 | case Instruction::k21t: |
| 852 | snprintf(buffer + strlen(buffer), 256, " v%d,", insn.vA); |
| 853 | offset = (int) insn.vB; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 854 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 855 | case Instruction::k22t: |
| 856 | snprintf(buffer + strlen(buffer), 256, " v%d, v%d,", insn.vA, insn.vB); |
| 857 | offset = (int) insn.vC; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 858 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 859 | case Instruction::k10t: |
| 860 | case Instruction::k20t: |
| 861 | case Instruction::k30t: |
| 862 | offset = (int) insn.vA; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 863 | break; |
| 864 | default: |
| 865 | LOG(FATAL) << "Unexpected branch format " << (int)dalvikFormat |
| 866 | << " / opcode " << (int)opcode; |
| 867 | } |
| 868 | snprintf(buffer + strlen(buffer), 256, " (%c%x)", |
| 869 | offset > 0 ? '+' : '-', |
| 870 | offset > 0 ? offset : -offset); |
| 871 | } else if (dfAttributes & DF_FORMAT_35C) { |
| 872 | unsigned int i; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 873 | for (i = 0; i < insn.vA; i++) { |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 874 | if (i != 0) strcat(buffer, ","); |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 875 | snprintf(buffer + strlen(buffer), 256, " v%d", insn.arg[i]); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 876 | } |
| 877 | } |
| 878 | else if (dfAttributes & DF_FORMAT_3RC) { |
| 879 | snprintf(buffer + strlen(buffer), 256, |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 880 | " v%d..v%d", insn.vC, insn.vC + insn.vA - 1); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 881 | } |
| 882 | else { |
| 883 | if (dfAttributes & DF_A_IS_REG) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 884 | snprintf(buffer + strlen(buffer), 256, " v%d", insn.vA); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 885 | } |
| 886 | if (dfAttributes & DF_B_IS_REG) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 887 | snprintf(buffer + strlen(buffer), 256, ", v%d", insn.vB); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 888 | } |
| 889 | else if ((int)opcode < (int)kMirOpFirst) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 890 | snprintf(buffer + strlen(buffer), 256, ", (#%d)", insn.vB); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 891 | } |
| 892 | if (dfAttributes & DF_C_IS_REG) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 893 | snprintf(buffer + strlen(buffer), 256, ", v%d", insn.vC); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 894 | } |
| 895 | else if ((int)opcode < (int)kMirOpFirst) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 896 | snprintf(buffer + strlen(buffer), 256, ", (#%d)", insn.vC); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 897 | } |
| 898 | } |
| 899 | int length = strlen(buffer) + 1; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 900 | ret = (char*)oatNew(cUnit, length, false, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 901 | memcpy(ret, buffer, length); |
| 902 | return ret; |
| 903 | } |
| 904 | |
Elliott Hughes | c1f143d | 2011-12-01 17:31:10 -0800 | [diff] [blame] | 905 | char* getSSAName(const CompilationUnit* cUnit, int ssaReg, char* name) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 906 | { |
| 907 | int ssa2DalvikValue = oatConvertSSARegToDalvik(cUnit, ssaReg); |
| 908 | |
| 909 | sprintf(name, "v%d_%d", |
| 910 | DECODE_REG(ssa2DalvikValue), DECODE_SUB(ssa2DalvikValue)); |
| 911 | return name; |
| 912 | } |
| 913 | |
| 914 | /* |
| 915 | * Dalvik instruction disassembler with optional SSA printing. |
| 916 | */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 917 | char* oatFullDisassembler(CompilationUnit* cUnit, const MIR* mir) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 918 | { |
| 919 | char buffer[256]; |
Elliott Hughes | 3b6baaa | 2011-10-14 19:13:56 -0700 | [diff] [blame] | 920 | char operand0[32], operand1[32]; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 921 | const DecodedInstruction* insn = &mir->dalvikInsn; |
| 922 | Instruction::Code opcode = insn->opcode; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 923 | int dfAttributes = oatDataFlowAttributes[opcode]; |
Elliott Hughes | c1f143d | 2011-12-01 17:31:10 -0800 | [diff] [blame] | 924 | char* ret; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 925 | int length; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 926 | |
| 927 | buffer[0] = 0; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 928 | if (static_cast<int>(opcode) >= static_cast<int>(kMirOpFirst)) { |
| 929 | if (static_cast<int>(opcode) == static_cast<int>(kMirOpPhi)) { |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 930 | snprintf(buffer, 256, "PHI %s = (%s", |
| 931 | getSSAName(cUnit, mir->ssaRep->defs[0], operand0), |
| 932 | getSSAName(cUnit, mir->ssaRep->uses[0], operand1)); |
| 933 | int i; |
| 934 | for (i = 1; i < mir->ssaRep->numUses; i++) { |
| 935 | snprintf(buffer + strlen(buffer), 256, ", %s", |
| 936 | getSSAName(cUnit, mir->ssaRep->uses[i], operand0)); |
| 937 | } |
| 938 | snprintf(buffer + strlen(buffer), 256, ")"); |
| 939 | } |
| 940 | else { |
| 941 | sprintf(buffer, "Opcode %#x", opcode); |
| 942 | } |
| 943 | goto done; |
| 944 | } else { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 945 | strcpy(buffer, Instruction::Name(opcode)); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 946 | } |
| 947 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 948 | /* For branches, decode the instructions to print out the branch targets */ |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 949 | if (Instruction::Flags(insn->opcode) & Instruction::kBranch) { |
| 950 | Instruction::Format dalvikFormat = Instruction::FormatOf(insn->opcode); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 951 | int delta = 0; |
| 952 | switch (dalvikFormat) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 953 | case Instruction::k21t: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 954 | snprintf(buffer + strlen(buffer), 256, " %s, ", |
| 955 | getSSAName(cUnit, mir->ssaRep->uses[0], operand0)); |
| 956 | delta = (int) insn->vB; |
| 957 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 958 | case Instruction::k22t: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 959 | snprintf(buffer + strlen(buffer), 256, " %s, %s, ", |
| 960 | getSSAName(cUnit, mir->ssaRep->uses[0], operand0), |
| 961 | getSSAName(cUnit, mir->ssaRep->uses[1], operand1)); |
| 962 | delta = (int) insn->vC; |
| 963 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 964 | case Instruction::k10t: |
| 965 | case Instruction::k20t: |
| 966 | case Instruction::k30t: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 967 | delta = (int) insn->vA; |
| 968 | break; |
| 969 | default: |
| 970 | LOG(FATAL) << "Unexpected branch format: " << |
| 971 | (int)dalvikFormat; |
| 972 | } |
| 973 | snprintf(buffer + strlen(buffer), 256, " %04x", |
| 974 | mir->offset + delta); |
| 975 | } else if (dfAttributes & (DF_FORMAT_35C | DF_FORMAT_3RC)) { |
| 976 | unsigned int i; |
| 977 | for (i = 0; i < insn->vA; i++) { |
| 978 | if (i != 0) strcat(buffer, ","); |
| 979 | snprintf(buffer + strlen(buffer), 256, " %s", |
| 980 | getSSAName(cUnit, mir->ssaRep->uses[i], operand0)); |
| 981 | } |
| 982 | } else { |
| 983 | int udIdx; |
| 984 | if (mir->ssaRep->numDefs) { |
| 985 | |
| 986 | for (udIdx = 0; udIdx < mir->ssaRep->numDefs; udIdx++) { |
| 987 | snprintf(buffer + strlen(buffer), 256, " %s", |
| 988 | getSSAName(cUnit, mir->ssaRep->defs[udIdx], operand0)); |
| 989 | } |
| 990 | strcat(buffer, ","); |
| 991 | } |
| 992 | if (mir->ssaRep->numUses) { |
| 993 | /* No leading ',' for the first use */ |
| 994 | snprintf(buffer + strlen(buffer), 256, " %s", |
| 995 | getSSAName(cUnit, mir->ssaRep->uses[0], operand0)); |
| 996 | for (udIdx = 1; udIdx < mir->ssaRep->numUses; udIdx++) { |
| 997 | snprintf(buffer + strlen(buffer), 256, ", %s", |
| 998 | getSSAName(cUnit, mir->ssaRep->uses[udIdx], operand0)); |
| 999 | } |
| 1000 | } |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1001 | if (static_cast<int>(opcode) < static_cast<int>(kMirOpFirst)) { |
| 1002 | Instruction::Format dalvikFormat = Instruction::FormatOf(opcode); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1003 | switch (dalvikFormat) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1004 | case Instruction::k11n: // op vA, #+B |
| 1005 | case Instruction::k21s: // op vAA, #+BBBB |
| 1006 | case Instruction::k21h: // op vAA, #+BBBB00000[00000000] |
| 1007 | case Instruction::k31i: // op vAA, #+BBBBBBBB |
| 1008 | case Instruction::k51l: // op vAA, #+BBBBBBBBBBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1009 | snprintf(buffer + strlen(buffer), 256, " #%#x", insn->vB); |
| 1010 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1011 | case Instruction::k21c: // op vAA, thing@BBBB |
| 1012 | case Instruction::k31c: // op vAA, thing@BBBBBBBB |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1013 | snprintf(buffer + strlen(buffer), 256, " @%#x", insn->vB); |
| 1014 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1015 | case Instruction::k22b: // op vAA, vBB, #+CC |
| 1016 | case Instruction::k22s: // op vA, vB, #+CCCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1017 | snprintf(buffer + strlen(buffer), 256, " #%#x", insn->vC); |
| 1018 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1019 | case Instruction::k22c: // op vA, vB, thing@CCCC |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1020 | snprintf(buffer + strlen(buffer), 256, " @%#x", insn->vC); |
| 1021 | break; |
| 1022 | /* No need for special printing */ |
| 1023 | default: |
| 1024 | break; |
| 1025 | } |
| 1026 | } |
| 1027 | } |
| 1028 | |
| 1029 | done: |
| 1030 | length = strlen(buffer) + 1; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1031 | ret = (char*) oatNew(cUnit, length, false, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1032 | memcpy(ret, buffer, length); |
| 1033 | return ret; |
| 1034 | } |
| 1035 | |
| 1036 | /* |
| 1037 | * Utility function to convert encoded SSA register value into Dalvik register |
| 1038 | * and subscript pair. Each SSA register can be used to index the |
| 1039 | * ssaToDalvikMap list to get the subscript[31..16]/dalvik_reg[15..0] mapping. |
| 1040 | */ |
Elliott Hughes | c1f143d | 2011-12-01 17:31:10 -0800 | [diff] [blame] | 1041 | char* oatGetSSAString(CompilationUnit* cUnit, SSARepresentation* ssaRep) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1042 | { |
| 1043 | char buffer[256]; |
| 1044 | char* ret; |
| 1045 | int i; |
| 1046 | |
| 1047 | buffer[0] = 0; |
| 1048 | for (i = 0; i < ssaRep->numDefs; i++) { |
| 1049 | int ssa2DalvikValue = oatConvertSSARegToDalvik(cUnit, ssaRep->defs[i]); |
| 1050 | |
| 1051 | sprintf(buffer + strlen(buffer), "s%d(v%d_%d) ", |
| 1052 | ssaRep->defs[i], DECODE_REG(ssa2DalvikValue), |
| 1053 | DECODE_SUB(ssa2DalvikValue)); |
| 1054 | } |
| 1055 | |
| 1056 | if (ssaRep->numDefs) { |
| 1057 | strcat(buffer, "<- "); |
| 1058 | } |
| 1059 | |
| 1060 | for (i = 0; i < ssaRep->numUses; i++) { |
| 1061 | int ssa2DalvikValue = oatConvertSSARegToDalvik(cUnit, ssaRep->uses[i]); |
| 1062 | int len = strlen(buffer); |
| 1063 | |
| 1064 | if (snprintf(buffer + len, 250 - len, "s%d(v%d_%d) ", |
| 1065 | ssaRep->uses[i], DECODE_REG(ssa2DalvikValue), |
| 1066 | DECODE_SUB(ssa2DalvikValue)) >= (250 - len)) { |
| 1067 | strcat(buffer, "..."); |
| 1068 | break; |
| 1069 | } |
| 1070 | } |
| 1071 | |
| 1072 | int length = strlen(buffer) + 1; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1073 | ret = (char*)oatNew(cUnit, length, false, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1074 | memcpy(ret, buffer, length); |
| 1075 | return ret; |
| 1076 | } |
| 1077 | |
| 1078 | /* Any register that is used before being defined is considered live-in */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1079 | inline void handleLiveInUse(CompilationUnit* cUnit, ArenaBitVector* useV, |
| 1080 | ArenaBitVector* defV, ArenaBitVector* liveInV, |
| 1081 | int dalvikRegId) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1082 | { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1083 | oatSetBit(cUnit, useV, dalvikRegId); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1084 | if (!oatIsBitSet(defV, dalvikRegId)) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1085 | oatSetBit(cUnit, liveInV, dalvikRegId); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1086 | } |
| 1087 | } |
| 1088 | |
| 1089 | /* Mark a reg as being defined */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1090 | inline void handleDef(CompilationUnit* cUnit, ArenaBitVector* defV, |
| 1091 | int dalvikRegId) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1092 | { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1093 | oatSetBit(cUnit, defV, dalvikRegId); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1094 | } |
| 1095 | |
| 1096 | /* |
| 1097 | * Find out live-in variables for natural loops. Variables that are live-in in |
| 1098 | * the main loop body are considered to be defined in the entry block. |
| 1099 | */ |
| 1100 | bool oatFindLocalLiveIn(CompilationUnit* cUnit, BasicBlock* bb) |
| 1101 | { |
| 1102 | MIR* mir; |
| 1103 | ArenaBitVector *useV, *defV, *liveInV; |
| 1104 | |
| 1105 | if (bb->dataFlowInfo == NULL) return false; |
| 1106 | |
| 1107 | useV = bb->dataFlowInfo->useV = |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1108 | oatAllocBitVector(cUnit, cUnit->numDalvikRegisters, false, kBitMapUse); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1109 | defV = bb->dataFlowInfo->defV = |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1110 | oatAllocBitVector(cUnit, cUnit->numDalvikRegisters, false, kBitMapDef); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1111 | liveInV = bb->dataFlowInfo->liveInV = |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1112 | oatAllocBitVector(cUnit, cUnit->numDalvikRegisters, false, |
| 1113 | kBitMapLiveIn); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1114 | |
| 1115 | for (mir = bb->firstMIRInsn; mir; mir = mir->next) { |
| 1116 | int dfAttributes = |
| 1117 | oatDataFlowAttributes[mir->dalvikInsn.opcode]; |
| 1118 | DecodedInstruction *dInsn = &mir->dalvikInsn; |
| 1119 | |
| 1120 | if (dfAttributes & DF_HAS_USES) { |
| 1121 | if (dfAttributes & DF_UA) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1122 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vA); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1123 | } else if (dfAttributes & DF_UA_WIDE) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1124 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vA); |
| 1125 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vA+1); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1126 | } |
| 1127 | if (dfAttributes & DF_UB) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1128 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vB); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1129 | } else if (dfAttributes & DF_UB_WIDE) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1130 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vB); |
| 1131 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vB+1); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1132 | } |
| 1133 | if (dfAttributes & DF_UC) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1134 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vC); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1135 | } else if (dfAttributes & DF_UC_WIDE) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1136 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vC); |
| 1137 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vC+1); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1138 | } |
| 1139 | } |
buzbee | 07ce1d7 | 2012-02-10 17:22:02 -0800 | [diff] [blame] | 1140 | if (dfAttributes & DF_FORMAT_35C) { |
| 1141 | for (unsigned int i = 0; i < dInsn->vA; i++) { |
| 1142 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->arg[i]); |
| 1143 | } |
| 1144 | } |
| 1145 | if (dfAttributes & DF_FORMAT_3RC) { |
| 1146 | for (unsigned int i = 0; i < dInsn->vA; i++) { |
| 1147 | handleLiveInUse(cUnit, useV, defV, liveInV, dInsn->vC+i); |
| 1148 | } |
| 1149 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1150 | if (dfAttributes & DF_HAS_DEFS) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1151 | handleDef(cUnit, defV, dInsn->vA); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1152 | if (dfAttributes & DF_DA_WIDE) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1153 | handleDef(cUnit, defV, dInsn->vA+1); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1154 | } |
| 1155 | } |
| 1156 | } |
| 1157 | return true; |
| 1158 | } |
| 1159 | |
| 1160 | /* Find out the latest SSA register for a given Dalvik register */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1161 | void handleSSAUse(CompilationUnit* cUnit, int* uses, int dalvikReg, |
| 1162 | int regIndex) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1163 | { |
| 1164 | int encodedValue = cUnit->dalvikToSSAMap[dalvikReg]; |
| 1165 | int ssaReg = DECODE_REG(encodedValue); |
| 1166 | uses[regIndex] = ssaReg; |
| 1167 | } |
| 1168 | |
| 1169 | /* Setup a new SSA register for a given Dalvik register */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1170 | void handleSSADef(CompilationUnit* cUnit, int* defs, int dalvikReg, |
| 1171 | int regIndex) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1172 | { |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1173 | int ssaReg = cUnit->numSSARegs++; |
| 1174 | /* Bump up the subscript */ |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1175 | int dalvikSub = ++cUnit->SSALastDefs[dalvikReg]; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1176 | int newD2SMapping = ENCODE_REG_SUB(ssaReg, dalvikSub); |
| 1177 | |
| 1178 | cUnit->dalvikToSSAMap[dalvikReg] = newD2SMapping; |
| 1179 | |
| 1180 | int newS2DMapping = ENCODE_REG_SUB(dalvikReg, dalvikSub); |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1181 | oatInsertGrowableList(cUnit, cUnit->ssaToDalvikMap, newS2DMapping); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1182 | |
| 1183 | defs[regIndex] = ssaReg; |
| 1184 | } |
| 1185 | |
buzbee | ec5adf3 | 2011-09-11 15:25:43 -0700 | [diff] [blame] | 1186 | /* Look up new SSA names for format_35c instructions */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1187 | void dataFlowSSAFormat35C(CompilationUnit* cUnit, MIR* mir) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1188 | { |
| 1189 | DecodedInstruction *dInsn = &mir->dalvikInsn; |
| 1190 | int numUses = dInsn->vA; |
| 1191 | int i; |
| 1192 | |
| 1193 | mir->ssaRep->numUses = numUses; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1194 | mir->ssaRep->uses = (int *)oatNew(cUnit, sizeof(int) * numUses, true, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1195 | kAllocDFInfo); |
buzbee | ed3e930 | 2011-09-23 17:34:19 -0700 | [diff] [blame] | 1196 | // NOTE: will be filled in during type & size inference pass |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1197 | mir->ssaRep->fpUse = (bool *)oatNew(cUnit, sizeof(bool) * numUses, true, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1198 | kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1199 | |
| 1200 | for (i = 0; i < numUses; i++) { |
| 1201 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->arg[i], i); |
| 1202 | } |
| 1203 | } |
| 1204 | |
buzbee | ec5adf3 | 2011-09-11 15:25:43 -0700 | [diff] [blame] | 1205 | /* Look up new SSA names for format_3rc instructions */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1206 | void dataFlowSSAFormat3RC(CompilationUnit* cUnit, MIR* mir) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1207 | { |
| 1208 | DecodedInstruction *dInsn = &mir->dalvikInsn; |
| 1209 | int numUses = dInsn->vA; |
| 1210 | int i; |
| 1211 | |
| 1212 | mir->ssaRep->numUses = numUses; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1213 | mir->ssaRep->uses = (int *)oatNew(cUnit, sizeof(int) * numUses, true, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1214 | kAllocDFInfo); |
buzbee | ed3e930 | 2011-09-23 17:34:19 -0700 | [diff] [blame] | 1215 | // NOTE: will be filled in during type & size inference pass |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1216 | mir->ssaRep->fpUse = (bool *)oatNew(cUnit, sizeof(bool) * numUses, true, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1217 | kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1218 | |
| 1219 | for (i = 0; i < numUses; i++) { |
| 1220 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC+i, i); |
| 1221 | } |
| 1222 | } |
| 1223 | |
| 1224 | /* Entry function to convert a block into SSA representation */ |
| 1225 | bool oatDoSSAConversion(CompilationUnit* cUnit, BasicBlock* bb) |
| 1226 | { |
| 1227 | MIR* mir; |
| 1228 | |
| 1229 | if (bb->dataFlowInfo == NULL) return false; |
| 1230 | |
| 1231 | for (mir = bb->firstMIRInsn; mir; mir = mir->next) { |
| 1232 | mir->ssaRep = (struct SSARepresentation *) |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1233 | oatNew(cUnit, sizeof(SSARepresentation), true, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1234 | |
| 1235 | int dfAttributes = |
| 1236 | oatDataFlowAttributes[mir->dalvikInsn.opcode]; |
| 1237 | |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1238 | // If not a pseudo-op, note non-leaf or can throw |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1239 | if (static_cast<int>(mir->dalvikInsn.opcode) < static_cast<int>(kNumPackedOpcodes)) { |
| 1240 | int flags = Instruction::Flags(mir->dalvikInsn.opcode); |
buzbee | cefd187 | 2011-09-09 09:59:52 -0700 | [diff] [blame] | 1241 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1242 | if (flags & Instruction::kThrow) { |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1243 | cUnit->attrs &= ~METHOD_IS_THROW_FREE; |
| 1244 | } |
buzbee | cefd187 | 2011-09-09 09:59:52 -0700 | [diff] [blame] | 1245 | |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1246 | if (flags & Instruction::kInvoke) { |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1247 | cUnit->attrs &= ~METHOD_IS_LEAF; |
| 1248 | } |
buzbee | cefd187 | 2011-09-09 09:59:52 -0700 | [diff] [blame] | 1249 | } |
| 1250 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1251 | int numUses = 0; |
| 1252 | |
| 1253 | if (dfAttributes & DF_FORMAT_35C) { |
| 1254 | dataFlowSSAFormat35C(cUnit, mir); |
| 1255 | continue; |
| 1256 | } |
| 1257 | |
| 1258 | if (dfAttributes & DF_FORMAT_3RC) { |
| 1259 | dataFlowSSAFormat3RC(cUnit, mir); |
| 1260 | continue; |
| 1261 | } |
| 1262 | |
| 1263 | if (dfAttributes & DF_HAS_USES) { |
| 1264 | if (dfAttributes & DF_UA) { |
| 1265 | numUses++; |
| 1266 | } else if (dfAttributes & DF_UA_WIDE) { |
| 1267 | numUses += 2; |
| 1268 | } |
| 1269 | if (dfAttributes & DF_UB) { |
| 1270 | numUses++; |
| 1271 | } else if (dfAttributes & DF_UB_WIDE) { |
| 1272 | numUses += 2; |
| 1273 | } |
| 1274 | if (dfAttributes & DF_UC) { |
| 1275 | numUses++; |
| 1276 | } else if (dfAttributes & DF_UC_WIDE) { |
| 1277 | numUses += 2; |
| 1278 | } |
| 1279 | } |
| 1280 | |
| 1281 | if (numUses) { |
| 1282 | mir->ssaRep->numUses = numUses; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1283 | mir->ssaRep->uses = (int *)oatNew(cUnit, sizeof(int) * numUses, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1284 | false, kAllocDFInfo); |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1285 | mir->ssaRep->fpUse = (bool *)oatNew(cUnit, sizeof(bool) * numUses, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1286 | false, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1287 | } |
| 1288 | |
| 1289 | int numDefs = 0; |
| 1290 | |
| 1291 | if (dfAttributes & DF_HAS_DEFS) { |
| 1292 | numDefs++; |
| 1293 | if (dfAttributes & DF_DA_WIDE) { |
| 1294 | numDefs++; |
| 1295 | } |
| 1296 | } |
| 1297 | |
| 1298 | if (numDefs) { |
| 1299 | mir->ssaRep->numDefs = numDefs; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1300 | mir->ssaRep->defs = (int *)oatNew(cUnit, sizeof(int) * numDefs, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1301 | false, kAllocDFInfo); |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1302 | mir->ssaRep->fpDef = (bool *)oatNew(cUnit, sizeof(bool) * numDefs, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1303 | false, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1304 | } |
| 1305 | |
| 1306 | DecodedInstruction *dInsn = &mir->dalvikInsn; |
| 1307 | |
| 1308 | if (dfAttributes & DF_HAS_USES) { |
| 1309 | numUses = 0; |
| 1310 | if (dfAttributes & DF_UA) { |
| 1311 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_A; |
| 1312 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vA, numUses++); |
| 1313 | } else if (dfAttributes & DF_UA_WIDE) { |
| 1314 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_A; |
| 1315 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vA, numUses++); |
| 1316 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_A; |
| 1317 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vA+1, numUses++); |
| 1318 | } |
| 1319 | if (dfAttributes & DF_UB) { |
| 1320 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_B; |
| 1321 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vB, numUses++); |
| 1322 | } else if (dfAttributes & DF_UB_WIDE) { |
| 1323 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_B; |
| 1324 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vB, numUses++); |
| 1325 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_B; |
| 1326 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vB+1, numUses++); |
| 1327 | } |
| 1328 | if (dfAttributes & DF_UC) { |
| 1329 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_C; |
| 1330 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC, numUses++); |
| 1331 | } else if (dfAttributes & DF_UC_WIDE) { |
| 1332 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_C; |
| 1333 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC, numUses++); |
| 1334 | mir->ssaRep->fpUse[numUses] = dfAttributes & DF_FP_C; |
| 1335 | handleSSAUse(cUnit, mir->ssaRep->uses, dInsn->vC+1, numUses++); |
| 1336 | } |
| 1337 | } |
| 1338 | if (dfAttributes & DF_HAS_DEFS) { |
| 1339 | mir->ssaRep->fpDef[0] = dfAttributes & DF_FP_A; |
| 1340 | handleSSADef(cUnit, mir->ssaRep->defs, dInsn->vA, 0); |
| 1341 | if (dfAttributes & DF_DA_WIDE) { |
| 1342 | mir->ssaRep->fpDef[1] = dfAttributes & DF_FP_A; |
| 1343 | handleSSADef(cUnit, mir->ssaRep->defs, dInsn->vA+1, 1); |
| 1344 | } |
| 1345 | } |
| 1346 | } |
| 1347 | |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1348 | if (!cUnit->disableDataflow) { |
| 1349 | /* |
| 1350 | * Take a snapshot of Dalvik->SSA mapping at the end of each block. The |
| 1351 | * input to PHI nodes can be derived from the snapshot of all |
| 1352 | * predecessor blocks. |
| 1353 | */ |
| 1354 | bb->dataFlowInfo->dalvikToSSAMap = |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1355 | (int *)oatNew(cUnit, sizeof(int) * cUnit->numDalvikRegisters, false, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1356 | kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1357 | |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1358 | memcpy(bb->dataFlowInfo->dalvikToSSAMap, cUnit->dalvikToSSAMap, |
| 1359 | sizeof(int) * cUnit->numDalvikRegisters); |
| 1360 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1361 | return true; |
| 1362 | } |
| 1363 | |
| 1364 | /* Setup a constant value for opcodes thare have the DF_SETS_CONST attribute */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1365 | void setConstant(CompilationUnit* cUnit, int ssaReg, int value) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1366 | { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1367 | oatSetBit(cUnit, cUnit->isConstantV, ssaReg); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1368 | cUnit->constantValues[ssaReg] = value; |
| 1369 | } |
| 1370 | |
| 1371 | bool oatDoConstantPropagation(CompilationUnit* cUnit, BasicBlock* bb) |
| 1372 | { |
| 1373 | MIR* mir; |
| 1374 | ArenaBitVector *isConstantV = cUnit->isConstantV; |
| 1375 | |
| 1376 | for (mir = bb->firstMIRInsn; mir; mir = mir->next) { |
| 1377 | int dfAttributes = |
| 1378 | oatDataFlowAttributes[mir->dalvikInsn.opcode]; |
| 1379 | |
| 1380 | DecodedInstruction *dInsn = &mir->dalvikInsn; |
| 1381 | |
| 1382 | if (!(dfAttributes & DF_HAS_DEFS)) continue; |
| 1383 | |
| 1384 | /* Handle instructions that set up constants directly */ |
| 1385 | if (dfAttributes & DF_SETS_CONST) { |
| 1386 | if (dfAttributes & DF_DA) { |
| 1387 | switch (dInsn->opcode) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1388 | case Instruction::CONST_4: |
| 1389 | case Instruction::CONST_16: |
| 1390 | case Instruction::CONST: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1391 | setConstant(cUnit, mir->ssaRep->defs[0], dInsn->vB); |
| 1392 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1393 | case Instruction::CONST_HIGH16: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1394 | setConstant(cUnit, mir->ssaRep->defs[0], |
| 1395 | dInsn->vB << 16); |
| 1396 | break; |
| 1397 | default: |
| 1398 | break; |
| 1399 | } |
| 1400 | } else if (dfAttributes & DF_DA_WIDE) { |
| 1401 | switch (dInsn->opcode) { |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1402 | case Instruction::CONST_WIDE_16: |
| 1403 | case Instruction::CONST_WIDE_32: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1404 | setConstant(cUnit, mir->ssaRep->defs[0], dInsn->vB); |
| 1405 | setConstant(cUnit, mir->ssaRep->defs[1], 0); |
| 1406 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1407 | case Instruction::CONST_WIDE: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1408 | setConstant(cUnit, mir->ssaRep->defs[0], |
| 1409 | (int) dInsn->vB_wide); |
| 1410 | setConstant(cUnit, mir->ssaRep->defs[1], |
| 1411 | (int) (dInsn->vB_wide >> 32)); |
| 1412 | break; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1413 | case Instruction::CONST_WIDE_HIGH16: |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1414 | setConstant(cUnit, mir->ssaRep->defs[0], 0); |
| 1415 | setConstant(cUnit, mir->ssaRep->defs[1], |
| 1416 | dInsn->vB << 16); |
| 1417 | break; |
| 1418 | default: |
| 1419 | break; |
| 1420 | } |
| 1421 | } |
| 1422 | /* Handle instructions that set up constants directly */ |
| 1423 | } else if (dfAttributes & DF_IS_MOVE) { |
| 1424 | int i; |
| 1425 | |
| 1426 | for (i = 0; i < mir->ssaRep->numUses; i++) { |
| 1427 | if (!oatIsBitSet(isConstantV, mir->ssaRep->uses[i])) break; |
| 1428 | } |
| 1429 | /* Move a register holding a constant to another register */ |
| 1430 | if (i == mir->ssaRep->numUses) { |
| 1431 | setConstant(cUnit, mir->ssaRep->defs[0], |
| 1432 | cUnit->constantValues[mir->ssaRep->uses[0]]); |
| 1433 | if (dfAttributes & DF_DA_WIDE) { |
| 1434 | setConstant(cUnit, mir->ssaRep->defs[1], |
| 1435 | cUnit->constantValues[mir->ssaRep->uses[1]]); |
| 1436 | } |
| 1437 | } |
| 1438 | } |
| 1439 | } |
| 1440 | /* TODO: implement code to handle arithmetic operations */ |
| 1441 | return true; |
| 1442 | } |
| 1443 | |
| 1444 | /* Setup the basic data structures for SSA conversion */ |
| 1445 | void oatInitializeSSAConversion(CompilationUnit* cUnit) |
| 1446 | { |
| 1447 | int i; |
Ian Rogers | a3760aa | 2011-11-14 14:32:37 -0800 | [diff] [blame] | 1448 | int numDalvikReg = cUnit->numDalvikRegisters; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1449 | |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1450 | cUnit->ssaToDalvikMap = (GrowableList *)oatNew(cUnit, sizeof(GrowableList), |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1451 | false, kAllocDFInfo); |
| 1452 | // Create the SSAtoDalvikMap, estimating the max size |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1453 | oatInitGrowableList(cUnit, cUnit->ssaToDalvikMap, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1454 | numDalvikReg + cUnit->defCount + 128, |
| 1455 | kListSSAtoDalvikMap); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1456 | /* |
| 1457 | * Initial number of SSA registers is equal to the number of Dalvik |
| 1458 | * registers. |
| 1459 | */ |
| 1460 | cUnit->numSSARegs = numDalvikReg; |
| 1461 | |
| 1462 | /* |
| 1463 | * Initialize the SSA2Dalvik map list. For the first numDalvikReg elements, |
| 1464 | * the subscript is 0 so we use the ENCODE_REG_SUB macro to encode the value |
| 1465 | * into "(0 << 16) | i" |
| 1466 | */ |
| 1467 | for (i = 0; i < numDalvikReg; i++) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1468 | oatInsertGrowableList(cUnit, cUnit->ssaToDalvikMap, |
| 1469 | ENCODE_REG_SUB(i, 0)); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1470 | } |
| 1471 | |
| 1472 | /* |
| 1473 | * Initialize the DalvikToSSAMap map. The low 16 bit is the SSA register id, |
| 1474 | * while the high 16 bit is the current subscript. The original Dalvik |
| 1475 | * register N is mapped to SSA register N with subscript 0. |
| 1476 | */ |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1477 | cUnit->dalvikToSSAMap = (int *)oatNew(cUnit, sizeof(int) * numDalvikReg, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1478 | false, kAllocDFInfo); |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1479 | /* Keep track of the higest def for each dalvik reg */ |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1480 | cUnit->SSALastDefs = (int *)oatNew(cUnit, sizeof(int) * numDalvikReg, |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1481 | false, kAllocDFInfo); |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1482 | |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1483 | for (i = 0; i < numDalvikReg; i++) { |
| 1484 | cUnit->dalvikToSSAMap[i] = i; |
buzbee | f0cde54 | 2011-09-13 14:55:02 -0700 | [diff] [blame] | 1485 | cUnit->SSALastDefs[i] = 0; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1486 | } |
| 1487 | |
| 1488 | /* |
| 1489 | * Allocate the BasicBlockDataFlow structure for the entry and code blocks |
| 1490 | */ |
| 1491 | GrowableListIterator iterator; |
| 1492 | |
| 1493 | oatGrowableListIteratorInit(&cUnit->blockList, &iterator); |
| 1494 | |
| 1495 | while (true) { |
| 1496 | BasicBlock* bb = (BasicBlock *) oatGrowableListIteratorNext(&iterator); |
| 1497 | if (bb == NULL) break; |
| 1498 | if (bb->hidden == true) continue; |
| 1499 | if (bb->blockType == kDalvikByteCode || |
| 1500 | bb->blockType == kEntryBlock || |
| 1501 | bb->blockType == kExitBlock) { |
| 1502 | bb->dataFlowInfo = (BasicBlockDataFlow *) |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1503 | oatNew(cUnit, sizeof(BasicBlockDataFlow), |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1504 | true, kAllocDFInfo); |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1505 | } |
| 1506 | } |
| 1507 | } |
| 1508 | |
| 1509 | /* Clear the visited flag for each BB */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1510 | bool oatClearVisitedFlag(struct CompilationUnit* cUnit, struct BasicBlock* bb) |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1511 | { |
| 1512 | bb->visited = false; |
| 1513 | return true; |
| 1514 | } |
| 1515 | |
| 1516 | void oatDataFlowAnalysisDispatcher(CompilationUnit* cUnit, |
| 1517 | bool (*func)(CompilationUnit*, BasicBlock*), |
| 1518 | DataFlowAnalysisMode dfaMode, |
| 1519 | bool isIterative) |
| 1520 | { |
| 1521 | bool change = true; |
| 1522 | |
| 1523 | while (change) { |
| 1524 | change = false; |
| 1525 | |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1526 | switch (dfaMode) { |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1527 | /* Scan all blocks and perform the operations specified in func */ |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1528 | case kAllNodes: |
| 1529 | { |
| 1530 | GrowableListIterator iterator; |
| 1531 | oatGrowableListIteratorInit(&cUnit->blockList, &iterator); |
| 1532 | while (true) { |
| 1533 | BasicBlock* bb = |
| 1534 | (BasicBlock *) oatGrowableListIteratorNext(&iterator); |
| 1535 | if (bb == NULL) break; |
| 1536 | if (bb->hidden == true) continue; |
| 1537 | change |= (*func)(cUnit, bb); |
| 1538 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1539 | } |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1540 | break; |
| 1541 | /* Scan reachable blocks and perform the ops specified in func. */ |
| 1542 | case kReachableNodes: |
| 1543 | { |
| 1544 | int numReachableBlocks = cUnit->numReachableBlocks; |
| 1545 | int idx; |
| 1546 | const GrowableList *blockList = &cUnit->blockList; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1547 | |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1548 | for (idx = 0; idx < numReachableBlocks; idx++) { |
| 1549 | int blockIdx = cUnit->dfsOrder.elemList[idx]; |
| 1550 | BasicBlock* bb = |
| 1551 | (BasicBlock *) oatGrowableListGetElement(blockList, |
| 1552 | blockIdx); |
| 1553 | change |= (*func)(cUnit, bb); |
| 1554 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1555 | } |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1556 | break; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1557 | |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1558 | /* Scan reachable blocks by pre-order dfs and invoke func on each. */ |
| 1559 | case kPreOrderDFSTraversal: |
| 1560 | { |
| 1561 | int numReachableBlocks = cUnit->numReachableBlocks; |
| 1562 | int idx; |
| 1563 | const GrowableList *blockList = &cUnit->blockList; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1564 | |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1565 | for (idx = 0; idx < numReachableBlocks; idx++) { |
| 1566 | int dfsIdx = cUnit->dfsOrder.elemList[idx]; |
| 1567 | BasicBlock* bb = |
| 1568 | (BasicBlock *) oatGrowableListGetElement(blockList, |
| 1569 | dfsIdx); |
| 1570 | change |= (*func)(cUnit, bb); |
| 1571 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1572 | } |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1573 | break; |
| 1574 | /* Scan reachable blocks post-order dfs and invoke func on each. */ |
| 1575 | case kPostOrderDFSTraversal: |
| 1576 | { |
| 1577 | int numReachableBlocks = cUnit->numReachableBlocks; |
| 1578 | int idx; |
| 1579 | const GrowableList *blockList = &cUnit->blockList; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1580 | |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1581 | for (idx = numReachableBlocks - 1; idx >= 0; idx--) { |
| 1582 | int dfsIdx = cUnit->dfsOrder.elemList[idx]; |
| 1583 | BasicBlock* bb = |
| 1584 | (BasicBlock *) oatGrowableListGetElement(blockList, |
| 1585 | dfsIdx); |
| 1586 | change |= (*func)(cUnit, bb); |
| 1587 | } |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1588 | } |
buzbee | 5b53710 | 2012-01-17 17:33:47 -0800 | [diff] [blame] | 1589 | break; |
| 1590 | /* Scan reachable post-order dom tree and invoke func on each. */ |
| 1591 | case kPostOrderDOMTraversal: |
| 1592 | { |
| 1593 | int numReachableBlocks = cUnit->numReachableBlocks; |
| 1594 | int idx; |
| 1595 | const GrowableList *blockList = &cUnit->blockList; |
| 1596 | |
| 1597 | for (idx = 0; idx < numReachableBlocks; idx++) { |
| 1598 | int domIdx = cUnit->domPostOrderTraversal.elemList[idx]; |
| 1599 | BasicBlock* bb = |
| 1600 | (BasicBlock *) oatGrowableListGetElement(blockList, |
| 1601 | domIdx); |
| 1602 | change |= (*func)(cUnit, bb); |
| 1603 | } |
| 1604 | } |
| 1605 | break; |
| 1606 | /* Scan reachable blocks reverse post-order dfs, invoke func on each */ |
| 1607 | case kReversePostOrderTraversal: |
| 1608 | { |
| 1609 | int numReachableBlocks = cUnit->numReachableBlocks; |
| 1610 | int idx; |
| 1611 | const GrowableList *blockList = &cUnit->blockList; |
| 1612 | |
| 1613 | for (idx = numReachableBlocks - 1; idx >= 0; idx--) { |
| 1614 | int revIdx = cUnit->dfsPostOrder.elemList[idx]; |
| 1615 | BasicBlock* bb = |
| 1616 | (BasicBlock *) oatGrowableListGetElement(blockList, |
| 1617 | revIdx); |
| 1618 | change |= (*func)(cUnit, bb); |
| 1619 | } |
| 1620 | } |
| 1621 | break; |
| 1622 | default: |
| 1623 | LOG(FATAL) << "Unknown traversal mode " << (int)dfaMode; |
buzbee | 67bf885 | 2011-08-17 17:51:35 -0700 | [diff] [blame] | 1624 | } |
| 1625 | /* If isIterative is false, exit the loop after the first iteration */ |
| 1626 | change &= isIterative; |
| 1627 | } |
| 1628 | } |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1629 | |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1630 | bool nullCheckEliminationInit(struct CompilationUnit* cUnit, |
| 1631 | struct BasicBlock* bb) |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1632 | { |
| 1633 | if (bb->dataFlowInfo == NULL) return false; |
| 1634 | bb->dataFlowInfo->endingNullCheckV = |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1635 | oatAllocBitVector(cUnit, cUnit->numSSARegs, false, kBitMapNullCheck); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1636 | oatClearAllBits(bb->dataFlowInfo->endingNullCheckV); |
| 1637 | return true; |
| 1638 | } |
| 1639 | |
| 1640 | /* Eliminate unnecessary null checks for a basic block. */ |
buzbee | 31a4a6f | 2012-02-28 15:36:15 -0800 | [diff] [blame] | 1641 | bool eliminateNullChecks( struct CompilationUnit* cUnit, struct BasicBlock* bb) |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1642 | { |
| 1643 | if (bb->dataFlowInfo == NULL) return false; |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1644 | |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1645 | /* |
| 1646 | * Set initial state. Be conservative with catch |
| 1647 | * blocks and start with no assumptions about null check |
| 1648 | * status (except for "this"). |
| 1649 | */ |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1650 | if ((bb->blockType == kEntryBlock) | bb->catchEntry) { |
| 1651 | oatClearAllBits(cUnit->tempSSARegisterV); |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 1652 | if ((cUnit->access_flags & kAccStatic) == 0) { |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1653 | // If non-static method, mark "this" as non-null |
Ian Rogers | a3760aa | 2011-11-14 14:32:37 -0800 | [diff] [blame] | 1654 | int thisReg = cUnit->numDalvikRegisters - cUnit->numIns; |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1655 | oatSetBit(cUnit, cUnit->tempSSARegisterV, thisReg); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1656 | } |
| 1657 | } else { |
| 1658 | // Starting state is intesection of all incoming arcs |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1659 | GrowableListIterator iter; |
| 1660 | oatGrowableListIteratorInit(bb->predecessors, &iter); |
| 1661 | BasicBlock* predBB = (BasicBlock*)oatGrowableListIteratorNext(&iter); |
| 1662 | DCHECK(predBB != NULL); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1663 | oatCopyBitVector(cUnit->tempSSARegisterV, |
| 1664 | predBB->dataFlowInfo->endingNullCheckV); |
| 1665 | while (true) { |
buzbee | 5abfa3e | 2012-01-31 17:01:43 -0800 | [diff] [blame] | 1666 | predBB = (BasicBlock*)oatGrowableListIteratorNext(&iter); |
| 1667 | if (!predBB) break; |
buzbee | aad7201 | 2011-09-21 21:52:09 -0700 | [diff] [blame] | 1668 | if ((predBB->dataFlowInfo == NULL) || |
| 1669 | (predBB->dataFlowInfo->endingNullCheckV == NULL)) { |
| 1670 | continue; |
| 1671 | } |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1672 | oatIntersectBitVectors(cUnit->tempSSARegisterV, |
| 1673 | cUnit->tempSSARegisterV, |
| 1674 | predBB->dataFlowInfo->endingNullCheckV); |
| 1675 | } |
| 1676 | } |
| 1677 | |
| 1678 | // Walk through the instruction in the block, updating as necessary |
| 1679 | for (MIR* mir = bb->firstMIRInsn; mir; mir = mir->next) { |
| 1680 | if (mir->ssaRep == NULL) { |
| 1681 | continue; |
| 1682 | } |
| 1683 | int dfAttributes = |
| 1684 | oatDataFlowAttributes[mir->dalvikInsn.opcode]; |
| 1685 | |
| 1686 | // Mark target of NEW* as non-null |
| 1687 | if (dfAttributes & DF_NON_NULL_DST) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1688 | oatSetBit(cUnit, cUnit->tempSSARegisterV, mir->ssaRep->defs[0]); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1689 | } |
| 1690 | |
| 1691 | // Mark non-null returns from invoke-style NEW* |
| 1692 | if (dfAttributes & DF_NON_NULL_RET) { |
| 1693 | MIR* nextMir = mir->next; |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1694 | // Next should be an MOVE_RESULT_OBJECT |
| 1695 | if (nextMir && nextMir->dalvikInsn.opcode == Instruction::MOVE_RESULT_OBJECT) { |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1696 | // Mark as null checked |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1697 | oatSetBit(cUnit, cUnit->tempSSARegisterV, |
| 1698 | nextMir->ssaRep->defs[0]); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1699 | } else { |
| 1700 | if (nextMir) { |
| 1701 | LOG(WARNING) << "Unexpected opcode following new: " << |
| 1702 | (int)nextMir->dalvikInsn.opcode; |
buzbee | 949f56e | 2011-10-06 11:05:45 -0700 | [diff] [blame] | 1703 | } else if (bb->fallThrough) { |
| 1704 | // Look in next basic block |
| 1705 | struct BasicBlock* nextBB = bb->fallThrough; |
| 1706 | for (MIR* tmir = nextBB->firstMIRInsn; tmir; |
| 1707 | tmir =tmir->next){ |
| 1708 | if ((int)tmir->dalvikInsn.opcode >= (int)kMirOpFirst) { |
| 1709 | continue; |
| 1710 | } |
Elliott Hughes | adb8c67 | 2012-03-06 16:49:32 -0800 | [diff] [blame] | 1711 | // First non-pseudo should be MOVE_RESULT_OBJECT |
| 1712 | if (tmir->dalvikInsn.opcode == Instruction::MOVE_RESULT_OBJECT) { |
buzbee | 949f56e | 2011-10-06 11:05:45 -0700 | [diff] [blame] | 1713 | // Mark as null checked |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1714 | oatSetBit(cUnit, cUnit->tempSSARegisterV, |
buzbee | 949f56e | 2011-10-06 11:05:45 -0700 | [diff] [blame] | 1715 | tmir->ssaRep->defs[0]); |
| 1716 | } else { |
| 1717 | LOG(WARNING) << "Unexpected op after new: " << |
| 1718 | (int)tmir->dalvikInsn.opcode; |
| 1719 | } |
| 1720 | break; |
| 1721 | } |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1722 | } |
| 1723 | } |
| 1724 | } |
| 1725 | |
| 1726 | /* |
| 1727 | * Propagate nullcheck state on register copies (including |
| 1728 | * Phi pseudo copies. For the latter, nullcheck state is |
| 1729 | * the "and" of all the Phi's operands. |
| 1730 | */ |
| 1731 | if (dfAttributes & (DF_NULL_TRANSFER_0 | DF_NULL_TRANSFER_N)) { |
| 1732 | int tgtSreg = mir->ssaRep->defs[0]; |
| 1733 | int operands = (dfAttributes & DF_NULL_TRANSFER_0) ? 1 : |
| 1734 | mir->ssaRep->numUses; |
| 1735 | bool nullChecked = true; |
| 1736 | for (int i = 0; i < operands; i++) { |
| 1737 | nullChecked &= oatIsBitSet(cUnit->tempSSARegisterV, |
| 1738 | mir->ssaRep->uses[i]); |
| 1739 | } |
| 1740 | if (nullChecked) { |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1741 | oatSetBit(cUnit, cUnit->tempSSARegisterV, tgtSreg); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1742 | } |
| 1743 | } |
| 1744 | |
| 1745 | // Already nullchecked? |
| 1746 | if (dfAttributes & DF_HAS_NULL_CHKS) { |
| 1747 | int srcSreg = (dfAttributes & DF_NULL_CHK_1) ? |
| 1748 | mir->ssaRep->uses[1] : mir->ssaRep->uses[0]; |
| 1749 | if (oatIsBitSet(cUnit->tempSSARegisterV, srcSreg)) { |
| 1750 | // Eliminate the null check |
| 1751 | mir->optimizationFlags |= MIR_IGNORE_NULL_CHECK; |
| 1752 | } else { |
| 1753 | // Mark sReg as null-checked |
buzbee | ba938cb | 2012-02-03 14:47:55 -0800 | [diff] [blame] | 1754 | oatSetBit(cUnit, cUnit->tempSSARegisterV, srcSreg); |
buzbee | 43a3642 | 2011-09-14 14:00:13 -0700 | [diff] [blame] | 1755 | } |
| 1756 | } |
| 1757 | } |
| 1758 | |
| 1759 | // Did anything change? |
| 1760 | bool res = oatCompareBitVectors(bb->dataFlowInfo->endingNullCheckV, |
| 1761 | cUnit->tempSSARegisterV); |
| 1762 | if (res) { |
| 1763 | oatCopyBitVector(bb->dataFlowInfo->endingNullCheckV, |
| 1764 | cUnit->tempSSARegisterV); |
| 1765 | } |
| 1766 | return res; |
| 1767 | } |
| 1768 | |
| 1769 | void oatMethodNullCheckElimination(CompilationUnit *cUnit) |
| 1770 | { |
| 1771 | if (!(cUnit->disableOpt & (1 << kNullCheckElimination))) { |
| 1772 | DCHECK(cUnit->tempSSARegisterV != NULL); |
| 1773 | oatDataFlowAnalysisDispatcher(cUnit, nullCheckEliminationInit, |
| 1774 | kAllNodes, |
| 1775 | false /* isIterative */); |
| 1776 | oatDataFlowAnalysisDispatcher(cUnit, eliminateNullChecks, |
| 1777 | kPreOrderDFSTraversal, |
| 1778 | true /* isIterative */); |
| 1779 | } |
| 1780 | } |
Elliott Hughes | 11d1b0c | 2012-01-23 16:57:47 -0800 | [diff] [blame] | 1781 | |
| 1782 | } // namespace art |