-
Notifications
You must be signed in to change notification settings - Fork 166
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
Implemented Lshift #2556
base: main
Are you sure you want to change the base?
Implemented Lshift #2556
Conversation
integration_tests/CMakeLists.txt
Outdated
@@ -816,6 +816,7 @@ RUN(NAME callback_04 IMPORT_PATH .. LABELS cpython) | |||
# Intrinsic Functions | |||
RUN(NAME intrinsics_01 LABELS cpython llvm NOFAST) # any | |||
RUN(NAME intrinsics_02 LABELS cpython llvm c) # floordiv | |||
RUN(NAME intrinsics_03 LABELS llvm) # lshift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN(NAME intrinsics_03 LABELS llvm) # lshift | |
RUN(NAME intrinsics_03 LABELS cpython llvm) # lshift |
This verifies that the test works with python as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the comment below: #2556 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have left some comments.
Please mark this PR ready for review once it is ready. |
The test fails for cpython, may I please know the reason. The error is:
The file runs when I do Do I need to make more additions to some files? |
It fails because, python doesn't have builtin lshift support. I think it needs to be imported from the operator module, see: https://docs.python.org/3/library/operator.html#operator.lshift. Something like: from operator import lshift
print(lshift(x, y)) Does |
Yes, |
I want lshift to be imported only for the python test. For LPython's implementation, I want the control to be redirected to my intrinsic function. How can I achieve this? |
I thought this would be a good one to get started with LPython implementations.
Reference: https://docs.python.org/3/library/operator.html#operator.lshift