Commit 6840b7d
committed
BUG: Fix LUT compile failures on MSVC and Highway debug builds
Two portability issues in the transposed-load LUT path:
- kTransposeLength evaluated to 0 when kInitTranspose is false
(kRows < kTransposeBy), producing a zero-size array that MSVC
rejects. Clamp it to 1 as an unused placeholder.
- Lanes(du) is not constexpr in Highway debug builds, so it cannot
initialize a constexpr size_t. Use the HWY_LANES(T) macro, which
is a compile-time constant in all build modes.
Also cleaned up the surrounding code:
- Removed the LoadTranspose_ helper and inlined its body into the
Load path. It was an extra indirection that only forwarded to
LoadTransposeX2_/X4_ or fell back to LoadRow_; the dispatch reads
clearer inline.
- Dropped the static_assert(kTransposeBy == 4) in that helper. Older
compilers evaluate it eagerly in the discarded if-constexpr branch
even though it is guarded, so it fired spuriously."1 parent 5f1646d commit 6840b7d
1 file changed
Lines changed: 20 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
92 | | - | |
93 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
94 | 108 | | |
95 | 109 | | |
96 | 110 | | |
| |||
137 | 151 | | |
138 | 152 | | |
139 | 153 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | 154 | | |
168 | 155 | | |
169 | 156 | | |
| |||
226 | 213 | | |
227 | 214 | | |
228 | 215 | | |
| 216 | + | |
229 | 217 | | |
230 | 218 | | |
231 | 219 | | |
| |||
236 | 224 | | |
237 | 225 | | |
238 | 226 | | |
239 | | - | |
240 | | - | |
| 227 | + | |
241 | 228 | | |
242 | 229 | | |
243 | 230 | | |
| |||
0 commit comments