mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 02:21:39 -04:00
This is a subset of the Rust `zerocopy` crate, version v0.8.50 (released
2026-05-31), licensed under "BSD-2-Clause OR Apache-2.0 OR MIT", from:
https://github.com/google/zerocopy/tree/v0.8.50
The files are copied as-is, with no modifications whatsoever (not even
adding the SPDX identifiers).
The `benches` folder is added (i.e. not just `src` like in other cases)
since the files there are included in the rendered documentation,
as well as the `rustdoc` CSS style file that is needed to make those
visually more understandable.
For copyright details, please see:
https://github.com/google/zerocopy/blob/v0.8.50/README.md?plain=1
https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-BSD
https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-APACHE
https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-MIT
The next two patches modify these files as needed for use within the
kernel. This patch split allows reviewers to double-check the import
and to clearly see the differences introduced.
The following script may be used to verify the contents:
for path in $(cd rust/zerocopy/ && find . -type f); do
curl --silent --show-error --location \
https://github.com/google/zerocopy/raw/v0.8.50/$path \
| diff --unified rust/zerocopy/$path - && echo $path: OK
done
Cc: Joshua Liebow-Feeser <joshlf@google.com>
Cc: Jack Wrenn <jswrenn@google.com>
Link: https://patch.msgid.link/20260608141439.182634-9-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
80 lines
3.2 KiB
Plaintext
80 lines
3.2 KiB
Plaintext
Iterations: 100
|
|
Instructions: 2000
|
|
Total Cycles: 682
|
|
Total uOps: 2100
|
|
|
|
Dispatch Width: 4
|
|
uOps Per Cycle: 3.08
|
|
IPC: 2.93
|
|
Block RThroughput: 5.3
|
|
|
|
|
|
Instruction Info:
|
|
[1]: #uOps
|
|
[2]: Latency
|
|
[3]: RThroughput
|
|
[4]: MayLoad
|
|
[5]: MayStore
|
|
[6]: HasSideEffects (U)
|
|
|
|
[1] [2] [3] [4] [5] [6] Instructions:
|
|
1 1 0.50 lea eax, [rsi + rdi]
|
|
1 1 0.33 test al, 3
|
|
1 1 1.00 jne .LBB5_1
|
|
1 1 0.33 movabs rax, 9223372036854775804
|
|
1 1 0.33 and rax, rsi
|
|
1 1 0.33 cmp rax, 9
|
|
1 1 1.00 jae .LBB5_3
|
|
1 0 0.25 xor eax, eax
|
|
1 1 1.00 U ret
|
|
1 1 0.33 add rax, -9
|
|
1 1 0.33 movabs rcx, -6148914691236517205
|
|
2 4 1.00 mul rcx
|
|
1 1 0.50 shr rdx
|
|
1 1 0.50 lea rax, [rdx + 2*rdx]
|
|
1 1 0.33 sub rsi, rax
|
|
1 1 0.33 or rax, -4
|
|
1 1 0.33 add rsi, rdi
|
|
1 1 0.33 add rax, rsi
|
|
1 1 0.33 add rax, -8
|
|
1 1 1.00 U ret
|
|
|
|
|
|
Resources:
|
|
[0] - SBDivider
|
|
[1] - SBFPDivider
|
|
[2] - SBPort0
|
|
[3] - SBPort1
|
|
[4] - SBPort4
|
|
[5] - SBPort5
|
|
[6.0] - SBPort23
|
|
[6.1] - SBPort23
|
|
|
|
|
|
Resource pressure per iteration:
|
|
[0] [1] [2] [3] [4] [5] [6.0] [6.1]
|
|
- - 6.65 6.67 - 6.68 - -
|
|
|
|
Resource pressure by instruction:
|
|
[0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
|
|
- - 0.90 0.10 - - - - lea eax, [rsi + rdi]
|
|
- - 0.93 - - 0.07 - - test al, 3
|
|
- - - - - 1.00 - - jne .LBB5_1
|
|
- - 0.51 0.47 - 0.02 - - movabs rax, 9223372036854775804
|
|
- - - - - 1.00 - - and rax, rsi
|
|
- - - 0.09 - 0.91 - - cmp rax, 9
|
|
- - - - - 1.00 - - jae .LBB5_3
|
|
- - - - - - - - xor eax, eax
|
|
- - - - - 1.00 - - ret
|
|
- - 0.43 0.47 - 0.10 - - add rax, -9
|
|
- - 0.42 0.39 - 0.19 - - movabs rcx, -6148914691236517205
|
|
- - 1.00 1.00 - - - - mul rcx
|
|
- - 0.69 - - 0.31 - - shr rdx
|
|
- - 0.54 0.46 - - - - lea rax, [rdx + 2*rdx]
|
|
- - 0.07 0.91 - 0.02 - - sub rsi, rax
|
|
- - 0.91 0.05 - 0.04 - - or rax, -4
|
|
- - 0.08 0.90 - 0.02 - - add rsi, rdi
|
|
- - 0.09 0.91 - - - - add rax, rsi
|
|
- - 0.08 0.92 - - - - add rax, -8
|
|
- - - - - 1.00 - - ret
|