1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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
12 changed files with 1317 additions and 644 deletions

View File

@ -187,7 +187,7 @@ fn f64_to_decimal(mant u64, exp u64) Dec64 {
k := pow5_inv_num_bits_64 + pow5_bits(int(q)) - 1
i := -e2 + int(q) + k
mul := pow5_inv_split_64[q]
mul := *(&Uint128(&pow5_inv_split_64_x[q * 2]))
vr = mul_shift_64(u64(4) * m2, mul, i)
vp = mul_shift_64(u64(4) * m2 + u64(2), mul, i)
vm = mul_shift_64(u64(4) * m2 - u64(1) - mm_shift, mul, i)
@ -215,7 +215,7 @@ fn f64_to_decimal(mant u64, exp u64) Dec64 {
i := -e2 - int(q)
k := pow5_bits(i) - pow5_num_bits_64
j := int(q) - k
mul := pow5_split_64[i]
mul := *(&Uint128(&pow5_split_64_x[i * 2]))
vr = mul_shift_64(u64(4) * m2, mul, j)
vp = mul_shift_64(u64(4) * m2 + u64(2), mul, j)
vm = mul_shift_64(u64(4) * m2 - u64(1) - mm_shift, mul, j)