[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 28/60] target/riscv: vector narrowing fixed-point clip ins
From: |
Richard Henderson |
Subject: |
Re: [PATCH v5 28/60] target/riscv: vector narrowing fixed-point clip instructions |
Date: |
Sat, 14 Mar 2020 01:36:09 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/12/20 7:58 AM, LIU Zhiwei wrote:
> +static int8_t vnclip8(CPURISCVState *env, int16_t a, int8_t b)
> +{
> + uint8_t round, shift = b & 0xf;
> + int16_t res;
> +
> + round = get_round(env, a, shift);
> + res = (a >> shift) + 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 vnclip16(CPURISCVState *env, int32_t a, int16_t b)
Likewise.
r~
- Re: [PATCH v5 24/60] target/riscv: vector single-width averaging add and subtract, (continued)
[PATCH v5 25/60] target/riscv: vector single-width fractional multiply with rounding and saturation, LIU Zhiwei, 2020/03/12
[PATCH v5 26/60] target/riscv: vector widening saturating scaled multiply-add, LIU Zhiwei, 2020/03/12
[PATCH v5 27/60] target/riscv: vector single-width scaling shift instructions, LIU Zhiwei, 2020/03/12
[PATCH v5 28/60] target/riscv: vector narrowing fixed-point clip instructions, LIU Zhiwei, 2020/03/12
- Re: [PATCH v5 28/60] target/riscv: vector narrowing fixed-point clip instructions,
Richard Henderson <=
[PATCH v5 29/60] target/riscv: vector single-width floating-point add/subtract instructions, LIU Zhiwei, 2020/03/12
[PATCH v5 30/60] target/riscv: vector widening floating-point add/subtract instructions, LIU Zhiwei, 2020/03/12
[PATCH v5 31/60] target/riscv: vector single-width floating-point multiply/divide instructions, LIU Zhiwei, 2020/03/12
[PATCH v5 32/60] target/riscv: vector widening floating-point multiply, LIU Zhiwei, 2020/03/12
[PATCH v5 33/60] target/riscv: vector single-width floating-point fused multiply-add instructions, LIU Zhiwei, 2020/03/12