summaryrefslogtreecommitdiff
path: root/src/runtime/memclr_ppc64x.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/memclr_ppc64x.s')
-rw-r--r--src/runtime/memclr_ppc64x.s20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/runtime/memclr_ppc64x.s b/src/runtime/memclr_ppc64x.s
index f0b13b40ae..bc4b3fc283 100644
--- a/src/runtime/memclr_ppc64x.s
+++ b/src/runtime/memclr_ppc64x.s
@@ -111,11 +111,21 @@ nozerolarge:
STXVL V0, R3, R7
RET
#else
- MOVD R5, CTR // set up to clear tail bytes
-zerotailloop:
- MOVB R0, 0(R3) // clear single bytes
- ADD $1, R3
- BDNZ zerotailloop // dec ctr, br zerotailloop if ctr not 0
+ CMP R5, $4
+ BLT next2
+ MOVW R0, 0(R3)
+ ADD $4, R3
+ ADD $-4, R5
+next2:
+ CMP R5, $2
+ BLT next1
+ MOVH R0, 0(R3)
+ ADD $2, R3
+ ADD $-2, R5
+next1:
+ CMP R5, $0
+ BC 12, 2, LR // beqlr
+ MOVB R0, 0(R3)
RET
#endif