comparison jagcpu.c @ 1096:1ab30d427db8

Better disassembly of GPU/DSP load store instructions
author Michael Pavone <pavone@retrodev.com>
date Mon, 31 Oct 2016 18:41:42 -0700
parents 920d796ea6a2
children c1e78a101912
comparison
equal deleted inserted replaced
1095:920d796ea6a2 1096:1ab30d427db8
141 || opcode == JAG_BTST 141 || opcode == JAG_BTST
142 || opcode == JAG_BSET 142 || opcode == JAG_BSET
143 || opcode == JAG_BCLR; 143 || opcode == JAG_BCLR;
144 } 144 }
145 145
146 uint8_t is_load(uint16_t opcode, uint8_t is_gpu)
147 {
148 return opcode == JAG_LOAD
149 || opcode == JAG_LOADB
150 || opcode == JAG_LOADW
151 || (is_gpu && opcode == GPU_LOADP);
152 }
153
154 uint8_t is_store(uint16_t opcode, uint8_t is_gpu)
155 {
156 return opcode == JAG_STORE
157 || opcode == JAG_STOREB
158 || opcode == JAG_STOREW
159 || (is_gpu && opcode == GPU_STOREP);
160 }
161
146 char * jag_cc_names[] = { 162 char * jag_cc_names[] = {
147 "t", 163 "t",
148 "ne", 164 "ne",
149 "eq", 165 "eq",
150 "f", 166 "f",
258 default: 274 default:
259 if (is_quick_1_32_opcode(opcode, is_gpu)) { 275 if (is_quick_1_32_opcode(opcode, is_gpu)) {
260 return sprintf(dst, "%s %d, r%d", mnemonics[opcode], jag_quick(inst), jag_reg2(inst)); 276 return sprintf(dst, "%s %d, r%d", mnemonics[opcode], jag_quick(inst), jag_reg2(inst));
261 } else if (is_quick_0_31_opcode(opcode)) { 277 } else if (is_quick_0_31_opcode(opcode)) {
262 return sprintf(dst, "%s %d, r%d", mnemonics[opcode], jag_reg1(inst), jag_reg2(inst)); 278 return sprintf(dst, "%s %d, r%d", mnemonics[opcode], jag_reg1(inst), jag_reg2(inst));
279 } else if (is_load(opcode, is_gpu)) {
280 return sprintf(dst, "%s (r%d), r%d", mnemonics[opcode], jag_reg1(inst), jag_reg2(inst));
281 } else if (is_store(opcode, is_gpu)) {
282 return sprintf(dst, "%s r%d, (r%d)", mnemonics[opcode], jag_reg2(inst), jag_reg1(inst));
263 } else { 283 } else {
264 return sprintf(dst, "%s r%d, r%d", mnemonics[opcode], jag_reg1(inst), jag_reg2(inst)); 284 return sprintf(dst, "%s r%d, r%d", mnemonics[opcode], jag_reg1(inst), jag_reg2(inst));
265 } 285 }
266 } 286 }
267 } 287 }