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

Refactor - Improve load immediate machinecode efficiency in JIT #641

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Dec 5, 2024

No description provided.

@Lichtso Lichtso requested a review from LucasSte December 5, 2024 12:20
src/jit.rs Outdated
OperandSize::S64 if value >= i32::MIN as i64 && value <= i32::MAX as i64 => {
let key = self.diversification_rng.gen::<i32>() as i64;
self.emit_ins(X86Instruction::load_immediate(size, destination, value.wrapping_sub(key)));
self.emit_ins(X86Instruction::load_immediate(OperandSize::S64, destination, value.wrapping_sub(key)));
Copy link

Choose a reason for hiding this comment

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

Changing the size parameter in these calls has no effect, because you are already matching the size to OperandSize::S64 in the match statement. Perhaps we should leave size there for consistency?

Copy link
Author

Choose a reason for hiding this comment

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

The size parameter was removed so it has to be explicit now.

@Lichtso Lichtso merged commit ba886be into main Dec 5, 2024
12 checks passed
@Lichtso Lichtso deleted the refactor/improve_load_immediate_encoding_efficiency branch December 5, 2024 15:19
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