1 Apr 2007 02:14
[PATCH][SPARC] RDASR and WRASR instructions on SPARCv8
Aurelien Jarno <aurelien <at> aurel32.net>
2007-04-01 00:14:18 GMT
2007-04-01 00:14:18 GMT
Hi all,
The SPARCv8 RDASR and WRASR instructions currently generate an
illegal_instruction trap for rs1 != 0, whereas the SPARCv8
manual explicitely says that an rs1 value of 1...14 in an RDASR
instruction produces undefined results, but does not cause an
illegal_instruction trap. The same applies for WRASR.
The patch below fixes the current implementation by doing the
same thing as the microSPARC II CPU, ie reading the y register
in all cases for the RDASR instruction, and doing a NOP when
rs1 != 0 for the WRASR instruction.
Bye,
Aurelien
Index: target-sparc/translate.c
===================================================================
RCS file: /sources/qemu/qemu/target-sparc/translate.c,v
retrieving revision 1.38
diff -u -d -p -r1.38 translate.c
--- target-sparc/translate.c 25 Mar 2007 07:55:52 -0000 1.38
+++ target-sparc/translate.c 31 Mar 2007 23:52:18 -0000
<at> <at> -1130,11 +1130,14 <at> <at> static void disas_sparc_insn(DisasContex
rs1 = GET_FIELD(insn, 13, 17);
switch(rs1) {
case 0: /* rdy */
+#ifndef TARGET_SPARC64
+ case 0x01 ... 0x0e: /* undefined in the SPARCv8 manual, rdy on the microSPARC II */
+ case 0x0f: /* stbar in the SPARCv8 manual, rdy on the microSPARC II */
(Continue reading)
RSS Feed