On 3/12/20 7:58 AM, LIU Zhiwei wrote:
> +/* Vector Single-Width Fractional Multiply with Rounding and Saturation */
> +static inline int8_t vsmul8(CPURISCVState *env, int8_t a, int8_t b)
> +{
> + uint8_t round;
> + int16_t res;
> +
> + res = (int16_t)a * (int16_t)b;
> + round = get_round(env, res, 7);
> + res = (res >> 7) + round;
> +
> + if (res > INT8_MAX) {
> + env->vxsat = 0x1;
> + return INT8_MAX;
> + } else if (res < INT8_MIN) {
> + env->vxsat = 0x1;
> + return INT8_MIN;
> + } else {
> + return res;
> + }
> +}
> +static int16_t vsmul16(CPURISCVState *env, int16_t a, int16_t b)
With the same caveat for vxrm as before. Oh, and watch the spacing between
these functions. I noticed before but didn't mention.
r~