Page MenuHomePhabricator

[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

Unit TestsFailed

TimeTest
60,050 msx64 debian > ThreadSanitizer-x86_64.ThreadSanitizer-x86_64::restore_stack.cpp
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=thread -Wall -m64 -msse4.2 -gline-tables-only -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/../ -std=c++11 -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/../ -O1 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/restore_stack.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/tsan/X86_64Config/Output/restore_stack.cpp.tmp && not /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/tsan/X86_64Config/Output/restore_stack.cpp.tmp 2>&1 | FileCheck /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/tsan/restore_stack.cpp

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
356

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.