diff options
| author | Jayanth Krishnamurthy <jayanth.krishnamurthy@ibm.com> | 2024-09-11 09:44:16 -0500 |
|---|---|---|
| committer | Paul Murphy <murp@ibm.com> | 2024-10-29 13:14:38 +0000 |
| commit | fdfb3067a8a27a7491c3b0f6eddedbd467495329 (patch) | |
| tree | d17dd79cb49f28e0300ef5fc5480fea66c178cb8 /src/runtime | |
| parent | b03b1acfb0bb6c605a70987dfaf5bb922c792e82 (diff) | |
| download | go-fdfb3067a8a27a7491c3b0f6eddedbd467495329.tar.xz | |
cmd/internal/obj/ppc64: support for extended mnemonics of BC
BGT, BLT, BLE, BGE, BNE, BVS, BVC, and BEQ support by assembler. This will simplify the usage of BC constructs like
BC 12, 30, LR <=> BEQ CR7, LR
BC 12, 2, LR <=> BEQ CR0, LR
BC 12, 0, target <=> BLT CR0, target
BC 12, 2, target <=> BEQ CR0, target
BC 12, 5, target <=> BGT CR1, target
BC 12, 30, target <=> BEQ CR7, target
BC 4, 6, target <=> BNE CR1, target
BC 4, 5, target <=> BLE CR1, target
code cleanup based on the above additions.
Change-Id: I02fdb212b6fe3f85ce447e05f4d42118c9ce63b5
Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-ppc64_power8,gotip-linux-ppc64le_power8,gotip-linux-ppc64le_power9,gotip-linux-ppc64le_power10
Reviewed-on: https://go-review.googlesource.com/c/go/+/612395
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/memclr_ppc64x.s | 6 | ||||
| -rw-r--r-- | src/runtime/memmove_ppc64x.s | 28 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/runtime/memclr_ppc64x.s b/src/runtime/memclr_ppc64x.s index bc4b3fc283..ffe40e12f6 100644 --- a/src/runtime/memclr_ppc64x.s +++ b/src/runtime/memclr_ppc64x.s @@ -19,7 +19,7 @@ check: SRD $3, R4, R6 // R6: double words to clear CMP R6, $0, CR1 // CR1[EQ] set if no double words - BC 12, 6, nozerolarge // only single bytes + BEQ CR1, nozerolarge // only single bytes CMP R4, $512 BLT under512 // special case for < 512 ANDCC $127, R3, R8 // check for 128 alignment of address @@ -104,7 +104,7 @@ lt16gt8: #endif nozerolarge: ANDCC $7, R4, R5 // any remaining bytes - BC 4, 1, LR // ble lr + BLE CR0, LR // ble lr #ifdef GOPPC64_power10 XXLXOR VS32, VS32, VS32 // clear VS32 (V0) SLD $56, R5, R7 @@ -124,7 +124,7 @@ next2: ADD $-2, R5 next1: CMP R5, $0 - BC 12, 2, LR // beqlr + BEQ CR0, LR // beqlr MOVB R0, 0(R3) RET #endif diff --git a/src/runtime/memmove_ppc64x.s b/src/runtime/memmove_ppc64x.s index 18b9c850f2..9892028d50 100644 --- a/src/runtime/memmove_ppc64x.s +++ b/src/runtime/memmove_ppc64x.s @@ -60,11 +60,11 @@ mcopy: SUB SRC, TGT, TMP // dest - src CMPU TMP, LEN, CR2 // < len? - BC 12, 8, backward // BLT CR2 backward + BLT CR2, backward // Copying forward if no overlap. - BC 12, 6, checkbytes // BEQ CR1, checkbytes + BEQ CR1, checkbytes SRDCC $3, DWORDS, OCTWORDS // 64 byte chunks? MOVD $16, IDX16 BEQ lt64gt8 // < 64 bytes @@ -132,7 +132,7 @@ lt16: // Move 8 bytes if possible MOVD TMP, 0(TGT) ADD $8, TGT checkbytes: - BC 12, 14, LR // BEQ lr + BEQ CR3, LR #ifdef GOPPC64_power10 SLD $56, BYTES, TMP LXVL SRC, TMP, V0 @@ -157,7 +157,7 @@ lt4: // Move halfword if possible ADD $2, TGT lt2: // Move last byte if 1 left CMP BYTES, $1 - BC 12, 0, LR // ble lr + BLT CR0, LR MOVBZ 0(SRC), TMP MOVBZ TMP, 0(TGT) RET @@ -182,7 +182,7 @@ backwardtailloop: BDNZ backwardtailloop nobackwardtail: - BC 4, 5, LR // blelr cr1, return if DWORDS == 0 + BLE CR1, LR // return if DWORDS == 0 SRDCC $2,DWORDS,QWORDS // Compute number of 32B blocks and compare to 0 BNE backward32setup // If QWORDS != 0, start the 32B copy loop. @@ -190,16 +190,16 @@ backward24: // DWORDS is a value between 1-3. CMP DWORDS, $2 - MOVD -8(SRC), TMP - MOVD TMP, -8(TGT) - BC 12, 0, LR // bltlr, return if DWORDS == 1 + MOVD -8(SRC), TMP + MOVD TMP, -8(TGT) + BLT CR0, LR // return if DWORDS == 1 - MOVD -16(SRC), TMP - MOVD TMP, -16(TGT) - BC 12, 2, LR // beqlr, return if DWORDS == 2 + MOVD -16(SRC), TMP + MOVD TMP, -16(TGT) + BEQ CR0, LR // return if DWORDS == 2 - MOVD -24(SRC), TMP - MOVD TMP, -24(TGT) + MOVD -24(SRC), TMP + MOVD TMP, -24(TGT) RET backward32setup: @@ -216,5 +216,5 @@ backward32loop: STXVD2X VS32, (R0)(TGT) // store 16x2 bytes STXVD2X VS33, (IDX16)(TGT) BDNZ backward32loop - BC 12, 2, LR // beqlr, return if DWORDS == 0 + BEQ CR0, LR // return if DWORDS == 0 BR backward24 |
