1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 #include "textflag.h" 6 7 // void runtimememclrNoHeapPointers(void*, uintptr) 8 TEXT runtimememclrNoHeapPointers(SB),NOSPLIT|NOFRAME,$0-16 9 MOVD ptr+0(FP), R4 10 MOVD n+8(FP), R5 11 12 start: 13 CMPBLE R5, $3, clear0to3 14 CMPBLE R5, $7, clear4to7 15 CMPBLE R5, $11, clear8to11 16 CMPBLE R5, $15, clear12to15 17 CMP R5, $32 18 BGE clearmt32 19 MOVD $0, 0(R4) 20 MOVD $0, 8(R4) 21 ADD $16, R4 22 SUB $16, R5 23 BR start 24 25 clear0to3: 26 CMPBEQ R5, $0, done 27 CMPBNE R5, $1, clear2 28 MOVB $0, 0(R4) 29 RET 30 clear2: 31 CMPBNE R5, $2, clear3 32 MOVH $0, 0(R4) 33 RET 34 clear3: 35 MOVH $0, 0(R4) 36 MOVB $0, 2(R4) 37 RET 38 39 clear4to7: 40 CMPBNE R5, $4, clear5 41 MOVW $0, 0(R4) 42 RET 43 clear5: 44 CMPBNE R5, $5, clear6 45 MOVW $0, 0(R4) 46 MOVB $0, 4(R4) 47 RET 48 clear6: 49 CMPBNE R5, $6, clear7 50 MOVW $0, 0(R4) 51 MOVH $0, 4(R4) 52 RET 53 clear7: 54 MOVW $0, 0(R4) 55 MOVH $0, 4(R4) 56 MOVB $0, 6(R4) 57 RET 58 59 clear8to11: 60 CMPBNE R5, $8, clear9 61 MOVD $0, 0(R4) 62 RET 63 clear9: 64 CMPBNE R5, $9, clear10 65 MOVD $0, 0(R4) 66 MOVB $0, 8(R4) 67 RET 68 clear10: 69 CMPBNE R5, $10, clear11 70 MOVD $0, 0(R4) 71 MOVH $0, 8(R4) 72 RET 73 clear11: 74 MOVD $0, 0(R4) 75 MOVH $0, 8(R4) 76 MOVB $0, 10(R4) 77 RET 78 79 clear12to15: 80 CMPBNE R5, $12, clear13 81 MOVD $0, 0(R4) 82 MOVW $0, 8(R4) 83 RET 84 clear13: 85 CMPBNE R5, $13, clear14 86 MOVD $0, 0(R4) 87 MOVW $0, 8(R4) 88 MOVB $0, 12(R4) 89 RET 90 clear14: 91 CMPBNE R5, $14, clear15 92 MOVD $0, 0(R4) 93 MOVW $0, 8(R4) 94 MOVH $0, 12(R4) 95 RET 96 clear15: 97 MOVD $0, 0(R4) 98 MOVW $0, 8(R4) 99 MOVH $0, 12(R4) 100 MOVB $0, 14(R4) 101 RET 102 103 clearmt32: 104 CMP R5, $256 105 BLT clearlt256 106 XC $256, 0(R4), 0(R4) 107 ADD $256, R4 108 ADD $-256, R5 109 BR clearmt32 110 clearlt256: 111 CMPBEQ R5, $0, done 112 ADD $-1, R5 113 EXRL $runtimememclr_s390x_exrl_xc(SB), R5 114 done: 115 RET 116 117 // DO NOT CALL - target for exrl (execute relative long) instruction. 118 TEXT runtimememclr_s390x_exrl_xc(SB),NOSPLIT|NOFRAME,$0-0 119 XC $1, 0(R4), 0(R4) 120 MOVD $0, 0(R0) 121 RET 122 123