On 01.05.13 22:35, Sampo Syreeni wrote: > So, how do you go about systematically and portably implementing what > you would expect from your logical operations, using standard C > operations, without knowing the basic width of your types? (Logical, not > arithmetic) right shifts of signed quantities, efficient parity, and > computed shifts with negative offsets are proving particularly nasty at > the moment. (It has to do with dithering at arbitrary word length which > also has to be reasonably efficient if any set in silicon.)
I have no concrete advice to offer, but when faced with bit twiddling problems of my own I tend to reach for the book "Hacker's Delight" which also has a companion website: http://www.hackersdelight.org On the odd chance that you don't already know it, maybe the book or links from the website may help with your particular task. Thomas -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://music.columbia.edu/cmc/music-dsp http://music.columbia.edu/mailman/listinfo/music-dsp