|
From: | Richard Henderson |
Subject: | Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat |
Date: | Mon, 3 Apr 2023 20:46:51 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 |
On 4/3/23 19:11, gaosong wrote:
在 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 usemax = 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 - maxThe same problem with imm = 0, MAKE_64BIT_MASK(0, 0) is always 0xffffffffffffffff. :-)
Huh. Well that's a bug. r~
[Prev in Thread] | Current Thread | [Next in Thread] |