I am not aware of Norm.
We have a function called PopCount in opencl which retruns number of non zero bits in the given binary number.
Please check opencl spec section 6.12.3 Integrer Functions.
I have found one which is LZCNT. There is also another BSR.
LZCNT tells the number of leading zeros.
norm(x) can be written as LZCNT(a,x)-1. This is as per the amd doc of general purpose and system instructions.
Also, one can use builtin_clz function of gcc to get leading zeros count, if you are writing code in C
Thanks for posting back your findings. It sure is going to help someone someday...
btw.. Will "LZCNT" work with -ve numbers. Since -ve numbers are nothing but 2's complement, there will be no leading zeroes mostly....That will give you 0 and subtracting 1 will give you -1.. oops... Or.. Did I misunderstand something here?
Is LZCNT sign aware?