internal/decoder/scan_amd64.go
raw| 1 | package decoder |
| 2 | |
| 3 | import ( |
| 4 | "unsafe" |
| 5 | |
| 6 | "github.com/goccy/go-json/internal/runtime" |
| 7 | ) |
| 8 | |
| 9 | //go:noescape |
| 10 | func scanBlockAVX2(p unsafe.Pointer, m *scanMasks) |
| 11 | |
| 12 | // scanBlock computes the masks of the block at p: by AVX2 when the CPU has it, else by words. |
| 13 | func scanBlock(p unsafe.Pointer, m *scanMasks) { |
| 14 | if runtime.HasAVX2 { |
| 15 | scanBlockAVX2(p, m) |
| 16 | return |
| 17 | } |
| 18 | scanBlockWords(p, m) |
| 19 | } |