[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Bitwise operations on bytes



Per Bothner scripsit:

> I would expect the opposite: On modern systems arithmetic (including
> bitwise operations) is effectively free, but cache misses are expensive,
> so compact data structures are what counts.

I have no dog in this fight.

> You wouldn't use a read-modify-write instruction except for "volatile"
> accesses.

I wasn't speaking of an atomic instruction, but of the fact that to set one
or more bits in a byte, you have to read the byte, modify it, and write it
back.  This is far more expensive than setting all the bits in a byte,
which is just a write.

-- 
All Gaul is divided into three parts: the part          John Cowan
that cooks with lard and goose fat, the part            http://ccil.org/~cowan
that cooks with olive oil, and the part that            cowan@x
cooks with butter. --David Chessler

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports