Skip to content

vlib: add x.atomics (implement native_x86-64_atomics in V and assembly, without depending on an external C library)#26529

Merged
spytheman merged 9 commits into
vlang:masterfrom
RbPyer:feature/native-atomics-x86-64
Feb 12, 2026
Merged

vlib: add x.atomics (implement native_x86-64_atomics in V and assembly, without depending on an external C library)#26529
spytheman merged 9 commits into
vlang:masterfrom
RbPyer:feature/native-atomics-x86-64

Conversation

@RbPyer

@RbPyer RbPyer commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

@RbPyer RbPyer force-pushed the feature/native-atomics-x86-64 branch from 1715c9b to 2dd7acf Compare February 6, 2026 18:50
@RbPyer

RbPyer commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

I fixed the code, there was a problem with the "al" clobber in compilation with tcc, I removed it as it was unnecessary. And msvc, judging by the jobs, doesn't support inline assembly

@RbPyer RbPyer force-pushed the feature/native-atomics-x86-64 branch 3 times, most recently from 041b7a2 to 64dd89b Compare February 9, 2026 00:09
Comment thread vlib/x/atomics/README.md Outdated
Comment thread vlib/x/atomics/README.md Outdated
Comment thread vlib/x/atomics/benchmarks/atomic_benchmark.v
Comment thread vlib/x/atomics/benchmarks/atomic_benchmark.v Outdated
Comment thread vlib/x/atomics/examples/basic.v Outdated
Comment thread vlib/x/atomics/examples/counter.v Outdated
Comment thread vlib/x/atomics/examples/spinlock.v Outdated
@spytheman spytheman force-pushed the feature/native-atomics-x86-64 branch from cb82b75 to c213766 Compare February 9, 2026 07:35
Comment thread vlib/x/atomics/atomics.amd64.v Outdated
Comment thread vlib/x/atomics/atomics.amd64.v Outdated
@spytheman

Copy link
Copy Markdown
Contributor

(rebased over master to get ahead of the other changes that can break the CI indirectly)

@spytheman

Copy link
Copy Markdown
Contributor

@RbPyer Sorry for the late review.

Thank you, excellent work.

@spytheman spytheman changed the title vlib/native_x86-64_atomics vlib: add x.atomics (implement native_x86-64_atomics in V and assembly, without depending on an external C library) Feb 9, 2026
…e; use `#flag -Wl,--undefined=panicUnaligned` to fix -prod builds that use -flto with gcc and clang
@spytheman spytheman force-pushed the feature/native-atomics-x86-64 branch from 3c61810 to 7193b06 Compare February 12, 2026 06:11
@spytheman spytheman merged commit edd4a71 into vlang:master Feb 12, 2026
78 checks passed
@ylluminate

Copy link
Copy Markdown
Contributor

@RbPyer have you looked at arm64 support yet?

@RbPyer

RbPyer commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

@RbPyer have you looked at arm64 support yet?

At the moment, I'm approaching the point of finalizing a stable API for x86-64, after which I will add support for arm64

cestef pushed a commit to cestef/v that referenced this pull request Mar 9, 2026
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.

3 participants