On 3/14/20 1:14 AM, Richard Henderson wrote:
> I think you should have 4 versions of aadd8, for each of the rounding modes,
> 
>> +RVVCALL(OPIVV2_ENV, vaadd_vv_b, OP_SSS_B, H1, H1, H1, aadd8)
> 
> then use this, or something like it, to define 4 functions containing main
> loops, which will get the helper above inlined.

Alternately, a set of inlines, where a (constant) vxrm is passed down from 
above.

> Then use a final outermost wrapper to select one of the 4 functions based on
> env->vxrm.

The outermost wrapper could look like

    switch (env->vxrm) {
    case 0:  somefunc(some, args, 0); break;
    case 1:  somefunc(some, args, 1); break;
    case 2:  somefunc(some, args, 2); break;
    default: somefunc(some, args, 3); break;
    }

so that somefunc (and its subroutines) are expanded with a constant, and we
switch on that constant at the outermost level.


r~

Reply via email to