qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] PowerPC CPU tester


From: Gwenole Beauchesne
Subject: [Qemu-devel] PowerPC CPU tester
Date: Tue, 2 Dec 2003 16:13:37 +0100 (CET)

Hi,

I have finally glued QEMU to my test engine. Extra patches to QEMU core
are appended below.

You can find the files here:
<http://gwenole.beauchesne.free.fr/kheperix/>
* test-powerpc.cpp
* kheperix-0.2-ppc-results.dat.bz2: results file for non PPC platforms

The tester is old but covers around 690K variations (1.3M nowadays):
154656 errors out of 689408 tests

Most of them are due to miscalculation of the overflow flag. "neg" is 
probably mis-decoded thus not handling CR or XER updates. Should be pretty 
simple to fix.

Hope this helps.

Index: cpu-all.h
===================================================================
RCS file: /cvsroot/qemu/qemu/cpu-all.h,v
retrieving revision 1.14
diff -u -r1.14 cpu-all.h
--- cpu-all.h   23 Nov 2003 17:05:30 -0000      1.14
+++ cpu-all.h   2 Dec 2003 14:50:19 -0000
@@ -213,7 +213,7 @@
 {
     uint32_t a,b;
     a = ldl_raw(ptr);
-    b = ldl_raw(ptr+4);
+    b = ldl_raw((uint8_t *)ptr+4);
     return (((uint64_t)a<<32)|b);
 }
 
@@ -236,7 +236,7 @@
 static inline void stq_raw(void *ptr, uint64_t v)
 {
     stl_raw(ptr, v);
-    stl_raw(ptr+4, v >> 32);
+    stl_raw((uint8_t *)ptr+4, v >> 32);
 }
 
 #else
Index: target-ppc/cpu.h
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/cpu.h,v
retrieving revision 1.2
diff -u -r1.2 cpu.h
--- target-ppc/cpu.h    23 Nov 2003 16:58:07 -0000      1.2
+++ target-ppc/cpu.h    2 Dec 2003 14:50:19 -0000
@@ -29,7 +29,7 @@
 /* 8 to 32 bits */
 static inline int32_t s_ext8 (uint8_t value)
 {
-    int8_t *tmp = &value;
+    int8_t *tmp = (int8_t *)&value;
 
     return *tmp;
 }
@@ -37,7 +37,7 @@
 /* 16 to 32 bits */
 static inline int32_t s_ext16 (uint16_t value)
 {
-    int16_t *tmp = &value;
+    int16_t *tmp = (int16_t *)&value;
 
     return *tmp;
 }
@@ -46,7 +46,7 @@
 static inline int32_t s_ext24 (uint32_t value)
 {
     uint16_t utmp = (value >> 8) & 0xFFFF;
-    int16_t *tmp = &utmp;
+    int16_t *tmp = (int16_t *)&utmp;
 
     return (*tmp << 8) | (value & 0xFF);
 }
Index: target-ppc/translate.c
===================================================================
RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v
retrieving revision 1.2
diff -u -r1.2 translate.c
--- target-ppc/translate.c      23 Nov 2003 16:58:08 -0000      1.2
+++ target-ppc/translate.c      2 Dec 2003 14:50:20 -0000
@@ -22,6 +22,7 @@
 #include "exec.h"
 #include "disas.h"
 
+#define DO_EXEC_RETURN
 //#define DO_SINGLE_STEP
 //#define DO_STEP_FLUSH
 
@@ -2336,6 +2337,12 @@
                 handler = table[opc3(ctx.opcode)];
             }
         }
+#ifdef DO_EXEC_RETURN
+               if (ctx.opcode == 0x18000000) {
+                 gen_op_raise_exception(EXCP_HLT);
+                 break;
+               }
+#endif
         /* Is opcode *REALLY* valid ? */
         if ((ctx.opcode & handler->inval) != 0) {
             if (loglevel > 0) {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]