Skip to content

Conversation

@fennecJ
Copy link
Collaborator

@fennecJ fennecJ commented Aug 5, 2024

We can avoid using conditional branch via bitwise operation.
The value of ((val & (1 << 11)) << 1) is exactly 4096 if (val & (1 << 11)) is true.

We can avoid using conditional branch via bitwise operation.
The value of `((val & (1 << 11)) << 1)` is exactly 4096 if
`(val & (1 << 11))` is true.
@jserv jserv merged commit 13b828d into sysprog21:master Aug 5, 2024
@jserv
Copy link
Collaborator

jserv commented Aug 5, 2024

Thank @fennecJ for contributing!

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