/* TODO: We set RVV instruction cost as 1 by default. Cost Model need to be well analyzed and supported in the future. */ + int cost_val = 1; + enum rtx_code rcode = GET_CODE (x); + + /* Aka (vec_duplicate:RVVM1DI (reg/v:DI 143 [ x ])) */ + if (rcode == VEC_DUPLICATE && SCALAR_INT_MODE_P (GET_MODE (XEXP (x, 0)))) + cost_val += get_vector_costs ()->regmove->GR2VR; + + *total = COSTS_N_INSNS (cost_val); + + return true; +}
I first read this wrong and thought we'd use GR2VR costs literally. IMHO the costing makes sense like now.
The only thing I think we want for the patch (as Pan also raised last time) is the param to set those .vx costs to zero in order to ensure the tests test the right thing (--param=vx_preferred/gr2vr_cost or something).
According to patchwork the tests you add pass but shouldn't they actually fail with a GR2VR cost of 2? I must be missing something.
-- Regards Robin