Add a gen_int_shift_amount helper function