"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/runtime/memmove_arm64.s" between
go1.13.5.src.tar.gz and go1.13.6.src.tar.gz

About: Google’s Go is a compiled, garbage-collected, concurrent programming language. Latest stable release (1.13).

memmove_arm64.s  (go1.13.5.src):memmove_arm64.s  (go1.13.6.src)
skipping to change at line 25 skipping to change at line 25
check: check:
CMP $16, R5 CMP $16, R5
BLE copy16 BLE copy16
AND $~31, R5, R7 // R7 is N&~31 AND $~31, R5, R7 // R7 is N&~31
SUB R7, R5, R6 // R6 is N&31 SUB R7, R5, R6 // R6 is N&31
CMP R3, R4 CMP R3, R4
BLT backward BLT backward
// Copying forward proceeds by copying R7/8 words then copying R6 bytes. // Copying forward proceeds by copying R7/32 quadwords then R6 <= 31 tail bytes.
// R3 and R4 are advanced as we copy. // R3 and R4 are advanced as we copy.
// (There may be implementations of armv8 where copying by bytes until // (There may be implementations of armv8 where copying by bytes until
// at least one of source or dest is word aligned is a worthwhile // at least one of source or dest is word aligned is a worthwhile
// optimization, but the on the one tested so far (xgene) it did not // optimization, but the on the one tested so far (xgene) it did not
// make a significance difference.) // make a significance difference.)
CBZ R7, noforwardlarge // Do we need to do any doubleword-by-dou bleword copying? CBZ R7, noforwardlarge // Do we need to do any quadword copying?
ADD R3, R7, R9 // R9 points just past where we copy by word ADD R3, R7, R9 // R9 points just past where we copy by word
forwardlargeloop: forwardlargeloop:
// Copy 32 bytes at a time.
LDP.P 32(R4), (R8, R10) LDP.P 32(R4), (R8, R10)
STP.P (R8, R10), 32(R3) STP.P (R8, R10), 32(R3)
LDP -16(R4), (R11, R12) LDP -16(R4), (R11, R12)
STP (R11, R12), -16(R3) STP (R11, R12), -16(R3)
SUB $32, R7, R7 SUB $32, R7, R7
CBNZ R7, forwardlargeloop CBNZ R7, forwardlargeloop
noforwardlarge: noforwardlarge:
CBNZ R6, forwardtail // Do we need to do any byte-by-byte copy ing? CBNZ R6, forwardtail // Do we need to copy any tail bytes?
RET RET
forwardtail: forwardtail:
// There are R6 <= 31 bytes remaining to copy.
// This is large enough to still contain pointers,
// which must be copied atomically.
// Copy the next 16 bytes, then 8 bytes, then any remaining bytes.
TBZ $4, R6, 3(PC) // write 16 bytes if R6&16 != 0
LDP.P 16(R4), (R8, R10)
STP.P (R8, R10), 16(R3)
TBZ $3, R6, 3(PC) // write 8 bytes if R6&8 != 0
MOVD.P 8(R4), R8
MOVD.P R8, 8(R3)
AND $7, R6
CBNZ R6, 2(PC)
RET
ADD R3, R6, R9 // R9 points just past the destination memory ADD R3, R6, R9 // R9 points just past the destination memory
forwardtailloop: forwardtailloop:
MOVBU.P 1(R4), R8 MOVBU.P 1(R4), R8
MOVBU.P R8, 1(R3) MOVBU.P R8, 1(R3)
CMP R3, R9 CMP R3, R9
BNE forwardtailloop BNE forwardtailloop
RET RET
// Small copies: 1..16 bytes. // Small copies: 1..16 bytes.
skipping to change at line 93 skipping to change at line 110
MOVH R6, (R3) MOVH R6, (R3)
MOVH R7, -2(R9) MOVH R7, -2(R9)
RET RET
copy1: copy1:
MOVBU (R4), R6 MOVBU (R4), R6
MOVB R6, (R3) MOVB R6, (R3)
RET RET
backward: backward:
// Copying backwards proceeds by copying R6 bytes then copying R7/8 words . // Copying backwards first copies R6 <= 31 tail bytes, then R7/32 quadwor ds.
// R3 and R4 are advanced to the end of the destination/source buffers // R3 and R4 are advanced to the end of the destination/source buffers
// respectively and moved back as we copy. // respectively and moved back as we copy.
ADD R4, R5, R4 // R4 points just past the last source byte ADD R4, R5, R4 // R4 points just past the last source byte
ADD R3, R5, R3 // R3 points just past the last destination byte ADD R3, R5, R3 // R3 points just past the last destination byte
CBZ R6, nobackwardtail // Do we need to do any byte-by-byte copy ing? CBZ R6, nobackwardtail // Do we need to do any byte-by-byte copy ing?
SUB R6, R3, R9 // R9 points at the lowest destination byte that AND $7, R6, R12
should be copied by byte. CBZ R12, backwardtaillarge
SUB R12, R3, R9 // R9 points at the lowest destination byte that
should be copied by byte.
backwardtailloop: backwardtailloop:
// Copy sub-pointer-size tail.
MOVBU.W -1(R4), R8 MOVBU.W -1(R4), R8
MOVBU.W R8, -1(R3) MOVBU.W R8, -1(R3)
CMP R9, R3 CMP R9, R3
BNE backwardtailloop BNE backwardtailloop
backwardtaillarge:
// Do 8/16-byte write if possible.
// See comment at forwardtail.
TBZ $3, R6, 3(PC)
MOVD.W -8(R4), R8
MOVD.W R8, -8(R3)
TBZ $4, R6, 3(PC)
LDP.W -16(R4), (R8, R10)
STP.W (R8, R10), -16(R3)
nobackwardtail: nobackwardtail:
CBNZ R7, backwardlarge // Do we need to do any doubleword-by-dou bleword copying? CBNZ R7, backwardlarge // Do we need to do any doubleword-by-dou bleword copying?
RET RET
backwardlarge: backwardlarge:
SUB R7, R3, R9 // R9 points at the lowest destination byte SUB R7, R3, R9 // R9 points at the lowest destination byte
backwardlargeloop: backwardlargeloop:
LDP -16(R4), (R8, R10) LDP -16(R4), (R8, R10)
STP (R8, R10), -16(R3) STP (R8, R10), -16(R3)
 End of changes. 9 change blocks. 
6 lines changed or deleted 38 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)