Skip to content

Conversation

@RealA10N
Copy link
Owner

This PR adds support for @global arguments, and in particular, adds support for global function references that are defined in the same file, to the aarch64 isa.

@RealA10N RealA10N added the core A core feature or change label Apr 26, 2025
@RealA10N RealA10N added this to the v0.1.0 milestone Apr 26, 2025
@RealA10N RealA10N requested a review from Copilot April 26, 2025 10:18
@RealA10N RealA10N self-assigned this Apr 26, 2025
@codecov
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

Attention: Patch coverage is 25.23810% with 157 lines in your changes missing coverage. Please review.

Project coverage is 42.69%. Comparing base (cd71600) to head (314df4d).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
aarch64/isa/bl.go 4.34% 44 Missing ⚠️
aarch64/translation/arguments.go 0.00% 32 Missing ⚠️
gen/file_generator.go 0.00% 23 Missing ⚠️
gen/function_generator.go 39.39% 17 Missing and 3 partials ⚠️
gen/global_argument_generator.go 16.66% 20 Missing ⚠️
gen/global_argument.go 0.00% 4 Missing ⚠️
gen/global_function_info.go 60.00% 4 Missing ⚠️
gen/function_global_generator.go 82.35% 2 Missing and 1 partial ⚠️
gen/global_map.go 78.57% 2 Missing and 1 partial ⚠️
gen/argument_generator.go 33.33% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #44      +/-   ##
==========================================
- Coverage   42.94%   42.69%   -0.25%     
==========================================
  Files         108      114       +6     
  Lines        4075     4246     +171     
==========================================
+ Hits         1750     1813      +63     
- Misses       2248     2349     +101     
- Partials       77       84       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a 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 adds support for global function references by introducing an abstraction for globals and integrating it into the generation and translation pipelines for the aarch64 ISA.

  • Introduces GlobalManager and GlobalInfo interfaces along with concrete implementations (GlobalMap and FunctionGlobalInfo).
  • Updates various generators and the aarch64 instruction definitions to support globals.
  • Integrates global argument and function global generators into the file and function generation workflows.

Reviewed Changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gen/global_map.go Implements GlobalMap but does not initialize its underlying map.
gen/global_manager.go Defines GlobalManager interface for global handling.
gen/global_info.go Introduces GlobalInfo interface for global entities.
gen/global_function_info.go Provides a function-specific global info implementation.
gen/global_argument_generator.go Adds global argument support to the argument generation workflow.
gen/global_argument.go Implements GlobalArgumentInfo for global arguments.
gen/generator.go Integrates GlobalManager into file generation contexts.
gen/function_info.go Extends FunctionInfo with a Declaration field for consistency.
gen/function_global_generator.go Adds generator for function global info objects.
gen/function_generator.go Updates function generation to retrieve global info using getFunctionInfo.
gen/file_generator.go Integrates global generation into the file generation process.
gen/argument_info.go Removes deprecated GetType, streamlining ArgumentInfo.
gen/argument_generator.go Expands argument generation to include global nodes.
aarch64/translation/arguments.go Adapts immediate conversion functions to work with the updated globals.
aarch64/managers/instructions.go Registers the new branch link (bl) instruction.
aarch64/managers/context.go Updates ManagerCreators to include GlobalManager support.
aarch64/isa/bl.go Implements the BL instruction using function global information.
Files not reviewed (2)
  • examples/aarch64/bl-chain.usm: Language not supported
  • examples/aarch64/for-loop.usm: Language not supported

@RealA10N RealA10N merged commit db996c4 into main Apr 26, 2025
3 of 5 checks passed
@RealA10N RealA10N deleted the basic-globals branch May 9, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core A core feature or change isa: aarch64

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants