Skip to content
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

x86: Code Generation Helpers #7632

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

BradleyWood
Copy link
Contributor

@BradleyWood BradleyWood commented Jan 30, 2025

Many patterns emerge when performing code generation work, such as loops, loading constants, broadcasting values, etc. This PR aims to address these common patterns by introducing reusable helpers, making the codebase cleaner, more maintainable, and easier to extend.

Helpers

  • Creation of Loop Generation Helpers – New helper functions streamline the generation of loops in code generation.
  • Relocation of Load Constant Helpers – Functions for loading constants have been moved into CodegenUtils to improve organization and reusability.
  • Introduction of Register Management Macros – Helper macros improve register handling, making code clearer and more maintainable.
  • Addition of SIMD Opcode Vector Length Helper – A new function determines the vector length for given SIMD opcodes, optimizing SIMD instruction generation.
  • Migration of Broadcast Logic to CodegenUtils – The logic for broadcasting values has been centralized within CodegenUtils, improving modularity.

@BradleyWood
Copy link
Contributor Author

@0xdaryl @hzongaro @a7ehuo @jdmpapin Can I get some high level opinions on the direction of this work? I don't need a full review at this time, but I want some opinions on this and what else, if anything, can be done to simplify various patterns in code-generation work.

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