Do you mean : /* We need to use precomputed mask for such situation and such mask can only be computed in compile-time known size modes. */ bool indices_fit_selector_p = GET_MODE_BITSIZE (GET_MODE_INNER (vmode)) > 8 || known_lt (vec_len, 256); if (!indices_fit_selector_p && !vec_len.is_constant ()) return false;
juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-12-15 20:44 To: juzhe.zh...@rivai.ai; gcc-patches CC: rdapp.gcc; kito.cheng; Kito.cheng; jeffreyalaw Subject: Re: [PATCH] RISC-V: Fix vmerge optimization bug in vec_perm vectorization > Oh. I think it should be renamed into not_fit. > > Is this following make sense to you ? > > /* We need to use precomputed mask for such situation and such mask > can only be computed in compile-time known size modes. */ > bool indices_not_fit_selector_p > = maybe_ge (vec_len, 2 << GET_MODE_BITSIZE (GET_MODE_INNER (vmode))); > if (GET_MODE_BITSIZE (GET_MODE_INNER (vmode)) == 8 > && indices_not_fit_selector_p > && !vec_len.is_constant ()) > return false; Mhm, right, I don't think this makes it nicer overall. Maybe just like the following then: bool ..._p = GET_MODE_BITSIZE (GET_MODE_INNER (vmode)) > 8 || known_lt (vec_len, 256); if (!..._p && !vec_len.is_constant ()) then later if (..._p) ... else ... Regards Robin