Is there an efficient way to implement the signum function efficiently using compiler intrinsics on the C2000 family?
Assuming x is a 16 bit signed int.
sgn(x) = 1 if x>0, -1 if x<0, and 0 if x=0
Using if statements results in slow code due to the branches/pipeline hits ect.
I'm assuing there is a very clever way to implement this using the sign bit or a right shift with sign extend by 15.