mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02: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>
66 lines
2.3 KiB
Plaintext
66 lines
2.3 KiB
Plaintext
Iterations: 100
|
|
Instructions: 1300
|
|
Total Cycles: 377
|
|
Total uOps: 1400
|
|
|
|
Dispatch Width: 4
|
|
uOps Per Cycle: 3.71
|
|
IPC: 3.45
|
|
Block RThroughput: 3.5
|
|
|
|
|
|
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.33 mov rcx, rsi
|
|
1 1 0.33 cmp rsi, 6
|
|
1 1 1.00 jne .LBB5_2
|
|
1 5 0.50 * mov eax, dword ptr [rdi]
|
|
1 5 0.50 * movzx ecx, word ptr [rdi + 4]
|
|
1 1 0.50 shl rcx, 32
|
|
1 1 0.33 or rcx, rax
|
|
1 1 0.50 shl rcx, 16
|
|
1 1 0.33 inc rcx
|
|
1 0 0.25 xor eax, eax
|
|
1 1 0.33 cmp rsi, 6
|
|
2 2 0.67 cmove rax, rcx
|
|
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]
|
|
- - 3.66 3.67 - 3.67 1.00 1.00
|
|
|
|
Resource pressure by instruction:
|
|
[0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions:
|
|
- - 0.63 0.36 - 0.01 - - mov rcx, rsi
|
|
- - 0.05 0.05 - 0.90 - - cmp rsi, 6
|
|
- - - - - 1.00 - - jne .LBB5_2
|
|
- - - - - - - 1.00 mov eax, dword ptr [rdi]
|
|
- - - - - - 1.00 - movzx ecx, word ptr [rdi + 4]
|
|
- - 0.97 - - 0.03 - - shl rcx, 32
|
|
- - 0.02 0.35 - 0.63 - - or rcx, rax
|
|
- - 0.98 - - 0.02 - - shl rcx, 16
|
|
- - - 0.98 - 0.02 - - inc rcx
|
|
- - - - - - - - xor eax, eax
|
|
- - 0.03 0.93 - 0.04 - - cmp rsi, 6
|
|
- - 0.98 1.00 - 0.02 - - cmove rax, rcx
|
|
- - - - - 1.00 - - ret
|