riscv: add compile-time test into is_compat_task()