Skip to content

Conversation

MannarAmuthan
Copy link
Contributor

@MannarAmuthan MannarAmuthan commented Oct 5, 2023

In JIT, Implemented more comparison operations for boolean types, and added tests

  1. Verified with CPython implementation
  2. Added necessary Tests

@@ -348,6 +348,22 @@ impl<'a, 'b> FunctionCompiler<'a, 'b> {
.push(JitValue::Bool(self.builder.ins().bint(types::I8, val)));
Ok(())
}
(JitValue::Bool(a), JitValue::Bool(b)) => {
Copy link
Member

Choose a reason for hiding this comment

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

python bool is a subclass of int and they can be mixed in operations. This pattern looks like matching only for (bool, bool) operands. Isn't this better to be combined to (int, int) case? Then it will allows also (bool, int) or (int, bool) operations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah! Makes sense , will update it. Thanks for response !

@MannarAmuthan
Copy link
Contributor Author

This is done, Now both int and bool types can be compared.

Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

Thank you!

@youknowone
Copy link
Member

oh, could you run cargo fmt --all and rebase it on current main branch?

@MannarAmuthan
Copy link
Contributor Author

Sure

@MannarAmuthan
Copy link
Contributor Author

MannarAmuthan commented Oct 7, 2023

Hi , This is rebased with current main branch.
Thanks !

@youknowone
Copy link
Member

you may have forgot fetching upstream. rebased again.

@youknowone youknowone merged commit 2c3dbb5 into RustPython:main Oct 7, 2023
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