This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Second try at sbitmap_a_xor_b


Richard, is this okay now?

2001-07-26  Daniel Berlin  <dan@cgsoftware.com>

	* sbitmap.h: New prototype for sbitmap_a_xor_b.

	* sbitmap.c (sbitmap_a_xor_b): New function.
	#ifdef the basic block stuff so you can compile without it.

Index: sbitmap.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/sbitmap.c,v
retrieving revision 1.14
diff -c -3 -p -w -B -b -r1.14 sbitmap.c
*** sbitmap.c	2001/03/27 03:37:03	1.14
--- sbitmap.c	2001/07/27 19:00:34
*************** sbitmap_a_and_b (dst, a, b)
*** 230,235 ****
--- 230,260 ----
    return changed;
  }
  
+ /* Set DST to be (A xor B)).
+    Return non-zero if any change is made. */
+ 
+ int
+ sbitmap_a_xor_b (dst, a, b)
+      sbitmap dst, a, b;
+ {
+   unsigned int i;
+   sbitmap_ptr dstp, ap, bp;
+   int changed = 0;
+   
+   for (dstp = dst->elms, ap = a->elms, bp = b->elms, i = 0; i < dst->size;
+        i++, dstp++)
+     {
+       SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++;
+       
+       if (*dstp != tmp)
+ 	{
+ 	  changed = 1;
+ 	  *dstp = tmp;
+ 	}
+     }
+   return changed;
+ }
+ 
  /* Set DST to be (A or B)).
     Return non-zero if any change is made.  */
  
*************** sbitmap_a_and_b_or_c (dst, a, b, c)
*** 324,329 ****
--- 349,355 ----
    return changed;
  }
  
+ #ifdef IN_GCC
  /* Set the bitmap DST to the intersection of SRC of successors of
     block number BB, using the new flow graph structures.  */
  
*************** sbitmap_union_of_preds (dst, src, bb)
*** 483,488 ****
--- 509,515 ----
  	  *r++ |= *p++;
        }
  }
+ #endif
  
  /* Return number of first bit set in the bitmap, -1 if none.  */
  
Index: sbitmap.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/sbitmap.h,v
retrieving revision 1.13
diff -c -3 -p -w -B -b -r1.13 sbitmap.h
*** sbitmap.h	2001/05/26 01:31:35	1.13
--- sbitmap.h	2001/07/27 19:00:34
*************** extern int sbitmap_a_and_b_or_c		PARAMS 
*** 112,117 ****
--- 112,118 ----
  						 sbitmap));
  extern int sbitmap_a_and_b		PARAMS ((sbitmap, sbitmap, sbitmap));
  extern int sbitmap_a_or_b		PARAMS ((sbitmap, sbitmap, sbitmap));
+ extern int sbitmap_a_xor_b              PARAMS ((sbitmap, sbitmap, sbitmap));
  extern int sbitmap_a_subset_b_p		PARAMS ((sbitmap, sbitmap));
  
  extern int sbitmap_first_set_bit	PARAMS ((sbitmap));

-- 
"All the plants in my house are dead -- I shot them last night.
I was torturing them by watering them with ice cubes.
"-Steven Wright


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]