[LoongArch] Emit bytepick for picking from concatenation of two values
authorWANG Xuerui <git@xen0n.name>
Thu, 16 Mar 2023 06:09:51 +0000 (14:09 +0800)
committerWeining Lu <luweining@loongson.cn>
Thu, 16 Mar 2023 07:07:06 +0000 (15:07 +0800)
commit19e2ebbf45bdd9f2a9abc3f7760bdbea8c808dc0
tree6a1cc0cbb2cc76b961a1644d9768935b577a771a
parentff475a0dd92fa7f425617d663caab4d4c65684ac
[LoongArch] Emit bytepick for picking from concatenation of two values

It seems the ISA manual's pseudo-code description for the
`BYTEPICK.[WD]` instructions is inaccurate; the behavior described here
should be correct though. The instructions' names are misleading too
(they pick full GRLen-wide words instead of bytes; they just index by
bytes) but let's stick to the official names for now.

Reviewed By: SixWeining

Differential Revision: https://reviews.llvm.org/D143880
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
llvm/test/CodeGen/LoongArch/bitreverse.ll
llvm/test/CodeGen/LoongArch/bswap.ll
llvm/test/CodeGen/LoongArch/bytepick.ll