| 176 | } |
| 177 | |
| 178 | bool thumb_has_writeback(struct decomp_result* result) |
| 179 | { |
| 180 | /* for 16-bit LDM, {!} is removed if the base register is in the register list */ |
| 181 | if(result->mnem == armv7::ARMV7_LDM && result->instrSize==16) { |
| 182 | int list = result->fields[FIELD_register_list]; |
| 183 | int Rn = result->fields[FIELD_Rn]; |
| 184 | //printf("Rn: 0x%x\n", Rn); |
| 185 | /* if the base register is in the register list, we discard the bang */ |
| 186 | if(list & (1 << Rn)) |
| 187 | return false; |
| 188 | else |
| 189 | return true; |
| 190 | } |
| 191 | else |
| 192 | /* for others, {!} field determined by "W" element */ |
| 193 | if(IS_FIELD_PRESENT(result, FIELD_W)) { |
| 194 | if(result->fields[FIELD_W]) |
| 195 | return true; |
| 196 | } |
| 197 | else { |
| 198 | #ifdef DEBUG_DISASM |
| 199 | if(getenv("DEBUG_DISASM")) { |
| 200 | printf("ERROR: don't know how to deal with {!} field\n"); |
| 201 | } |
| 202 | #endif |
| 203 | return false; |
| 204 | } |
| 205 | return false; |
| 206 | } |
| 207 | |
| 208 | /* inspect the decomposition result to return the operation name |
| 209 |
no outgoing calls
no test coverage detected