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

compiler: add flag manipulation utilities #52269

Merged
merged 1 commit into from
Nov 23, 2023
Merged

compiler: add flag manipulation utilities #52269

merged 1 commit into from
Nov 23, 2023

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Nov 22, 2023

Right now, we're checking if a flag exists using bare operations like & and ==. This works fine, but I think unifying these interfaces could make our code easier to maintain. So, this commit introduces some new high-level operators and refactored the code to incorporate them:

  • has_flag(curr::UInt32, flag::UInt32)
  • has_flag(inst::Instruction, flag::UInt32)
  • add_flag!(inst::Instruction, flag::UInt32)
  • sub_flag!(inst::Instruction, flag::UInt32)

@nanosoldier runbenchmarks("inference", vs=":master")

@Keno @vtjnash @topolarity Are you fine with this?

@aviatesk aviatesk force-pushed the avi/flag-op branch 2 times, most recently from 2ebeef3 to 6a2bb23 Compare November 22, 2023 08:51
@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here.

Right now, we're checking if a flag exists using bare operations like
`&` and `==`. This works fine, but I think unifying these interfaces
could make our code easier to maintain. So, this commit introduces some
new high-level operators and refactored the code to incorporate them:
- `has_flag(curr::UInt32, flag::UInt32)`
- `add_flag!(inst::Instruction, flag::UInt32)`
- `add_flag!(inst::Instruction, flag::UInt32)`
- `sub_flag!(inst::Instruction, flag::UInt32)`
Copy link
Member

@topolarity topolarity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@aviatesk aviatesk merged commit 44b8983 into master Nov 23, 2023
7 checks passed
@aviatesk aviatesk deleted the avi/flag-op branch November 23, 2023 04:23
mkitti pushed a commit to mkitti/julia that referenced this pull request Dec 9, 2023
Right now, we're checking if a flag exists using bare operations like
`&` and `==`. This works fine, but I think unifying these interfaces
could make our code easier to maintain. So, this commit introduces some
new high-level operators and refactored the code to incorporate them:
- `has_flag(curr::UInt32, flag::UInt32)`
- `has_flag(inst::Instruction, flag::UInt32)`
- `add_flag!(inst::Instruction, flag::UInt32)`
- `sub_flag!(inst::Instruction, flag::UInt32)`
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.

4 participants