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

optimization: down cast integers #53

Open
bradyrussell opened this issue Nov 25, 2020 · 0 comments
Open

optimization: down cast integers #53

bradyrussell opened this issue Nov 25, 2020 · 0 comments

Comments

@bradyrussell
Copy link
Owner

if an integer is pushed that could fit into a smaller integer type (64 - > 32 -> 8) prefer to push the smallest type then convert

push 6 (int32)
010400000006

optimized to
0101062A
(push 0x06 convert8to32)

push 6 (int64)
01080000000000000006

optimized to
0101062A2D
(push 0x06 convert8to32 convert32to64)

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

No branches or pull requests

1 participant