On 10/27/23 01:38, Robin Dapp wrote:
Suggested adapt codes as follows:
unsigned int element_size = GET_MODE_SIZE (mode).to_constant ();
poly_int64 nunits = exact_div (BYTES_PER_RISCV_VECTOR *TARGET_MAX_LMUL,
element_size);
if (!get_vector_mode(mode, nunits).exists(&vmode))
gcc_unreachable ();
Actually I was initially considering using lmul = m8 here,
unconditionally, but the param is probably the more intuitive choice.
Attached v2 with that included. Also moved the riscv test to
autovec/builtin/ so we can add the other builtins as well.
Also, this patch reminds me we are missing some more similiar builtin
function which can use RVV:
strlen, strcpy, strcmp...etc
Yes we should still have them but I'd rather not work on that right
now. How about I open a PR for it so we can still add them in stage 3?
Their impact is pretty localized and the risk should be low.
Kito, Palmer, Jeff - would that be acceptable?
I'd definitely like to see them get included. Those routines often have
efficient and relatively simple vector implementations.
I'd open the PR, mostly so we don't lose track of them. Whether or not
to include after stage1 closes would be done on an individual review
basis -- the deeper we get into stage3/stage4 the higher the bar would be.
What I'm keen to avoid is lots of new work going in after stage1 closes.
Jeff