- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for countGenericString (0.17 sec)
-
src/internal/bytealg/count_native.go
// A backup implementation to use by assembly. func countGeneric(b []byte, c byte) int { n := 0 for _, x := range b { if x == c { n++ } } return n } func countGenericString(s string, c byte) int { n := 0 for i := 0; i < len(s); i++ { if s[i] == c { n++ } } return n
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 28 18:17:57 UTC 2021 - 643 bytes - Viewed (0) -
src/internal/bytealg/count_amd64.s
MOVB c+24(FP), AL LEAQ ret+32(FP), R8 JMP countbody<>(SB) TEXT ·CountString(SB),NOSPLIT,$0-32 #ifndef hasPOPCNT CMPB internal∕cpu·X86+const_offsetX86HasPOPCNT(SB), $1 JEQ 2(PC) JMP ·countGenericString(SB) #endif MOVQ s_base+0(FP), SI MOVQ s_len+8(FP), BX MOVB c+16(FP), AL LEAQ ret+24(FP), R8 JMP countbody<>(SB) // input: // SI: data // BX: data len // AL: byte sought
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Oct 06 20:54:43 UTC 2023 - 4.7K bytes - Viewed (0)