diff options
| author | Guoqi Chen <chenguoqi@loongson.cn> | 2025-04-23 10:30:39 +0800 |
|---|---|---|
| committer | abner chenc <chenguoqi@loongson.cn> | 2025-04-24 18:28:42 -0700 |
| commit | fb2c88147d0aab656b7a8ae109b3d1241de402ab (patch) | |
| tree | 6b1188caf2ad7b727093169f14b09acafcaf12da /src/cmd/asm | |
| parent | 06f96a598eb6ee1679624f955fe5e1e837e4c49c (diff) | |
| download | go-fb2c88147d0aab656b7a8ae109b3d1241de402ab.tar.xz | |
cmd/internal/obj: add new assembly format for BFPT and BFPF on loong64
On loong64, BFPT and BFPF are mapped to the platform assembly as follows:
Go asm syntax:
BFPT FCCx, offs21
BFPF FCCx, offs21
Equivalent platform assembler syntax:
bcnez cj, offs21
bceqz cj, offs21
If the condition register is not specified, it defaults to FCC0.
Change-Id: I2cc3df62a9c55d4b5eb124789358983c6737319c
Reviewed-on: https://go-review.googlesource.com/c/go/+/667456
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Diffstat (limited to 'src/cmd/asm')
| -rw-r--r-- | src/cmd/asm/internal/asm/testdata/loong64enc1.s | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/loong64enc1.s b/src/cmd/asm/internal/asm/testdata/loong64enc1.s index ad0ffa33d6..cfda9ba0b4 100644 --- a/src/cmd/asm/internal/asm/testdata/loong64enc1.s +++ b/src/cmd/asm/internal/asm/testdata/loong64enc1.s @@ -6,12 +6,16 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 lable1: - BFPT 1(PC) // 00050048 - BFPT lable1 // BFPT 2 //1ffdff4b + BFPT 1(PC) // 00050048 + BFPT lable1 // BFPT 2 // 1ffdff4b + BFPT FCC0, lable1 // BFPT FCC0, 2 // 1ff9ff4b + BFPT FCC7, lable1 // BFPT FCC7, 2 // fff5ff4b lable2: - BFPF 1(PC) // 00040048 - BFPF lable2 // BFPF 4 // 1ffcff4b + BFPF 1(PC) // 00040048 + BFPF lable2 // BFPF 6 // 1ffcff4b + BFPF FCC0, lable2 // BFPF FCC0, 6 // 1ff8ff4b + BFPF FCC7, lable2 // BFPF FCC7, 6 // fff4ff4b // relocation in play so the assembled offset should be 0 JMP foo(SB) // 00000050 |
