nir: add auxiliary functions to detect if a mode is enabled