-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf, docs: Move Clang notes to a separate file
Move Clang notes to a separate file. Signed-off-by: Dave Thaler <dthaler@microsoft.com> Link: https://lore.kernel.org/r/20220927185958.14995-3-dthaler1968@googlemail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
- Loading branch information
Dave Thaler
authored and
Alexei Starovoitov
committed
Sep 30, 2022
1 parent
9a0bf21
commit 6c7aaff
Showing
2 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. contents:: | ||
.. sectnum:: | ||
|
||
========================== | ||
Clang implementation notes | ||
========================== | ||
|
||
This document provides more details specific to the Clang/LLVM implementation of the eBPF instruction set. | ||
|
||
Versions | ||
======== | ||
|
||
Clang defined "CPU" versions, where a CPU version of 3 corresponds to the current eBPF ISA. | ||
|
||
Clang can select the eBPF ISA version using ``-mcpu=v3`` for example to select version 3. | ||
|
||
Atomic operations | ||
================= | ||
|
||
Clang can generate atomic instructions by default when ``-mcpu=v3`` is | ||
enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction | ||
Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable | ||
the atomics features, while keeping a lower ``-mcpu`` version, you can use | ||
``-Xclang -target-feature -Xclang +alu32``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters