Skip to content

Add JIT compilation support for integer multiplication, division, and exponents#5561

Merged
coolreader18 merged 26 commits into
RustPython:mainfrom
dohear:int-mul/div-stable
Mar 5, 2025
Merged

Add JIT compilation support for integer multiplication, division, and exponents#5561
coolreader18 merged 26 commits into
RustPython:mainfrom
dohear:int-mul/div-stable

Conversation

@dohear

@dohear dohear commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

This PR adds JIT compilation support for:

  • Multiplication with two integers
  • Division with two integers
  • Exponents where the base and exponent are both integers

Summary of Changes:

  1. Added support for int multiplication and division in the BinOp match statement injit/src/instructions.rs
  2. Created a helper function (compile_ipow) for exponents due to additional calculation overhead
  3. Implemented unit tests for all three operations in jit/tests/int_tests.rs

@dohear dohear force-pushed the int-mul/div-stable branch from 9fe4a42 to 437a75b Compare March 3, 2025 19:45

@coolreader18 coolreader18 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@coolreader18 coolreader18 merged commit 58ebf04 into RustPython:main Mar 5, 2025
@dohear dohear deleted the int-mul/div-stable branch March 6, 2025 00:49
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.

5 participants