Skip to content

Minor amd64 decoder tweaks#54

Merged
klauspost merged 1 commit into
minio:mainfrom
klauspost:decoder-tweaks
Jul 6, 2026
Merged

Minor amd64 decoder tweaks#54
klauspost merged 1 commit into
minio:mainfrom
klauspost:decoder-tweaks

Conversation

@klauspost

@klauspost klauspost commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator
  • Preshift copy2 value so it doesn't have to be predicted for common paths
  • Add 16+ offset overlap copy.

Summary by CodeRabbit

  • New Features
    • Improved decoding performance for large overlapping copies by adding an optimized path for larger offsets.
    • Enhanced fast-copy handling to reduce work during decoding of COPY operations with larger inputs.

* Preshift copy2 value so it doesn't have to be predicted for common paths
* Add 16+ offset overlap copy.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6f60f4cf-30d9-4eb4-9e7c-e003a1e4fb56

📥 Commits

Reviewing files that changed from the base of the PR and between c9c2bdf and afa803b.

📒 Files selected for processing (2)
  • _generate/gen.go
  • asm_amd64.s

📝 Walkthrough

Walkthrough

The COPY decoding generator now decides preload behavior from input margin instead of a fixed value, updates COPY 2 and COPY 3 shift handling, and adds a dedicated 16-byte overlap-copy path that is mirrored in the generated amd64 assembly.

Changes

COPY Decode Preload and Overlap Optimization

Layer / File(s) Summary
Dynamic preload flag and COPY 2/3 shift adjustments
_generate/gen.go, asm_amd64.s
preloadCopyVal is now computed from o.inputMargin > 4; COPY 2 and fused COPY 3 paths adjust shift amounts and offset/length extraction logic accordingly, with matching shift changes in the generated assembly's copy_2 sub-paths.
New 16-byte overlap copy path
_generate/gen.go, asm_amd64.s
A new _copy_overlap_16/decodeBlockAsm_fast_copy_overlap_16 path is added and dispatched for offsets >= 16, using 16-byte XMM loop copies with a final fix-up before falling back to the existing loop flow.

Estimated code review effort: 4 (Complex) | ~45 minutes

Poem

A rabbit hops through bytes so fast,
Sixteen at a time, the overlap's cast,
Shifts realigned with a preload's care,
XMM lanes copying pairs through the air,
Fix up the tail, then bound away — 🐇✨
Faster decoding, hip-hip-hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is generic and doesn't clearly describe the main decoder changes in this PR. Rename it to mention the key change, such as preshifting copy2 handling and adding overlap-copy support for offsets of 16+.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@minio minio deleted a comment from coderabbitai Bot Jul 6, 2026
@klauspost

Copy link
Copy Markdown
Collaborator Author

@coderabbitai There are no bug fixes, please fix summary.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

@klauspost, understood — I'll regenerate the summary to reflect that these are performance/optimization tweaks to the amd64 decoder (preshifting the copy2 value and adding overlap-copy support for offsets ≥16), not bug fixes.

User feedback: There are no bug fixes in this PR; the summary should describe it as decoder optimization/tweaks only.

✅ Action performed

Summary regeneration triggered.

@klauspost klauspost merged commit 0051ca9 into minio:main Jul 6, 2026
59 checks passed
@klauspost klauspost deleted the decoder-tweaks branch July 6, 2026 15:10
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