1 |
/* |
/* |
2 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_sparc.c,v 1.11 2005/12/11 21:34:43 debug Exp $ |
* $Id: cpu_sparc.c,v 1.31 2006/06/24 21:47:23 debug Exp $ |
29 |
* |
* |
30 |
* SPARC CPU emulation. |
* SPARC CPU emulation. |
31 |
*/ |
*/ |
43 |
|
|
44 |
|
|
45 |
#define DYNTRANS_DUALMODE_32 |
#define DYNTRANS_DUALMODE_32 |
46 |
|
#define DYNTRANS_DELAYSLOT |
47 |
#include "tmp_sparc_head.c" |
#include "tmp_sparc_head.c" |
48 |
|
|
49 |
|
|
50 |
static char *sparc_regnames[N_SPARC_REG] = SPARC_REG_NAMES; |
static char *sparc_regnames[N_SPARC_REG] = SPARC_REG_NAMES; |
51 |
|
static char *sparc_pregnames[N_SPARC_PREG] = SPARC_PREG_NAMES; |
52 |
static char *sparc_regbranch_names[N_SPARC_REGBRANCH_TYPES] = |
static char *sparc_regbranch_names[N_SPARC_REGBRANCH_TYPES] = |
53 |
SPARC_REGBRANCH_NAMES; |
SPARC_REGBRANCH_NAMES; |
54 |
static char *sparc_branch_names[N_SPARC_BRANCH_TYPES] = SPARC_BRANCH_NAMES; |
static char *sparc_branch_names[N_SPARC_BRANCH_TYPES] = SPARC_BRANCH_NAMES; |
88 |
cpu->byte_order = EMUL_BIG_ENDIAN; |
cpu->byte_order = EMUL_BIG_ENDIAN; |
89 |
cpu->is_32bit = (cpu->cd.sparc.cpu_type.bits == 32)? 1 : 0; |
cpu->is_32bit = (cpu->cd.sparc.cpu_type.bits == 32)? 1 : 0; |
90 |
|
|
91 |
|
cpu->instruction_has_delayslot = sparc_cpu_instruction_has_delayslot; |
92 |
|
|
93 |
if (cpu->is_32bit) { |
if (cpu->is_32bit) { |
94 |
cpu->update_translation_table = |
cpu->update_translation_table = |
95 |
sparc32_update_translation_table; |
sparc32_update_translation_table; |
129 |
} |
} |
130 |
} |
} |
131 |
|
|
132 |
|
/* After a reset, the Tick register is not readable by user code: */ |
133 |
|
cpu->cd.sparc.tick |= SPARC_TICK_NPT; |
134 |
|
|
135 |
|
/* Insert number of Windows and Trap levels into the version reg.: */ |
136 |
|
cpu->cd.sparc.ver |= MAXWIN | (MAXTL << SPARC_VER_MAXTL_SHIFT); |
137 |
|
|
138 |
return 1; |
return 1; |
139 |
} |
} |
140 |
|
|
152 |
i = 0; |
i = 0; |
153 |
while (tdefs[i].name != NULL) { |
while (tdefs[i].name != NULL) { |
154 |
debug("%s", tdefs[i].name); |
debug("%s", tdefs[i].name); |
155 |
for (j=10 - strlen(tdefs[i].name); j>0; j--) |
for (j=16 - strlen(tdefs[i].name); j>0; j--) |
156 |
debug(" "); |
debug(" "); |
157 |
i++; |
i++; |
158 |
if ((i % 6) == 0 || tdefs[i].name == NULL) |
if ((i % 4) == 0 || tdefs[i].name == NULL) |
159 |
debug("\n"); |
debug("\n"); |
160 |
} |
} |
161 |
} |
} |
192 |
|
|
193 |
debug("cpu%i: pc = 0x", x); |
debug("cpu%i: pc = 0x", x); |
194 |
if (bits32) |
if (bits32) |
195 |
debug("%08x", (int)cpu->pc); |
debug("%08"PRIx32, (uint32_t) cpu->pc); |
196 |
else |
else |
197 |
debug("%016llx", (long long)cpu->pc); |
debug("%016"PRIx64, (uint64_t) cpu->pc); |
198 |
debug(" <%s>\n", symbol != NULL? symbol : " no symbol "); |
debug(" <%s>\n", symbol != NULL? symbol : " no symbol "); |
199 |
|
|
200 |
|
debug("cpu%i: y = 0x%08"PRIx32" ", |
201 |
|
x, (uint32_t)cpu->cd.sparc.y); |
202 |
|
debug("icc = "); |
203 |
|
debug(cpu->cd.sparc.ccr & SPARC_CCR_N? "N" : "n"); |
204 |
|
debug(cpu->cd.sparc.ccr & SPARC_CCR_Z? "Z" : "z"); |
205 |
|
debug(cpu->cd.sparc.ccr & SPARC_CCR_V? "V" : "v"); |
206 |
|
debug(cpu->cd.sparc.ccr & SPARC_CCR_C? "C" : "c"); |
207 |
|
if (!bits32) { |
208 |
|
debug(" xcc = "); |
209 |
|
debug((cpu->cd.sparc.ccr >> SPARC_CCR_XCC_SHIFT) |
210 |
|
& SPARC_CCR_N? "N" : "n"); |
211 |
|
debug((cpu->cd.sparc.ccr >> SPARC_CCR_XCC_SHIFT) |
212 |
|
& SPARC_CCR_Z? "Z" : "z"); |
213 |
|
debug((cpu->cd.sparc.ccr >> SPARC_CCR_XCC_SHIFT) |
214 |
|
& SPARC_CCR_V? "V" : "v"); |
215 |
|
debug((cpu->cd.sparc.ccr >> SPARC_CCR_XCC_SHIFT) |
216 |
|
& SPARC_CCR_C? "C" : "c"); |
217 |
|
} |
218 |
|
debug("\n"); |
219 |
|
|
220 |
|
if (bits32) |
221 |
|
debug("cpu%i: psr = 0x%08"PRIx32"\n", |
222 |
|
x, (uint32_t) cpu->cd.sparc.psr); |
223 |
|
else |
224 |
|
debug("cpu%i: pstate = 0x%016"PRIx64"\n", |
225 |
|
x, (uint64_t) cpu->cd.sparc.pstate); |
226 |
|
|
227 |
if (bits32) { |
if (bits32) { |
228 |
for (i=0; i<N_SPARC_REG; i++) { |
for (i=0; i<N_SPARC_REG; i++) { |
229 |
if ((i & 3) == 0) |
if ((i & 3) == 0) |
230 |
debug("cpu%i: ", x); |
debug("cpu%i: ", x); |
231 |
/* Skip the zero register: */ |
/* Skip the zero register: */ |
232 |
if (i==0) { |
if (i == SPARC_ZEROREG) { |
233 |
debug(" "); |
debug(" "); |
234 |
continue; |
continue; |
235 |
} |
} |
245 |
int r = ((i >> 1) & 15) | ((i&1) << 4); |
int r = ((i >> 1) & 15) | ((i&1) << 4); |
246 |
if ((i & 1) == 0) |
if ((i & 1) == 0) |
247 |
debug("cpu%i: ", x); |
debug("cpu%i: ", x); |
248 |
|
|
249 |
/* Skip the zero register: */ |
/* Skip the zero register: */ |
250 |
if (r==0) { |
if (i == SPARC_ZEROREG) { |
251 |
debug(" "); |
debug(" "); |
252 |
continue; |
continue; |
253 |
} |
} |
254 |
|
|
255 |
debug("%s = ", sparc_regnames[r]); |
debug("%s = ", sparc_regnames[r]); |
256 |
debug("0x%016llx", (long long) |
debug("0x%016"PRIx64, (uint64_t) |
257 |
cpu->cd.sparc.r[r]); |
cpu->cd.sparc.r[r]); |
258 |
|
|
259 |
if ((i & 1) < 1) |
if ((i & 1) < 1) |
260 |
debug(" "); |
debug(" "); |
261 |
else |
else |
272 |
void sparc_cpu_register_match(struct machine *m, char *name, |
void sparc_cpu_register_match(struct machine *m, char *name, |
273 |
int writeflag, uint64_t *valuep, int *match_register) |
int writeflag, uint64_t *valuep, int *match_register) |
274 |
{ |
{ |
275 |
int cpunr = 0; |
int i, cpunr = 0; |
276 |
|
|
277 |
/* CPU number: */ |
/* CPU number: */ |
|
|
|
278 |
/* TODO */ |
/* TODO */ |
279 |
|
|
280 |
/* Register name: */ |
for (i=0; i<N_SPARC_REG; i++) { |
281 |
|
if (strcasecmp(name, sparc_regnames[i]) == 0) { |
282 |
|
if (writeflag && i != SPARC_ZEROREG) |
283 |
|
m->cpus[cpunr]->cd.sparc.r[i] = *valuep; |
284 |
|
else |
285 |
|
*valuep = m->cpus[cpunr]->cd.sparc.r[i]; |
286 |
|
*match_register = 1; |
287 |
|
} |
288 |
|
} |
289 |
|
|
290 |
if (strcasecmp(name, "pc") == 0) { |
if (strcasecmp(name, "pc") == 0) { |
291 |
if (writeflag) { |
if (writeflag) { |
292 |
m->cpus[cpunr]->pc = *valuep; |
m->cpus[cpunr]->pc = *valuep; |
293 |
} else |
} else { |
294 |
*valuep = m->cpus[cpunr]->pc; |
*valuep = m->cpus[cpunr]->pc; |
295 |
|
} |
296 |
*match_register = 1; |
*match_register = 1; |
297 |
} |
} |
298 |
|
|
299 |
|
if (strcasecmp(name, "y") == 0) { |
300 |
|
if (writeflag) { |
301 |
|
m->cpus[cpunr]->cd.sparc.y = (uint32_t) *valuep; |
302 |
|
} else { |
303 |
|
*valuep = (uint32_t) m->cpus[cpunr]->cd.sparc.y; |
304 |
|
} |
305 |
|
*match_register = 1; |
306 |
|
} |
307 |
|
|
308 |
|
if (*match_register && m->cpus[cpunr]->is_32bit) |
309 |
|
(*valuep) &= 0xffffffffULL; |
310 |
|
} |
311 |
|
|
312 |
|
|
313 |
|
/* |
314 |
|
* sparc_cpu_tlbdump(): |
315 |
|
* |
316 |
|
* Called from the debugger to dump the TLB in a readable format. |
317 |
|
* x is the cpu number to dump, or -1 to dump all CPUs. |
318 |
|
* |
319 |
|
* If rawflag is nonzero, then the TLB contents isn't formated nicely, |
320 |
|
* just dumped. |
321 |
|
*/ |
322 |
|
void sparc_cpu_tlbdump(struct machine *m, int x, int rawflag) |
323 |
|
{ |
324 |
|
} |
325 |
|
|
326 |
|
|
327 |
|
static void add_response_word(struct cpu *cpu, char *r, uint64_t value, |
328 |
|
size_t maxlen, int len) |
329 |
|
{ |
330 |
|
char *format = (len == 4)? "%08"PRIx64 : "%016"PRIx64; |
331 |
|
if (len == 4) |
332 |
|
value &= 0xffffffffULL; |
333 |
|
if (cpu->byte_order == EMUL_LITTLE_ENDIAN) { |
334 |
|
if (len == 4) { |
335 |
|
value = ((value & 0xff) << 24) + |
336 |
|
((value & 0xff00) << 8) + |
337 |
|
((value & 0xff0000) >> 8) + |
338 |
|
((value & 0xff000000) >> 24); |
339 |
|
} else { |
340 |
|
value = ((value & 0xff) << 56) + |
341 |
|
((value & 0xff00) << 40) + |
342 |
|
((value & 0xff0000) << 24) + |
343 |
|
((value & 0xff000000ULL) << 8) + |
344 |
|
((value & 0xff00000000ULL) >> 8) + |
345 |
|
((value & 0xff0000000000ULL) >> 24) + |
346 |
|
((value & 0xff000000000000ULL) >> 40) + |
347 |
|
((value & 0xff00000000000000ULL) >> 56); |
348 |
|
} |
349 |
|
} |
350 |
|
snprintf(r + strlen(r), maxlen - strlen(r), format, (uint64_t)value); |
351 |
|
} |
352 |
|
|
353 |
|
|
354 |
|
/* |
355 |
|
* sparc_cpu_gdb_stub(): |
356 |
|
* |
357 |
|
* Execute a "remote GDB" command. Returns a newly allocated response string |
358 |
|
* on success, NULL on failure. |
359 |
|
*/ |
360 |
|
char *sparc_cpu_gdb_stub(struct cpu *cpu, char *cmd) |
361 |
|
{ |
362 |
|
if (strcmp(cmd, "g") == 0) { |
363 |
|
int i; |
364 |
|
char *r; |
365 |
|
size_t wlen = cpu->is_32bit? |
366 |
|
sizeof(uint32_t) : sizeof(uint64_t); |
367 |
|
size_t len = 1 + 76 * wlen; |
368 |
|
r = malloc(len); |
369 |
|
if (r == NULL) { |
370 |
|
fprintf(stderr, "out of memory\n"); |
371 |
|
exit(1); |
372 |
|
} |
373 |
|
r[0] = '\0'; |
374 |
|
/* TODO */ |
375 |
|
for (i=0; i<128; i++) |
376 |
|
add_response_word(cpu, r, i, len, wlen); |
377 |
|
return r; |
378 |
|
} |
379 |
|
|
380 |
|
if (cmd[0] == 'p') { |
381 |
|
int regnr = strtol(cmd + 1, NULL, 16); |
382 |
|
size_t wlen = sizeof(uint32_t); |
383 |
|
/* TODO: cpu->is_32bit? sizeof(uint32_t) : sizeof(uint64_t); */ |
384 |
|
size_t len = 2 * wlen + 1; |
385 |
|
char *r = malloc(len); |
386 |
|
r[0] = '\0'; |
387 |
|
if (regnr >= 0 && regnr < N_SPARC_REG) { |
388 |
|
add_response_word(cpu, r, |
389 |
|
cpu->cd.sparc.r[regnr], len, wlen); |
390 |
|
} else if (regnr == 0x44) { |
391 |
|
add_response_word(cpu, r, cpu->pc, len, wlen); |
392 |
|
/* TODO: |
393 |
|
20..3f = f0..f31 |
394 |
|
40 = y |
395 |
|
41 = psr |
396 |
|
42 = wim |
397 |
|
43 = tbr |
398 |
|
45 = npc |
399 |
|
46 = fsr |
400 |
|
47 = csr |
401 |
|
*/ |
402 |
|
} else { |
403 |
|
/* Unimplemented: */ |
404 |
|
add_response_word(cpu, r, 0xcc000 + regnr, len, wlen); |
405 |
|
} |
406 |
|
return r; |
407 |
|
} |
408 |
|
|
409 |
|
fatal("sparc_cpu_gdb_stub(): TODO\n"); |
410 |
|
return NULL; |
411 |
} |
} |
412 |
|
|
413 |
|
|
432 |
|
|
433 |
|
|
434 |
/* |
/* |
435 |
|
* sparc_cpu_instruction_has_delayslot(): |
436 |
|
* |
437 |
|
* Return 1 if an opcode is a branch, 0 otherwise. |
438 |
|
*/ |
439 |
|
int sparc_cpu_instruction_has_delayslot(struct cpu *cpu, unsigned char *ib) |
440 |
|
{ |
441 |
|
uint32_t iword = *((uint32_t *)&ib[0]); |
442 |
|
int hi2, op2; |
443 |
|
|
444 |
|
iword = BE32_TO_HOST(iword); |
445 |
|
|
446 |
|
hi2 = iword >> 30; |
447 |
|
op2 = (hi2 == 0)? ((iword >> 22) & 7) : ((iword >> 19) & 0x3f); |
448 |
|
|
449 |
|
switch (hi2) { |
450 |
|
case 0: /* conditional branch */ |
451 |
|
switch (op2) { |
452 |
|
case 1: |
453 |
|
case 2: |
454 |
|
case 3: return 1; |
455 |
|
} |
456 |
|
break; |
457 |
|
case 1: /* call */ |
458 |
|
return 1; |
459 |
|
case 2: /* misc alu instructions */ |
460 |
|
switch (op2) { |
461 |
|
case 56:/* jump and link */ |
462 |
|
return 1; |
463 |
|
} |
464 |
|
break; |
465 |
|
} |
466 |
|
|
467 |
|
return 0; |
468 |
|
} |
469 |
|
|
470 |
|
|
471 |
|
/* |
472 |
* sparc_cpu_disassemble_instr(): |
* sparc_cpu_disassemble_instr(): |
473 |
* |
* |
474 |
* Convert an instruction word into human readable format, for instruction |
* Convert an instruction word into human readable format, for instruction |
481 |
* cpu->pc for relative addresses. |
* cpu->pc for relative addresses. |
482 |
*/ |
*/ |
483 |
int sparc_cpu_disassemble_instr(struct cpu *cpu, unsigned char *instr, |
int sparc_cpu_disassemble_instr(struct cpu *cpu, unsigned char *instr, |
484 |
int running, uint64_t dumpaddr, int bintrans) |
int running, uint64_t dumpaddr) |
485 |
{ |
{ |
486 |
uint64_t offset, tmp; |
uint64_t offset, tmp; |
487 |
uint32_t iword; |
uint32_t iword; |
488 |
int hi2, op2, rd, rs1, rs2, siconst, btype, tmps, no_rd = 0; |
int hi2, op2, rd, rs1, rs2, siconst, btype, tmps, no_rd = 0; |
489 |
int asi, no_rs1 = 0, no_rs2 = 0, jmpl = 0, shift_x = 0, cc, p; |
int asi, no_rs1 = 0, no_rs2 = 0, jmpl = 0, shift_x = 0, cc, p; |
490 |
char *symbol, *mnem; |
char *symbol, *mnem, *rd_name, *rs_name; |
491 |
|
|
492 |
if (running) |
if (running) |
493 |
dumpaddr = cpu->pc; |
dumpaddr = cpu->pc; |
501 |
debug("cpu%i: ", cpu->cpu_id); |
debug("cpu%i: ", cpu->cpu_id); |
502 |
|
|
503 |
if (cpu->is_32bit) |
if (cpu->is_32bit) |
504 |
debug("%08x", (int)dumpaddr); |
debug("%08"PRIx32, (uint32_t) dumpaddr); |
505 |
else |
else |
506 |
debug("%016llx", (long long)dumpaddr); |
debug("%016"PRIx64, (uint64_t) dumpaddr); |
507 |
|
|
508 |
iword = *(uint32_t *)&instr[0]; |
iword = *(uint32_t *)&instr[0]; |
509 |
iword = BE32_TO_HOST(iword); |
iword = BE32_TO_HOST(iword); |
510 |
|
|
511 |
debug(": %08x\t", iword); |
debug(": %08x", iword); |
512 |
|
|
513 |
|
if (running && cpu->delay_slot) |
514 |
|
debug(" (d)"); |
515 |
|
|
516 |
|
debug("\t"); |
517 |
|
|
518 |
|
|
519 |
/* |
/* |
520 |
* Decode the instruction: |
* Decode the instruction: |
575 |
} |
} |
576 |
tmp = (int64_t)(int32_t)tmps; |
tmp = (int64_t)(int32_t)tmps; |
577 |
tmp += dumpaddr; |
tmp += dumpaddr; |
578 |
debug("0x%llx", (long long)tmp); |
debug("0x%"PRIx64, (uint64_t) tmp); |
579 |
symbol = get_symbol_name(&cpu->machine-> |
symbol = get_symbol_name(&cpu->machine-> |
580 |
symbol_context, tmp, &offset); |
symbol_context, tmp, &offset); |
581 |
if (symbol != NULL) |
if (symbol != NULL) |
596 |
|
|
597 |
case 1: tmp = (int32_t)iword << 2; |
case 1: tmp = (int32_t)iword << 2; |
598 |
tmp += dumpaddr; |
tmp += dumpaddr; |
599 |
debug("call\t0x%llx", (long long)tmp); |
debug("call\t0x%"PRIx64, (uint64_t) tmp); |
600 |
symbol = get_symbol_name(&cpu->machine->symbol_context, |
symbol = get_symbol_name(&cpu->machine->symbol_context, |
601 |
tmp, &offset); |
tmp, &offset); |
602 |
if (symbol != NULL) |
if (symbol != NULL) |
604 |
break; |
break; |
605 |
|
|
606 |
case 2: mnem = sparc_alu_names[op2]; |
case 2: mnem = sparc_alu_names[op2]; |
607 |
|
rs_name = sparc_regnames[rs1]; |
608 |
|
rd_name = sparc_regnames[rd]; |
609 |
switch (op2) { |
switch (op2) { |
610 |
case 0: /* add */ |
case 0: /* add */ |
611 |
if (rd == rs1 && (iword & 0x3fff) == 0x2001) { |
if (rd == rs1 && (iword & 0x3fff) == 0x2001) { |
640 |
} else |
} else |
641 |
siconst &= 0x1f; |
siconst &= 0x1f; |
642 |
break; |
break; |
643 |
|
case 40:/* rd on pre-sparcv9, membar etc on sparcv9 */ |
644 |
|
no_rs2 = 1; |
645 |
|
rs_name = "UNIMPLEMENTED"; |
646 |
|
switch (rs1) { |
647 |
|
case 0: rs_name = "y"; break; |
648 |
|
case 2: rs_name = "ccr"; break; |
649 |
|
case 3: rs_name = "asi"; break; |
650 |
|
case 4: rs_name = "tick"; break; |
651 |
|
case 5: rs_name = "pc"; break; |
652 |
|
case 6: rs_name = "fprs"; break; |
653 |
|
case 15:/* membar etc. */ |
654 |
|
if ((iword >> 13) & 1) { |
655 |
|
no_rd = 1; |
656 |
|
mnem = "membar"; |
657 |
|
rs_name = "#TODO"; |
658 |
|
} |
659 |
|
break; |
660 |
|
case 23:rs_name = "tick_cmpr"; break; /* v9 ? */ |
661 |
|
} |
662 |
|
break; |
663 |
|
case 41:rs_name = "psr"; |
664 |
|
no_rs2 = 1; |
665 |
|
break; |
666 |
|
case 42:rs_name = "wim"; |
667 |
|
no_rs2 = 1; |
668 |
|
break; |
669 |
case 43:/* ? */ |
case 43:/* ? */ |
670 |
|
/* TODO: pre-sparcv9: rd, rs_name = "tbr"; */ |
671 |
if (iword == 0x81580000) { |
if (iword == 0x81580000) { |
672 |
mnem = "flushw"; |
mnem = "flushw"; |
673 |
no_rs1 = no_rs2 = no_rd = 1; |
no_rs1 = no_rs2 = no_rd = 1; |
674 |
} |
} |
675 |
break; |
break; |
676 |
|
case 48:/* wr* (SPARCv8) */ |
677 |
|
mnem = "wr"; |
678 |
|
if (rs1 == SPARC_ZEROREG) |
679 |
|
no_rs1 = 1; |
680 |
|
switch (rd) { |
681 |
|
case 0: rd_name = "y"; break; |
682 |
|
case 2: rd_name = "ccr"; break; |
683 |
|
case 3: rd_name = "asi"; break; |
684 |
|
case 6: rd_name = "fprs"; break; |
685 |
|
case 23:rd_name = "tick_cmpr"; break; /* v9 ? */ |
686 |
|
default:rd_name = "UNIMPLEMENTED"; |
687 |
|
} |
688 |
|
break; |
689 |
case 49:/* ? */ |
case 49:/* ? */ |
690 |
if (iword == 0x83880000) { |
if (iword == 0x83880000) { |
691 |
mnem = "restored"; |
mnem = "restored"; |
692 |
no_rs1 = no_rs2 = no_rd = 1; |
no_rs1 = no_rs2 = no_rd = 1; |
693 |
} |
} |
694 |
break; |
break; |
695 |
|
case 50:/* wrpr */ |
696 |
|
rd_name = sparc_pregnames[rd]; |
697 |
|
if (rs1 == SPARC_ZEROREG) |
698 |
|
no_rs1 = 1; |
699 |
|
break; |
700 |
case 56:/* jmpl */ |
case 56:/* jmpl */ |
701 |
jmpl = 1; |
jmpl = 1; |
702 |
if (iword == 0x81c7e008) { |
if (iword == 0x81c7e008) { |
723 |
debug("x"); |
debug("x"); |
724 |
debug("\t"); |
debug("\t"); |
725 |
if (!no_rs1) |
if (!no_rs1) |
726 |
debug("%%%s", sparc_regnames[rs1]); |
debug("%%%s", rs_name); |
727 |
if (!no_rs1 && !no_rs2) { |
if (!no_rs1 && !no_rs2) { |
728 |
if (jmpl) |
if (jmpl) |
729 |
debug("+"); |
debug("+"); |
743 |
if ((!no_rs1 || !no_rs2) && !no_rd) |
if ((!no_rs1 || !no_rs2) && !no_rd) |
744 |
debug(","); |
debug(","); |
745 |
if (!no_rd) |
if (!no_rd) |
746 |
debug("%%%s", sparc_regnames[rd]); |
debug("%%%s", rd_name); |
747 |
break; |
break; |
748 |
|
|
749 |
case 3: debug("%s\t", sparc_loadstore_names[op2]); |
case 3: debug("%s\t", sparc_loadstore_names[op2]); |
772 |
} |
} |
773 |
|
|
774 |
|
|
775 |
|
/* |
776 |
|
* sparc_update_pstate(): |
777 |
|
* |
778 |
|
* Update the pstate register (64-bit sparcs). |
779 |
|
*/ |
780 |
|
static void sparc_update_pstate(struct cpu *cpu, uint64_t new_pstate) |
781 |
|
{ |
782 |
|
/* uint64_t old_pstate = cpu->cd.sparc.pstate; */ |
783 |
|
|
784 |
|
/* TODO: Check individual bits. */ |
785 |
|
|
786 |
|
cpu->cd.sparc.pstate = new_pstate; |
787 |
|
} |
788 |
|
|
789 |
|
|
790 |
#include "tmp_sparc_tail.c" |
#include "tmp_sparc_tail.c" |
791 |
|
|