simd: increase padding for avx

This commit is contained in:
Mitchell Hashimoto
2024-02-07 14:43:08 -08:00
parent ae74117269
commit e5c7d4e3ee

View File

@ -55,6 +55,8 @@ HWY_ALIGN constexpr uint16_t eaw_gte16[] = {
0xfe10, 0xfe30, 0xfe54, 0xfe68, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
HWY_ALIGN constexpr uint16_t eaw_lte16[] = {
@ -70,6 +72,8 @@ HWY_ALIGN constexpr uint16_t eaw_lte16[] = {
0xfe19, 0xfe52, 0xfe66, 0xfe6b, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
/// These are the ranges of codepoints that are DEFINITELY width 0.
@ -88,6 +92,8 @@ HWY_ALIGN constexpr uint16_t zero_gte16[] = {
0xfff9, 0x488, 0x1abe, 0x20dd, 0x20e2, 0xa670, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
HWY_ALIGN constexpr uint16_t zero_lte16[] = {
@ -95,6 +101,8 @@ HWY_ALIGN constexpr uint16_t zero_lte16[] = {
0xfffb, 0x489, 0x1abe, 0x20e0, 0x20e4, 0xa672, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
/// Non-spacing marks
@ -169,6 +177,8 @@ HWY_ALIGN constexpr uint16_t nsm_gte16[] = {
0xabe8, 0xabed, 0xfb1e, 0xfe00, 0xfe20, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
HWY_ALIGN constexpr uint16_t nsm_lte16[] = {
@ -198,6 +208,8 @@ HWY_ALIGN constexpr uint16_t nsm_lte16[] = {
0xabe8, 0xabed, 0xfb1e, 0xfe0f, 0xfe2f, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
};
// All our tables must be identically sized
@ -221,12 +233,15 @@ int8_t CodepointWidth16(D d, uint16_t input) {
// NOTE: 0x2E3B is technically width 3 but for our terminal we only
// handle up to width 2 as wide so we will treat it as width 2.
HWY_ALIGN constexpr T gte_keys[] = {
0x2E3A, 0x3400, 0x4E00, 0xF900, 0x2E3B, 0x1160, 0x2060, 0xFFF0,
0, 0, 0, 0, 0, 0, 0, 0,
0x2E3A, 0x3400, 0x4E00, 0xF900, 0x2E3B, 0x1160, 0x2060, 0xFFF0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
HWY_ALIGN constexpr T lte_keys[] = {
0x2E3A, 0x4DBF, 0x9FFF, 0xFAFF, 0x2E3B, 0x11FF, 0x206F, 0xFFF8,
0, 0, 0, 0, 0, 0, 0, 0,
0x2E3A, 0x4DBF, 0x9FFF, 0xFAFF, 0x2E3B, 0x11FF, 0x206F, 0xFFF8, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
size_t i = 0;
for (; i + N <= std::size(lte_keys) && lte_keys[i] != 0; i += N) {