Bernd Schmidt schrieb: > Several processors have a "count redundant sign bits" instruction: > > * SIGNBITS on Blackfin > * NORM on C6X > * SBC, apparently, on picochip > > and probably others. For example, for a value of 0 or -1, it returns 31, > while e.g. an input 0xc0000000 produces 1. > > Other compilers tend to define builtin functions called "norm" for this, > and the operation is used in some DSP benchmarks. The patch below adds a > __builtin_clrsb family of functions, similar to __builtin_clz. I'm open > to suggestions about the name; I don't particularly like "norm" but > maybe that's what users expect.
Some call it cls "count leading signs". A clrxx reminds me rather of "clear xx". Johann > > Bernd >