Commit 0cadcbbe6595e77ef50c5f50a2f064a37f3da698

Authored by aurel32
1 parent 5bf06a95

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

(Jocelyn Mayer)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5380 c046a42c-6fe2-441c-8c8c-71466251a162
target-ppc/op.c
... ... @@ -640,8 +640,6 @@ void OPPROTO op_add_me (void)
640 640 T0 += xer_ca + (-1);
641 641 if (likely((uint32_t)T1 != 0))
642 642 xer_ca = 1;
643   - else
644   - xer_ca = 0;
645 643 RETURN();
646 644 }
647 645  
... ... @@ -651,8 +649,6 @@ void OPPROTO op_add_me_64 (void)
651 649 T0 += xer_ca + (-1);
652 650 if (likely((uint64_t)T1 != 0))
653 651 xer_ca = 1;
654   - else
655   - xer_ca = 0;
656 652 RETURN();
657 653 }
658 654 #endif
... ... @@ -930,8 +926,6 @@ void OPPROTO op_subfme (void)
930 926 T0 = ~T0 + xer_ca - 1;
931 927 if (likely((uint32_t)T0 != UINT32_MAX))
932 928 xer_ca = 1;
933   - else
934   - xer_ca = 0;
935 929 RETURN();
936 930 }
937 931  
... ... @@ -941,8 +935,6 @@ void OPPROTO op_subfme_64 (void)
941 935 T0 = ~T0 + xer_ca - 1;
942 936 if (likely((uint64_t)T0 != UINT64_MAX))
943 937 xer_ca = 1;
944   - else
945   - xer_ca = 0;
946 938 RETURN();
947 939 }
948 940 #endif
... ...
target-ppc/op_helper.c
... ... @@ -151,10 +151,8 @@ void do_addmeo (void)
151 151 T0 += xer_ca + (-1);
152 152 xer_ov = ((uint32_t)T1 & ((uint32_t)T1 ^ (uint32_t)T0)) >> 31;
153 153 xer_so |= xer_ov;
154   - if (likely(T1 != 0))
  154 + if (likely((uint32_t)T1 != 0))
155 155 xer_ca = 1;
156   - else
157   - xer_ca = 0;
158 156 }
159 157  
160 158 #if defined(TARGET_PPC64)
... ... @@ -164,10 +162,8 @@ void do_addmeo_64 (void)
164 162 T0 += xer_ca + (-1);
165 163 xer_ov = ((uint64_t)T1 & ((uint64_t)T1 ^ (uint64_t)T0)) >> 63;
166 164 xer_so |= xer_ov;
167   - if (likely(T1 != 0))
  165 + if (likely((uint64_t)T1 != 0))
168 166 xer_ca = 1;
169   - else
170   - xer_ca = 0;
171 167 }
172 168 #endif
173 169  
... ... @@ -312,8 +308,6 @@ void do_subfmeo (void)
312 308 xer_so |= xer_ov;
313 309 if (likely((uint32_t)T1 != UINT32_MAX))
314 310 xer_ca = 1;
315   - else
316   - xer_ca = 0;
317 311 }
318 312  
319 313 #if defined(TARGET_PPC64)
... ... @@ -325,8 +319,6 @@ void do_subfmeo_64 (void)
325 319 xer_so |= xer_ov;
326 320 if (likely((uint64_t)T1 != UINT64_MAX))
327 321 xer_ca = 1;
328   - else
329   - xer_ca = 0;
330 322 }
331 323 #endif
332 324  
... ...