This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support Zbpbo extension v0.9.11
Needs ReviewPublic

Authored by sunshaoce on Jun 26 2022, 3:32 AM.

Details

Summary

The Zbpbo extension is part of the P extension, and its instructions overlap with the B extension.
Details: https://github.com/riscv/riscv-p-spec/blob/master/P-ext-proposal.adoc#zbpbo

Diff Detail

Event Timeline

sunshaoce created this revision.Jun 26 2022, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2022, 3:32 AM
sunshaoce requested review of this revision.Jun 26 2022, 3:32 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 26 2022, 3:32 AM
sunshaoce updated this revision to Diff 440267.Jun 27 2022, 9:30 AM

Add more tests

Fully supported Zbpbo v0.9.11

sunshaoce retitled this revision from [WIP][RISCV] Support Zbpbo extension to [RISCV] Support Zbpbo extension.Jun 27 2022, 11:14 AM
sunshaoce edited the summary of this revision. (Show Details)
sunshaoce added inline comments.
llvm/lib/Support/RISCVISAInfo.cpp
352

Modifications here have been submitted separately in D128644.

craig.topper added inline comments.Jun 28 2022, 9:06 AM
clang/include/clang/Basic/BuiltinsRISCV.def
21

What's preventing __builtin_riscv_clz_32 from being used on rv64 with Zbpbo? I think you need to add it to isRISCV32Builtin in SemaChecking.cpp but you'll also need to check that Zbb isn't enabled.

sunshaoce marked an inline comment as done.

Address @craig.topper's comment. Thanks!

sunshaoce updated this revision to Diff 441052.Jun 29 2022, 9:30 AM

Add alias instructions

sunshaoce retitled this revision from [RISCV] Support Zbpbo extension to [RISCV] Support Zbpbo extension v0.9.11.Jul 3 2022, 2:34 AM
Jim added inline comments.Jul 11 2022, 1:05 AM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
467

FSR and FSRI only exist on RV32 for Zbpbo.

488

CLZ only exist on RV32 for Zbpbo.