AVX-512: Fix match function to check the range of registers