qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat


From: gaosong
Subject: Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat
Date: Tue, 4 Apr 2023 10:11:11 +0800
User-agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0


在 2023/4/4 上午4:13, Richard Henderson 写道:
On 4/3/23 05:55, gaosong wrote:
Hi, Richard

在 2023/4/1 下午1:03, Richard Henderson 写道:
On 3/27/23 20:06, Song Gao wrote:
+static void gen_vsat_s(unsigned vece, TCGv_vec t, TCGv_vec a, int64_t imm)
+{
+    TCGv_vec t1;
+    int64_t max  = (1l << imm) - 1;

This needed 1ull, but better to just use

    max = MAKE_64BIT_MASK(0, imm - 1);
For the signed  version use ll?
I think use MAKE_64BIT_MASK(0, imm -1 )  for the signed version is not suitable.

int64_t max = MAKE_64BIT_MASK(0, imm);
int64_t min = ~max // or -1 - max

The same problem with imm = 0,
MAKE_64BIT_MASK(0, 0) is always  0xffffffffffffffff. :-)

Thanks.
Song Gao




reply via email to

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