Commit e3ad707
committed
fix(simd): revert avx2 predicate tightening — env RUSTFLAGS overrides v3 config
The previous commit tightened the x86_64 dispatch arm to
`target_feature = "avx2" + not(avx512f)`. The intent was to make
"x86-64 baseline + AVX2 wrappers" a compile error rather than a SIGILL.
CI green-mode disagreed: `.github/workflows/ci.yaml` sets a global
`RUSTFLAGS="-D warnings"` env that overrides the rustflags from
`.cargo/config.toml` entirely (cargo doesn't merge env + config
rustflags — env wins). So in CI the v3 baseline never takes effect,
x86-64 generic / SSE2 is what builds, `target_feature = "avx2"` is not
set, and the tightened arm leaves no matching dispatch path → consumer
references to `crate::simd::F32x16` fail to compile.
The pre-existing wider `not(avx512f)` predicate works at x86-64
baseline because the inner intrinsics in `simd_avx2.rs` use per-function
`#[target_feature(enable = "avx,avx2,fma")]` annotations — the OPS
gate themselves at the symbol level, struct fields like `__m256` /
`__m256i` are core::arch type declarations that don't require AVX/AVX2
at the type level (only at execution).
Reverting the predicate. The cargo configs added in the previous commit
stay — they're the documented opt-in affordances. Local `cargo build`
without env override gets v3; CI runs at baseline + per-function
target_feature; explicit AVX-512 via `--config .cargo/config-avx512.toml`.1 parent 0d00318 commit e3ad707
1 file changed
Lines changed: 13 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
289 | 294 | | |
290 | 295 | | |
291 | | - | |
| 296 | + | |
292 | 297 | | |
293 | 298 | | |
294 | 299 | | |
| |||
0 commit comments