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: Richard Henderson
Subject: Re: [RFC PATCH v2 18/44] target/loongarch: Implement vsat
Date: Wed, 19 Apr 2023 13:06:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

On 4/19/23 11:31, Song Gao wrote:
在 2023/4/1 下午1:03, Richard Henderson 写道:
Better to expand imm to max here, rather than both inside gen_vsat_s and the runtime do_vsats_*.

Likewise for the unsigned versions.

I tried to expand imm to max  here  for the unsigned versions.

{

     uint64_t max;

     ...

     static const GVecGen2i op[4] = {
         {
             //.fniv = gen_vsat_u,
             .fnoi = gen_helper_vsat_bu,
             .opt_opc = vecop_list,
             .vece = MO_8
         },
         {
             //.fniv = gen_vsat_u,
             .fnoi = gen_helper_vsat_hu,
             .opt_opc = vecop_list,
             .vece = MO_16
         },
         {
             //.fniv = gen_vsat_u,
             .fnoi = gen_helper_vsat_wu,
             .opt_opc = vecop_list,
             .vece = MO_32
         },
         {
             //.fniv = gen_vsat_u,
             .fnoi = gen_helper_vsat_du,
             .opt_opc = vecop_list,
             .vece = MO_64
         },
     };

     max = (imm == 0x3f) ? UINT64_MAX : (1ull << (imm + 1)) - 1;
     tcg_gen_gvec_2i(vd_ofs, vj_ofs, oprsz, maxsz, max, &op[vece]);

}


and  I got a tcg_debug_assert();


Thread 1 "qemu-loongarch6" received signal SIGABRT, Aborted.
0x00007ffff60b337f in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff60b337f in raise () from /lib64/libc.so.6
#1  0x00007ffff609ddb5 in abort () from /lib64/libc.so.6
#2  0x00007ffff609dc89 in __assert_fail_base.cold.0 () from /lib64/libc.so.6
#3  0x00007ffff60aba76 in __assert_fail () from /lib64/libc.so.6
#4  0x0000555555632fcf in simd_desc (oprsz=16, maxsz=16, data=134217727) at ../tcg/tcg-op-gvec.c:91

You should use tcg_gen_gvec_2s, and pass tcg_constant_i64(max).


r~



reply via email to

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