qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 17/60] target/riscv: vector single-width integer multiply


From: Richard Henderson
Subject: Re: [PATCH v5 17/60] target/riscv: vector single-width integer multiply instructions
Date: Fri, 13 Mar 2020 23:52:51 -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 int64_t do_mulhsu_d(int64_t s2, uint64_t s1)
> +{
> +    uint64_t hi_64, lo_64, abs_s2 = s2;
> +
> +    if (s2 < 0) {
> +        abs_s2 = -s2;
> +    }
> +    mulu64(&lo_64, &hi_64, abs_s2, s1);
> +    if ((int64_t)(s2 ^ s1) < 0) {

Why would the sign of s1 be relevant?
It's always unsigned.

We have code for this in e.g. tcg_gen_mulsu2_i64

    mulu4(&lo, &hi, s1, s2);
    if ((int64_t)s2 < 0) {
        hi -= s2;
    }


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]