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

[type] Use zext instruction to cast unsigned int #2066

Merged
merged 5 commits into from
Nov 29, 2020

Conversation

Hanke98
Copy link
Contributor

@Hanke98 Hanke98 commented Nov 27, 2020

Related issue = #1905 #1996
In this pr, I try to determine which extension instruction should be used when casting integers. According to my understanding, we should use zext for unsigned int, and sext for signed int.

Please note that, the original goal of this pr is to determine the instruction for CustomIntType. One CustomIntType should be loaded through GlobalLoadStmt first before casting. After loading, the CustomIntType would be a "normal"
integer type (the same type as its ComputeType). That is to say, we can simply treat the CustomIntType and primitive integer type equally here.

[Click here for the format server]


Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed analysis! LGTM.

taichi/codegen/codegen_llvm.cpp Show resolved Hide resolved
@yuanming-hu yuanming-hu merged commit ea8838f into taichi-dev:master Nov 29, 2020
@yuanming-hu yuanming-hu mentioned this pull request Nov 30, 2020
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