builtin: reduce the number of array allocations for consts in all V programs (#18889)

This commit is contained in:
Artem Yurchenko 2023-07-19 12:06:41 +02:00 committed by GitHub
parent 44d2f2b302
commit 1ed0cd9a74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1317 additions and 644 deletions

View file

@ -7,11 +7,11 @@ const (
// See http://supertech.csail.mit.edu/papers/debruijn.pdf
de_bruijn32 = u32(0x077CB531)
de_bruijn32tab = [u8(0), 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13,
23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9]
23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9]!
de_bruijn64 = u64(0x03f79d71b4ca8b09)
de_bruijn64tab = [u8(0), 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 62, 47, 59,
36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 63, 55, 48, 27, 60, 41, 37, 16, 46,
35, 44, 21, 52, 32, 23, 11, 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6]
35, 44, 21, 52, 32, 23, 11, 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6]!
)
const (