]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: BPF: Adjust the parameter of emit_jirl()
authorTiezhu Yang <yangtiezhu@loongson.cn>
Mon, 2 Dec 2024 08:42:08 +0000 (16:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:34:18 +0000 (10:34 +0100)
commit2d95df70e5945c69ef4d3bca2700713d69db9f86
tree177e5305ce50af5e50c52be9eab1de1002114615
parent45d7745c89c162f1a044a9f5cecac4bf7fe5eede
LoongArch: BPF: Adjust the parameter of emit_jirl()

[ Upstream commit c1474bb0b7cff4e8481095bd0618b8f6c2f0aeb4 ]

The branch instructions beq, bne, blt, bge, bltu, bgeu and jirl belong
to the format reg2i16, but the sequence of oprand is different for the
instruction jirl. So adjust the parameter order of emit_jirl() to make
it more readable correspond with the Instruction Set Architecture manual.

Here are the instruction formats:

  beq     rj, rd, offs16
  bne     rj, rd, offs16
  blt     rj, rd, offs16
  bge     rj, rd, offs16
  bltu    rj, rd, offs16
  bgeu    rj, rd, offs16
  jirl    rd, rj, offs16

Link: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#branch-instructions
Suggested-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/include/asm/inst.h
arch/loongarch/kernel/inst.c
arch/loongarch/net/bpf_jit.c