Related to comments to fru1tbat answer, an alternative function for detection of more than one bit set can be:
function bits_set_two_or_more(v : std_logic_vector) return std_logic is
variable one_or_more : std_logic := '0';
variable two_or_more : std_logic := '0';
begin
for i in v'range loop
if one_or_more = '0' then
one_or_more := v(i);
else -- one_or_more = '1'
two_or_more := two_or_more or v(i);
end if;
end loop;
return two_or_more;
end function;
Synthesis with Altera Quartus II (QII) to Cyclone V device with plenty of
space, is shown in the "Or" column below, where "Add > 1" column is
bits_set(v) > 1, and "N out" column is output from bits_set(v) to have a
reference for how much reduction QII does when getting the expression
bits_set(v) > 1.

The optimization for bits_set(v) > 1 is apparently a little bumpy for QII,
as shown in "Add > 1" column around 16, but QII does actually use the bits_set(v) > 1 expression to
reduce the logic instead of just doing a dumb compare.