Skip to content

Commit 2f7a264

Browse files
authored
fix: correct NEON intrinsics so types check out
1 parent 1c14651 commit 2f7a264

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/implementation/c/node/table-lookup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
229229
if (start === end) {
230230
out.push(` single = vceqq_u8(input, ${v128(start)});`);
231231
} else {
232-
out.push(` single = vandq_u16(`);
232+
out.push(` single = vandq_u8(`);
233233
out.push(` vcgeq_u8(input, ${v128(start)}),`);
234234
out.push(` vcleq_u8(input, ${v128(end)})`);
235235
out.push(' );');
@@ -238,12 +238,12 @@ export class TableLookup extends Node<frontend.node.TableLookup> {
238238
if (off === 0) {
239239
out.push(' mask = single;');
240240
} else {
241-
out.push(' mask = vorrq_u16(mask, single);');
241+
out.push(' mask = vorrq_u8(mask, single);');
242242
}
243243
}
244244

245245
// https://community.arm.com/arm-community-blogs/b/servers-and-cloud-computing-blog/posts/porting-x86-vector-bitmask-optimizations-to-arm-neon
246-
out.push(' narrow = vshrn_n_u16(mask, 4);');
246+
out.push(' narrow = vshrn_n_u16(vreinterpretq_u16_u8(mask), 4);');
247247
out.push(' match_mask = ~vget_lane_u64(vreinterpret_u64_u8(narrow), 0);');
248248
out.push(' match_len = __builtin_ctzll(match_mask) >> 2;');
249249
out.push(' if (match_len != 16) {');

0 commit comments

Comments
 (0)