[PATCH] D124825: [LoongArch] Check msb is not less than lsb for the bstr{ins/pick}.{w/d} instructions

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 05:35:30 PDT 2022


SixWeining added a comment.

In D124825#3487869 <https://reviews.llvm.org/D124825#3487869>, @xry111 wrote:

> It seems the CI failed with some tests TIMEOUT.  Maybe we need to adjust the test timeout for the CI.
>
> LoongArch ISA reference manual <https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_bstrins_wd> has not specified the behavior of bstrins/bstrpick with msb < lsb.  Should the manual be updated too?

Right, the manual doesn’t specify it explicitly. But I think it’s an obvious implication by the instruction explanation. For example:
BSTRINS.W:

  bstr32[31:msbw+1] = GR[rd][31: msbw+1]
  bstr32[msbw:lsbw] = GR[rj][msbw-lsbw:0]
  bstr32[lsbw-1:0] = GR[rd][lsbw-1:0]
  GR[rd] = SignExtend(bstr32[31:0], GRLEN)

And this check is also done by GNU as.

Yes, I think it’s better to document it in somewhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124825/new/

https://reviews.llvm.org/D124825



More information about the llvm-commits mailing list