Commit fcf7ca2a by Jakub Jelinek Committed by Jakub Jelinek

re PR target/55562 (FAIL: gcc.dg/sms-* on powerpc*-*-*)

	PR target/55562
	* sbitmap.c (bitmap_and, bitmap_xor, bitmap_ior): Return whether
	dst sbitmap changed even if it doesn't have popcount.

From-SVN: r194591
parent 0b81f26c
2012-12-18 Jakub Jelinek <jakub@redhat.com>
PR target/55562
* sbitmap.c (bitmap_and, bitmap_xor, bitmap_ior): Return whether
dst sbitmap changed even if it doesn't have popcount.
2012-12-18 James Greenhalgh <james.greenhalgh@arm.com> 2012-12-18 James Greenhalgh <james.greenhalgh@arm.com>
* config/aarch64/aarch64.md (insv_imm<mode>): Add modes * config/aarch64/aarch64.md (insv_imm<mode>): Add modes
...@@ -434,28 +434,26 @@ bitmap_and (sbitmap dst, const_sbitmap a, const_sbitmap b) ...@@ -434,28 +434,26 @@ bitmap_and (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms; const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL; bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount; unsigned char *popcountp = dst->popcount;
bool anychange = false; SBITMAP_ELT_TYPE changed = 0;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
const SBITMAP_ELT_TYPE tmp = *ap++ & *bp++; const SBITMAP_ELT_TYPE tmp = *ap++ & *bp++;
SBITMAP_ELT_TYPE wordchanged = *dstp ^ tmp;
if (has_popcount) if (has_popcount)
{ {
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged) if (wordchanged)
{ *popcountp = do_popcount (tmp);
*popcountp = do_popcount (tmp);
anychange = true;
}
popcountp++; popcountp++;
} }
*dstp++ = tmp; *dstp++ = tmp;
changed |= wordchanged;
} }
#ifdef BITMAP_DEBUGGING #ifdef BITMAP_DEBUGGING
if (has_popcount) if (has_popcount)
sbitmap_verify_popcount (dst); sbitmap_verify_popcount (dst);
#endif #endif
return anychange; return changed != 0;
} }
/* Set DST to be (A xor B)). /* Set DST to be (A xor B)).
...@@ -470,28 +468,26 @@ bitmap_xor (sbitmap dst, const_sbitmap a, const_sbitmap b) ...@@ -470,28 +468,26 @@ bitmap_xor (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms; const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL; bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount; unsigned char *popcountp = dst->popcount;
bool anychange = false; SBITMAP_ELT_TYPE changed = 0;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
const SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++; const SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++;
SBITMAP_ELT_TYPE wordchanged = *dstp ^ tmp;
if (has_popcount) if (has_popcount)
{ {
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged) if (wordchanged)
{ *popcountp = do_popcount (tmp);
*popcountp = do_popcount (tmp);
anychange = true;
}
popcountp++; popcountp++;
} }
*dstp++ = tmp; *dstp++ = tmp;
changed |= wordchanged;
} }
#ifdef BITMAP_DEBUGGING #ifdef BITMAP_DEBUGGING
if (has_popcount) if (has_popcount)
sbitmap_verify_popcount (dst); sbitmap_verify_popcount (dst);
#endif #endif
return anychange; return changed != 0;
} }
/* Set DST to be (A or B)). /* Set DST to be (A or B)).
...@@ -506,28 +502,26 @@ bitmap_ior (sbitmap dst, const_sbitmap a, const_sbitmap b) ...@@ -506,28 +502,26 @@ bitmap_ior (sbitmap dst, const_sbitmap a, const_sbitmap b)
const_sbitmap_ptr bp = b->elms; const_sbitmap_ptr bp = b->elms;
bool has_popcount = dst->popcount != NULL; bool has_popcount = dst->popcount != NULL;
unsigned char *popcountp = dst->popcount; unsigned char *popcountp = dst->popcount;
bool anychange = false; SBITMAP_ELT_TYPE changed = 0;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
const SBITMAP_ELT_TYPE tmp = *ap++ | *bp++; const SBITMAP_ELT_TYPE tmp = *ap++ | *bp++;
SBITMAP_ELT_TYPE wordchanged = *dstp ^ tmp;
if (has_popcount) if (has_popcount)
{ {
bool wordchanged = (*dstp ^ tmp) != 0;
if (wordchanged) if (wordchanged)
{ *popcountp = do_popcount (tmp);
*popcountp = do_popcount (tmp);
anychange = true;
}
popcountp++; popcountp++;
} }
*dstp++ = tmp; *dstp++ = tmp;
changed |= wordchanged;
} }
#ifdef BITMAP_DEBUGGING #ifdef BITMAP_DEBUGGING
if (has_popcount) if (has_popcount)
sbitmap_verify_popcount (dst); sbitmap_verify_popcount (dst);
#endif #endif
return anychange; return changed != 0;
} }
/* Return nonzero if A is a subset of B. */ /* Return nonzero if A is a subset of B. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment