there are two methods:
1.) use a process with a for loop. modern synthesis tools will pick this up as a priority encoder with the last matching condition being the chosen condition. this is typically the most readable and the better option. recall that multiple assignments (blocking or non-blocking) will favor the last assignment. The for loop can easily be set to iterate in the same direction or opposite direction as the vector.
2.) use an arithmetic operation with logic like -x and x. (you may need to bit-reverse the vector based on which direction you want the inductive property to work). This method is not as readable, but infers an adder. This makes the operation itself very fast, but also makes the implementation very localized. When the conditions themselves come from other logic, this will result in a placement bottleneck and a potentially slower design due to the hidden and hard to control routing cost.
for #2:
if x = 0010100
-x = 1101100
-x and x = 0000100
the priority is given to the rightmost bit.