Skip to content

x32 AVX fixes - #354

Merged
Smattr merged 2 commits into
mainfrom
smattr/a45a0db9-5746-47b9-ab22-23e1f3c2b42a
Sep 14, 2026
Merged

Smattr merged 2 commits into
mainfrom
smattr/a45a0db9-5746-47b9-ab22-23e1f3c2b42a

Conversation

@Smattr

@Smattr Smattr commented Sep 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

Surprisingly (to me), SSE2 is available when using the x32 ABI.¹ A side
effect of this is that the AVX load/store code paths were enabled on
this platform despite not being compilable:²

  checker.c: In function ‘atomic_read’:
  checker.c:2613:5: error: cannot convert a vector of type ‘avx128_t’
    {aka ‘__m128i’} to type ‘long long unsigned int’ which has different
    size
   2613 |     return (dword_t)*ptr;
        |     ^~~~~~
  checker.c: In function ‘atomic_write’:
  checker.c:2673:5: error: cannot convert a value of type ‘dword_t’ {aka
    ‘long long unsigned int’} to vector type ‘__vector(2) long long int’
    which has different size
   2673 |     *ptr = (__m128i)v;
        |     ^

This was exposed by the Debian build farm during the last release cycle.

If relevant, atomics on x32 could be optimised more. There is no need to
use the various `CMPXCHG16B` work arounds when x32 should be able to
just use `MOVQ` (64-bit atomics).

¹ https://en.wikipedia.org/wiki/X32_ABI
² https://buildd.debian.org/status/fetch.php?pkg=rumur&arch=x32&ver=2026.08.30-1&stamp=1788130874&raw=0
This should have been included in
c717898.
@Smattr
Smattr merged commit ec09e4f into main Sep 14, 2026
25 checks passed
@Smattr
Smattr deleted the smattr/a45a0db9-5746-47b9-ab22-23e1f3c2b42a branch September 14, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant