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

enum TxfmSize: Make a real enum #1240

Merged
merged 2 commits into from
Jun 24, 2024
Merged

enum TxfmSize: Make a real enum #1240

merged 2 commits into from
Jun 24, 2024

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Jun 24, 2024

This makes TxfmSize and RectTxfmSize into a real enum, which eliminates many bounds checks in hot fns like fn decode_ceofs. It also lets us further simplify the itx macros and eliminate the distinction between the Rect ones.

Note that TxfmSize defined the square sizes; these ones are named with an S prefix, while the R-prefixed RectTxfmSize stay R-prefixed.

There are a few new places where we have to create TxfmSizes using from_repr and thus do a bounds check. These should be pretty cheap, but there are optimizable out, as they ultimately come from static/const data whos bounds are known but LLVM is not able to deduce them. This is why I added 7f0cdc2, starting to try to fix this, though it's a little complicated, so I didn't want to finish it in this PR.

@kkysen kkysen requested a review from randomPoison June 24, 2024 00:57
@kkysen kkysen force-pushed the kkysen/enum-TxfmSize branch from 7f0cdc2 to 47326c0 Compare June 24, 2024 00:57
@kkysen kkysen merged commit e37bd30 into main Jun 24, 2024
26 checks passed
@kkysen kkysen deleted the kkysen/enum-TxfmSize branch June 24, 2024 19:36
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.

2 participants