On Thu, Jun 25, 2015 at 09:24:20AM -0700, Jesse Gross wrote: > On Wed, Jun 24, 2015 at 7:09 PM, Ben Pfaff <b...@nicira.com> wrote: > > On Wed, Jun 24, 2015 at 06:34:05PM -0700, Jesse Gross wrote: > >> On Wed, Jun 24, 2015 at 3:57 PM, Ben Pfaff <b...@nicira.com> wrote: > >> > On Fri, Jun 19, 2015 at 04:13:24PM -0700, Jesse Gross wrote: > >> > I like the implementation approach used in ULONG_FOR_EACH_1 better than > >> > the one in PRESENT_OPT_FOR_EACH, since the user doesn't have to provide > >> > a scratch variable. Also it protects the macro arguments better. > >> > Actually ULONG_FOR_EACH_1 could be made to work with 32- or 64-bit maps > >> > just by changing "unsigned long" to "uint64_t" in its definition; maybe > >> > we should. > >> > >> I looked at converting ULONG_FOR_EACH_1 but decided against it since > >> it would introduce an additional branch (to decide whether to use > >> __builtin_ctz or __builtin_ctz_ll) > > > > Really? It shouldn't, "__builtin_constant_p(n <= UINT32_MAX) && n <= > > UINT32_MAX" should be a compile-time constant.\ > > You're right, it doesn't. I guess I didn't have enough faith that the > compiler would be able to carry over the max value across an > assignment to a larger variable but I checked and it was fine. I sent > a patch to do it this way instead.
Thanks. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev