Commit e79f9d3
authored
Fix avx512vl_{128,256} correctness bugs + CI default-arch typo (#1357)
* ci: fix $CXX_FLAGS typo dropping CXXFLAGS in Linux arch matrix
The avx_128, avx2_128 and avx512vl_256 matrix branches set
CXXFLAGS="$CXX_FLAGS -DXSIMD_DEFAULT_ARCH=..." but $CXX_FLAGS is
undefined at that point, so any inherited CXXFLAGS is wiped and the
intended append never happens. Use $CXXFLAGS, matching the avx512vl_128
branch. This also means the avx512vl_256 job now actually compiles with
its intended default arch (previously it silently did not).
* fix(avx512vl): correct swizzle recursion, neq NaN, decr_if/incr_if
Three correctness bugs on the avx512vl_128 / avx512vl_256 arches, which
use k-mask batch_bool registers rather than vector masks:
- 16-bit dynamic swizzle recursed infinitely. The sized-2 bridge
bitwise_cast<uint16_t>(self) is a no-op for uint16_t, so it re-selected
itself (gcc: 'always_inline ... inline-unit-growth limit reached',
breaking the full avx512vl_256 test build). Add a uint16_t base that
forwards to avx2, mirroring the existing uint8_t base.
- neq(NaN, x) returned false: float/double neq used _CMP_NEQ_OQ (ordered,
false on NaN). IEEE != needs _CMP_NEQ_UQ, as avx/avx512f already use.
- decr_if/incr_if produced garbage (e.g. decr_if(1, all-true)=0x10000).
They inherited avx's 'self +/- batch<T>(mask.data)', which assumes a
vector batch_bool whose true lanes are all-ones; here mask.data is a
k-mask bitfield, so the broadcast is wrong. Delegate to the
select-based common implementation.
Covered by existing tests (test_decr_if/test_incr_if/test_neq/
test_neq_nan in test_xsimd_api.cpp, and the uint16 swizzle in
test_shuffle/test_batch_manip), which now pass on both VL arches under
SDE; previously they could not even build (swizzle) or were never
exercised because the VL_256 CI job lacked its default arch (see prior
commit).1 parent 0929f1a commit e79f9d3
3 files changed
Lines changed: 48 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
| 510 | + | |
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | | - | |
| 515 | + | |
516 | 516 | | |
517 | 517 | | |
518 | 518 | | |
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
640 | 656 | | |
641 | 657 | | |
642 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
377 | 386 | | |
378 | 387 | | |
379 | 388 | | |
| |||
589 | 598 | | |
590 | 599 | | |
591 | 600 | | |
592 | | - | |
| 601 | + | |
593 | 602 | | |
594 | 603 | | |
595 | 604 | | |
596 | 605 | | |
597 | | - | |
| 606 | + | |
598 | 607 | | |
599 | 608 | | |
600 | 609 | | |
| |||
719 | 728 | | |
720 | 729 | | |
721 | 730 | | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
722 | 747 | | |
723 | 748 | | |
724 | 749 | | |
| |||
0 commit comments