aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authorQuey-Liang Kao <s101062801@m101.nthu.edu.tw>2020-11-21 22:48:55 +0800
committerJoel Sing <joel@sing.id.au>2020-12-02 14:20:12 +0000
commit0433845ad18a355413033bb3495ba3195f4c69ec (patch)
tree7b7cde1a9da6ef75ed9dda7aa01ea10cdc46b802 /src/cmd/asm
parent73e796cb007989449da95fb4adf936ee76b766ca (diff)
downloadgo-0433845ad18a355413033bb3495ba3195f4c69ec.tar.gz
go-0433845ad18a355413033bb3495ba3195f4c69ec.zip
cmd/asm, cmd/internal/obj/riscv: fix branch pseudo-instructions
Pseudo branch instructions BGT, BGTU, BLE, and BLEU implemented In CL 226397 were translated inconsistently compared to other ones due to the inversion of registers. For instance, while "BLT a, b" generates "jump if a < b", "BLE a, b" generates "jump if b <= a." This CL fixes the translation in the assembler and the tests. Change-Id: Ia757be73e848734ca5b3a790e081f7c4f98c30f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/271911 Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> Run-TryBot: Joel Sing <joel@sing.id.au>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/riscvenc.s8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/riscvenc.s b/src/cmd/asm/internal/asm/testdata/riscvenc.s
index e30a576473..9a49d96ca0 100644
--- a/src/cmd/asm/internal/asm/testdata/riscvenc.s
+++ b/src/cmd/asm/internal/asm/testdata/riscvenc.s
@@ -340,11 +340,11 @@ start:
// Branch pseudo-instructions
BEQZ X5, start // BEQZ X5, 2 // e38602c0
BGEZ X5, start // BGEZ X5, 2 // e3d402c0
- BGT X5, X6, start // BGT X5, X6, 2 // e3c262c0
- BGTU X5, X6, start // BGTU X5, X6, 2 // e3e062c0
+ BGT X5, X6, start // BGT X5, X6, 2 // e34253c0
+ BGTU X5, X6, start // BGTU X5, X6, 2 // e36053c0
BGTZ X5, start // BGTZ X5, 2 // e34e50be
- BLE X5, X6, start // BLE X5, X6, 2 // e3dc62be
- BLEU X5, X6, start // BLEU X5, X6, 2 // e3fa62be
+ BLE X5, X6, start // BLE X5, X6, 2 // e35c53be
+ BLEU X5, X6, start // BLEU X5, X6, 2 // e37a53be
BLEZ X5, start // BLEZ X5, 2 // e35850be
BLTZ X5, start // BLTZ X5, 2 // e3c602be
BNEZ X5, start // BNEZ X5, 2 // e39402be