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

Use target independent builtins #104

Conversation

adeel10x
Copy link
Contributor

@adeel10x adeel10x commented Jan 17, 2024

This PR is not ready for the merge because I haven't covered all possible corev bitmanip builtins yet. For now, only the __builtin_riscv_cv_bitmanip_ror has been replaced with the target independent __builtin_rotateright32.
I am creating a PR so that concerned developers can review the code that has been pushed so far and provide their valuable feedback.

…endent __builtin_rotateright32. Consequently, the definitions of __builtin_riscv_cv_bitmanip_ror and the intrinsic int_riscv_cv_bitmanip_ror were removed, and relevant tests in clang and llvm were updated.
…or. In previous patch, Pat class was used directly
} else {
setOperationAction({ISD::ROTL, ISD::ROTR}, XLenVT, Expand);

if (!Subtarget.hasExtXcvbitmanip()) {
Copy link
Contributor Author

@adeel10x adeel10x Jan 17, 2024

Choose a reason for hiding this comment

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

@PaoloS02 This is something you might want to have a look at.
I have edited this code because RISCV Base ISA doesn't have a rotate right instruction and thus during legalization, it expands the ROTR operation into a combination of other supported operations (srl, neg, sll ,or).

@PaoloS02 PaoloS02 merged commit ec3e84e into openhwgroup:development Feb 2, 2024
3 of 4 checks passed
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