Commit b5bca4e
committed
feat(simd_int_ops): MX-T1a — lift add_i8 / sub_i8 / add_i16 to polyfilled lanes
Phase 1 of the per-CPU integration plan: the integer-elementwise slice
ops in simd_int_ops were uniformly scalar on every CPU despite the
polyfilled I8x64 / I16x32 lanes existing and being SIMD-backed on
every backend. This routes the three ops through the polyfill.
Per-backend dispatch follows the existing min_i8 / max_i8 template:
x86_64 → I8x64 / I16x32 (AVX-512BW _mm512_add_epi8 zmm /
AVX2 polyfill of I8x64 as 2×__m256i on v3 builds)
aarch64 → I8x16 / I16x8 (NEON vaddq_s8 / vaddq_s16)
other → scalar wrapping loop (unchanged)
Wrapping arithmetic is preserved on every path: _mm512_add_epi8 and
vaddq_s8 are bit-for-bit equivalent to i8::wrapping_add, so the
existing tests (add_i8_matches_scalar_for_tail_lengths covering
lengths 0/1/32/63/64/65/127/128/129/256) verify correctness across
the cfg chain. No new tests needed — the parity-against-scalar
sweep already exercised every boundary.
Verification:
* default v3 build (uses AVX2 polyfill of I8x64): 15 simd_int_ops
tests pass; 2087 lib tests pass; clippy -D warnings clean.
* cascadelake config (native _mm512_add_epi8 / _mm512_add_epi16):
15 simd_int_ops tests pass.
* sapphirerapids config: NOT verified — the dev-runtime CPU on
this host advertises only avx512_vnni in /proc/cpuinfo (no AMX
/ BF16 / FP16), so SPR-targeted binaries SIGILL on UNRELATED
pre-existing tests like min_max_i8_boundary_values. The SPR
config's correctness needs verification on real SPR silicon.
Companion matrix entries flipped:
C. simd_int_ops → row `add_i8` : 1 parent 058ef61 commit b5bca4e
1 file changed
Lines changed: 139 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
28 | 75 | | |
29 | 76 | | |
30 | 77 | | |
31 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
32 | 83 | | |
33 | 84 | | |
34 | 85 | | |
35 | | - | |
36 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
37 | 127 | | |
38 | 128 | | |
39 | 129 | | |
40 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
41 | 134 | | |
42 | 135 | | |
43 | 136 | | |
44 | | - | |
45 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 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 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
46 | 178 | | |
47 | 179 | | |
48 | 180 | | |
| |||
0 commit comments