lkml.org 
[lkml]   [2004]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mask ADT: bitmap and bitop tweaks [1/22]
On Mon, Mar 29, 2004 at 03:06:16PM -0800, Matthew Dobson wrote:
> Do we need to check the last word specially? If we're assuming that the
> unused bits are 0's, then they can't affect the check, right? If we're
> not assuming the unused bits are 0's, then we need to do this last word
> special casing in bitmap_xor & bitmap_andnot, because they could set the
> unused bits. Or am I confused?

No, not those two. xor of 0's is 0 again. and of 0 and anything is 0 again.
xornot and ornot would need those checks if implemented.


On Mon, Mar 29, 2004 at 03:06:16PM -0800, Matthew Dobson wrote:
> Same comments here, both the double ';' and the last word special
> casing...
> Looking ahead, patch 2/22 specifically states that we assume all our
> input masks have the high/unused bits cleared and we promise not to set
> them. So we shouldn't need the last word special casing in
> bitmap_intersect & bitmap_subset... I think. ;)

It looks like Paul wants those invariants. Which is fine; I can do things
on behalf of users, or stand back and let them do things themselves.

You're right that intersection (and) and subset (andnot) shouldn't require
any special cases for the final word.


-- wli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:1.304 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site