-
Notifications
You must be signed in to change notification settings - Fork 1
Instruction types refactor #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
- Coverage 42.03% 37.15% -4.89%
==========================================
Files 117 109 -8
Lines 4320 4481 +161
==========================================
- Hits 1816 1665 -151
- Misses 2418 2736 +318
+ Partials 86 80 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors instruction definition types across the gen and aarch64 packages to a new interface-based design, centralizes argument/target assertions, and consolidates validation and code generation logic.
- Introduce
Validatemethods onFileInfoandBasicBlockInfoand replace inline assertion functions with shared helpers ingen/assert.go. - Convert all AArch64 ISA definitions to implement
InstructionDefinitionwithOperator,Validate, andCodegenmethods. - Update codegen and translation layers to invoke the new interfaces and adjust imports accordingly.
Reviewed Changes
Copilot reviewed 75 out of 75 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| gen/file_generator.go | Use NewFileInfo + AppendFunction and validate early |
| gen/basic_block_info.go | Add Validate method to BasicBlockInfo |
| gen/assert.go | Centralize argument/target/integer assertions |
| aarch64/translation/targets.go | Remove duplicate AssertTargetsExactly implementation |
| aarch64/translation/instructions.go | Qualify assertions via gen import |
| aarch64/translation/arguments.go | Remove inline assertion implementations |
| aarch64/managers/instructions.go | Update instruction constructors to new names |
| aarch64/isa/*.go | Migrate all ISA files to new functional InstructionDefinition design |
| aarch64/isa/add_test.go | Update test helpers to return InstructionInfo + call Codegen |
| aarch64/codegen/instruction.go | Switch from Generate to Codegen on the instruction interface |
| aarch64/codegen/file.go | Adjust function index tracking for file codegen context |
Comments suppressed due to low confidence (4)
aarch64/isa/add.go:63
- Missing imports for "alon.kr/x/list" and "alon.kr/x/usm/core", which are required for
list.FromSingleandcore.Result.
return nil, list.FromSingle(core.Result{
aarch64/isa/subs.go:53
- The code uses
list.FromSingleandcore.Resultbut neither "alon.kr/x/list" nor "alon.kr/x/usm/core" is imported; add these imports.
return nil, list.FromSingle(core.Result{
aarch64/isa/bcond.go:61
- Missing imports for "alon.kr/x/list" and "alon.kr/x/usm/core" needed for
list.FromSingleandcore.Resultin the default case.
return nil, list.FromSingle(core.Result{
aarch64/isa/b.go:90
list.FromSingleandcore.Resultare referenced without importing "alon.kr/x/list" and "alon.kr/x/usm/core"; please add those imports.
return nil, list.FromSingle(core.Result{
Co-authored-by: Copilot <[email protected]>
Fixes #51