[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: [PATCH v2] disas/riscv.c: rvv: Add disas support for vector inst
From: |
刘阳 |
Subject: |
Re: Re: [PATCH v2] disas/riscv.c: rvv: Add disas support for vector instructions |
Date: |
Wed, 28 Sep 2022 13:22:13 +0800 (GMT+08:00) |
> -----Original Messages-----
> From: "Alistair Francis" <alistair23@gmail.com>
> Sent Time: 2022-09-27 09:57:39 (Tuesday)
> To: "Yang Liu" <liuyang22@iscas.ac.cn>
> Cc: "Palmer Dabbelt" <palmer@dabbelt.com>, "Alistair Francis"
<alistair.francis@wdc.com>, "Bin Meng" <bin.meng@windriver.com>, "Tommy Wu"
<tommy.wu@sifive.com>, "open list:RISC-V" <qemu-riscv@nongnu.org>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>, wangjunqiang
<wangjunqiang@iscas.ac.cn>, "Wei Wu (吴伟)" <lazyparser@gmail.com>, liweiwei
<liweiwei@iscas.ac.cn>
> Subject: Re: [PATCH v2] disas/riscv.c: rvv: Add disas support for vector
instructions
>
> On Fri, Sep 23, 2022 at 2:27 PM Alistair Francis <alistair23@gmail.com>
wrote:
> >
> > On Fri, Aug 26, 2022 at 1:26 PM Yang Liu <liuyang22@iscas.ac.cn>
wrote:
> > >
> > > Tested with https://github.com/ksco/rvv-decoder-tests
> > >
> > > Expected checkpatch errors for consistency and brevity reasons:
> > >
> > > ERROR: line over 90 characters
> > > ERROR: trailing statements should be on next line
> > > ERROR: braces {} are necessary for all arms of this statement
> > >
> > > Signed-off-by: Yang Liu <liuyang22@iscas.ac.cn>
> >
> > Thanks!
> >
> > Applied to riscv-to-apply.next
>
> This patch fails to build with this error:
>
> ../disas/riscv.c: In function 'print_insn_riscv':
> ../disas/riscv.c:4513:30: error: '__builtin___sprintf_chk' may write a
> terminating nul past the end of the destination
> [-Werror=format-overflow=]
> 4513 | sprintf(nbuf, "%d", sew);
> | ^
> In file included from /usr/include/stdio.h:906,
> from
>
/scratch/jenkins-tmp/workspace/QEMU-Multi-Config-Build/BUILD_OPTIONS/GCC/include/qemu/osdep.h:97,
> from ../disas/riscv.c:20:
> In function 'sprintf',
> inlined from 'format_inst' at ../disas/riscv.c:4513:13,
> inlined from 'disasm_inst' at ../disas/riscv.c:4640:5,
> inlined from 'print_insn_riscv' at ../disas/riscv.c:4690:5:
> /usr/include/bits/stdio2.h:30:10: note: '__builtin___sprintf_chk'
> output between 2 and 5 bytes into a destination of size 4
> 30 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 31 | __glibc_objsize (__s), __fmt,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 32 | __va_arg_pack ());
> | ~~~~~~~~~~~~~~~~~
>
>
> Alistair
>
Thanks for the review, I've submitted a v3 patch.
Yang
> > > decode_inst_operands(&dec);
> > > decode_inst_decompress(&dec, isa);
> > > decode_inst_lift_pseudo(&dec);
> > > - format_inst(buf, buflen, 16, &dec);
> > > + format_inst(buf, buflen, 24, &dec);
> > > }
> > >
> > > #define INST_FMT_2 "%04" PRIx64 " "
> > > --
> > > 2.30.1 (Apple Git-130)
> > >
> > >
</liuyang22@iscas.ac.cn></liuyang22@iscas.ac.cn></alistair23@gmail.com></liweiwei@iscas.ac.cn></lazyparser@gmail.com></wangjunqiang@iscas.ac.cn></qemu-devel@nongnu.org></qemu-riscv@nongnu.org></tommy.wu@sifive.com></bin.meng@windriver.com></alistair.francis@wdc.com></palmer@dabbelt.com></liuyang22@iscas.ac.cn></alistair23@gmail.com>