Skip to contentSkip to conversation

[5380] target-ppc: fix computation of XER.{CA, OV} in addme, subfme

Qemu-devel Aurelien Jarno 2 participants 5 messages Oct 1, 2008 – Oct 2, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5380

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5380
Author:   aurel32
Date:     2008-10-01 21:45:37 +0000 (Wed, 01 Oct 2008)

Log Message:
-----------
target-ppc: fix computation of XER.{CA, OV} in addme, subfme

(Jocelyn Mayer)

Modified Paths:
--------------
trunk/target-ppc/op.c
trunk/target-ppc/op_helper.c

Modified: trunk/target-ppc/op.c
===================================================================

target-ppc/op.c +0 -8
@@ -640,8 +640,6 @@
     T0 += xer_ca + (-1);
     if (likely((uint32_t)T1 != 0))
         xer_ca = 1;
-    else
-        xer_ca = 0;
     RETURN();
 }
 
@@ -651,8 +649,6 @@
     T0 += xer_ca + (-1);
     if (likely((uint64_t)T1 != 0))
         xer_ca = 1;
-    else
-        xer_ca = 0;
     RETURN();
 }
 #endif
@@ -930,8 +926,6 @@
     T0 = ~T0 + xer_ca - 1;
     if (likely((uint32_t)T0 != UINT32_MAX))
         xer_ca = 1;
-    else
-        xer_ca = 0;
     RETURN();
 }
 
@@ -941,8 +935,6 @@
     T0 = ~T0 + xer_ca - 1;
     if (likely((uint64_t)T0 != UINT64_MAX))
         xer_ca = 1;
-    else
-        xer_ca = 0;
     RETURN();
 }
 #endif

Modified: trunk/target-ppc/op_helper.c
===================================================================

target-ppc/op_helper.c +2 -10
@@ -151,10 +151,8 @@
     T0 += xer_ca + (-1);
     xer_ov = ((uint32_t)T1 & ((uint32_t)T1 ^ (uint32_t)T0)) >> 31;
     xer_so |= xer_ov;
-    if (likely(T1 != 0))
+    if (likely((uint32_t)T1 != 0))
         xer_ca = 1;
-    else
-        xer_ca = 0;
 }
 
 #if defined(TARGET_PPC64)
@@ -164,10 +162,8 @@
     T0 += xer_ca + (-1);
     xer_ov = ((uint64_t)T1 & ((uint64_t)T1 ^ (uint64_t)T0)) >> 63;
     xer_so |= xer_ov;
-    if (likely(T1 != 0))
+    if (likely((uint64_t)T1 != 0))
         xer_ca = 1;
-    else
-        xer_ca = 0;
 }
 #endif
 
@@ -312,8 +308,6 @@
     xer_so |= xer_ov;
     if (likely((uint32_t)T1 != UINT32_MAX))
         xer_ca = 1;
-    else
-        xer_ca = 0;
 }
 
 #if defined(TARGET_PPC64)
@@ -325,8 +319,6 @@
     xer_so |= xer_ov;
     if (likely((uint64_t)T1 != UINT64_MAX))
         xer_ca = 1;
-    else
-        xer_ca = 0;
 }
 #endif
 
#1 lore raw

Re: [Qemu-devel] target-ppc: does not compile anymore

not sure, which change it was. But now I get both on x86_64 or i586 host, opensuse 11.0, a compile error:

gcc -O2 -g -fno-strict-aliasing -Wall -Wundef -Wendif-labels -Wwrite-strings -fno-reorder-blocks -fno-gcse -fno-tree-ch -fno-optimize-sibling-calls -fno-crossjumping -fno-align-labels -fno-align-jumps -fno-align-functions -fno-section-anchors -mpreferred-stack-boundary=2 -fomit-frame-pointer -m32 -I. -I.. -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc -I/usr/src/packages/BUILD/qemu-0.9.2svn5391 -MMD -MT op.o -MP -DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg/i386 -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/fpu -DHAS_AUDIO -DHAS_AUDIO_CHOICE -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/slirp -c -o op.o /usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc/op.c ../dyngen -c -o dyngen-opc.h op.o
dyngen: ret or jmp expected at the end of op_divw
make[1]: *** [dyngen-opc.h] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/qemu-0.9.2svn5391/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

#2 lore raw

Re: [Qemu-devel] target-ppc: does not compile anymore

Quoted 16 lines · Martin Mohring

not sure, which change it was. But now I get both on x86_64 or i586 host, opensuse 11.0, a compile error:

gcc -O2 -g -fno-strict-aliasing -Wall -Wundef -Wendif-labels

(quoted diff) +0 -12
-Wwrite-strings  -fno-reorder-blocks  -fno-gcse  -fno-tree-ch 
-fno-optimize-sibling-calls  -fno-crossjumping  -fno-align-labels 
-fno-align-jumps  -fno-align-functions  -fno-section-anchors
-mpreferred-stack-boundary=2 -fomit-frame-pointer  -m32 -I. -I..
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391 -MMD -MT op.o -MP
-DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg/i386
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/fpu  -DHAS_AUDIO
-DHAS_AUDIO_CHOICE -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/slirp  -c
-o op.o /usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc/op.c
Quoted 8 lines

../dyngen -c -o dyngen-opc.h op.o
dyngen: ret or jmp expected at the end of op_divw make[1]: *** [dyngen-opc.h] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/qemu-0.9.2svn5391/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

Some additional Information that you might need (for opensuse 11.0)
- gcc is version 4.3.1
- kernel headers is version 2.6.25
- glibc is based on version 2.8

#3 lore raw

Re: [Qemu-devel] target-ppc: does not compile anymore

Quoted 19 lines · Martin Mohring
Quoted 18 lines · Martin Mohring

not sure, which change it was. But now I get both on x86_64 or i586 host, opensuse 11.0, a compile error:

gcc -O2 -g -fno-strict-aliasing -Wall -Wundef -Wendif-labels

(quoted diff) +0 -12
-Wwrite-strings  -fno-reorder-blocks  -fno-gcse  -fno-tree-ch 
-fno-optimize-sibling-calls  -fno-crossjumping  -fno-align-labels 
-fno-align-jumps  -fno-align-functions  -fno-section-anchors
-mpreferred-stack-boundary=2 -fomit-frame-pointer  -m32 -I. -I..
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391 -MMD -MT op.o -MP
-DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg/i386
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/fpu  -DHAS_AUDIO
-DHAS_AUDIO_CHOICE -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/slirp  -c
-o op.o /usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc/op.c

../dyngen -c -o dyngen-opc.h op.o
dyngen: ret or jmp expected at the end of op_divw

Quoted 8 lines
Quoted 6 lines

make[1]: *** [dyngen-opc.h] Error 1
make[1]: Leaving directory `/usr/src/packages/BUILD/qemu-0.9.2svn5391/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

Some additional Information that you might need (for opensuse 11.0)
- gcc is version 4.3.1

You need gcc 3.4 to compile the ppc target which still use dyngen.

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
#4 lore raw

Re: [Qemu-devel] target-ppc: does not compile anymore

Quoted 33 lines · Aurelien Jarno
Quoted 21 lines · Martin Mohring
Quoted 19 lines · Martin Mohring

not sure, which change it was. But now I get both on x86_64 or i586 host, opensuse 11.0, a compile error:

gcc -O2 -g -fno-strict-aliasing -Wall -Wundef -Wendif-labels

(quoted diff) +0 -12
-Wwrite-strings  -fno-reorder-blocks  -fno-gcse  -fno-tree-ch 
-fno-optimize-sibling-calls  -fno-crossjumping  -fno-align-labels 
-fno-align-jumps  -fno-align-functions  -fno-section-anchors
-mpreferred-stack-boundary=2 -fomit-frame-pointer  -m32 -I. -I..
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391 -MMD -MT op.o -MP
-DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/tcg/i386
-I/usr/src/packages/BUILD/qemu-0.9.2svn5391/fpu  -DHAS_AUDIO
-DHAS_AUDIO_CHOICE -I/usr/src/packages/BUILD/qemu-0.9.2svn5391/slirp  -c
-o op.o /usr/src/packages/BUILD/qemu-0.9.2svn5391/target-ppc/op.c

../dyngen -c -o dyngen-opc.h op.o
dyngen: ret or jmp expected at the end of op_divw
make[1]: *** [dyngen-opc.h] Error 1

Quoted 9 lines
Quoted 6 lines

make[1]: Leaving directory `/usr/src/packages/BUILD/qemu-0.9.2svn5391/ppc-softmmu'
make: *** [subdir-ppc-softmmu] Error 2

Some additional Information that you might need (for opensuse 11.0)
- gcc is version 4.3.1

Quoted 4 lines

You need gcc 3.4 to compile the ppc target which still use dyngen.

You are right.

I suppress from my mind from time to time that ppc still does not use tcg. You remind me why I still keep a copy of the old 3.x gcc compiler to build the ppc qemu user mode.