[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Jessica Clarke via cfe-commits
@@ -35,6 +35,8 @@ class RISCVTargetStreamer : public MCTargetStreamer { RISCVABI::ABI TargetABI = RISCVABI::ABI_Unknown; bool HasRVC = false; bool HasTSO = false; + bool HasZICFILP = false; jrtc27 wrote: Make the fields and methods all Zifoo

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Jessica Clarke via cfe-commits
@@ -118,6 +147,19 @@ void RISCVTargetELFStreamer::finish() { } MCA.setELFHeaderEFlags(EFlags); + + unsigned GNUNoteFlags = 0; + + // check ZICFILP or ZICFISS with features jrtc27 wrote: Not sure this adds anything, but if it's staying please properly

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Jessica Clarke via cfe-commits
@@ -118,6 +147,19 @@ void RISCVTargetELFStreamer::finish() { } MCA.setELFHeaderEFlags(EFlags); + + unsigned GNUNoteFlags = 0; + + // check ZICFILP or ZICFISS with features + // TODO should we check with codegen enable ex. -mllvm jrtc27 wrote: This

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Jessica Clarke via cfe-commits
@@ -5283,14 +5291,21 @@ static std::string getGNUProperty(uint32_t Type, uint32_t DataSize, OS << ""; return OS.str(); } + if (Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) { - DumpBit(GNU_PROPERTY_AARCH64_FEATURE_1_BTI, "BTI"); -

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Jessica Clarke via cfe-commits
@@ -85,6 +85,35 @@ void RISCVTargetELFStreamer::finishAttributeSection() { ELF::SHT_RISCV_ATTRIBUTES, AttributeSection); } +void RISCVTargetELFStreamer::emitNoteSection(unsigned Flags) { jrtc27 wrote: I know this is what AArch64

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Jessica Clarke via cfe-commits
@@ -5272,8 +5272,16 @@ static std::string getGNUProperty(uint32_t Type, uint32_t DataSize, return OS.str(); case GNU_PROPERTY_AARCH64_FEATURE_1_AND: case GNU_PROPERTY_X86_FEATURE_1_AND: -OS << ((Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) ? "aarch64 feature: " -

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Craig Topper via cfe-commits
topperc wrote: > Unless `lld/test/ELF` tests will get a failure, the `lld/` part should > ideally be dropped from this PR. This separation is a convention. > > Otherwise (a) with just a `[RISCV]` tag and (b) with many RISCV-specific > changes, lld folks (like I) might not notice this patch.

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,29 @@ +// When -march with zicfiss0p4 or zicfilp0p4 add GNU property to file object MaskRay wrote: This directory is for driver tests. Codegen tests should use `%clang_cc1` and be moved elsewhere (e.g. test/CodeGen)

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Fangrui Song via cfe-commits
MaskRay wrote: Unless `lld/test/ELF` tests will get a failure, the `lld/` part should ideally be dropped from this PR. lld folks (like I) might not notice this patch if there is just a `[RISCV]` tag. https://github.com/llvm/llvm-project/pull/77414

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Craig Topper via cfe-commits
@@ -468,6 +468,13 @@ static void checkOptions() { error("-z pauth-report only supported on AArch64"); } + if (config->emachine != EM_RISCV) { +if (config->zZicfilpReport != "none") + error("-z zicfilip-report only support on RISCV32/RISCV64");

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Craig Topper via cfe-commits
@@ -5272,8 +5272,16 @@ static std::string getGNUProperty(uint32_t Type, uint32_t DataSize, return OS.str(); case GNU_PROPERTY_AARCH64_FEATURE_1_AND: case GNU_PROPERTY_X86_FEATURE_1_AND: -OS << ((Type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) ? "aarch64 feature: " -

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Yeting Kuo via cfe-commits
yetingk wrote: I am sorry that I missed the commit for a long time. Very sorry about it. https://github.com/llvm/llvm-project/pull/77414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Yeting Kuo via cfe-commits
@@ -188,6 +188,8 @@ struct Config { StringRef zBtiReport = "none"; StringRef zCetReport = "none"; StringRef zPauthReport = "none"; + llvm::StringRef zZicfilpReport = "none"; yetingk wrote: Use `StringRef` instead of `llvm::StringRef`.

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Yeting Kuo via cfe-commits
@@ -7884,10 +7902,11 @@ template void LLVMELFDumper::printNotes() { W.printString("Type", "Unknown (" + to_string(format_hex(Type, 10)) + ")"); +uint16_t Target = this->Obj.getHeader().e_machine; yetingk wrote: Move this

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Yeting Kuo via cfe-commits
@@ -7884,10 +7902,11 @@ template void LLVMELFDumper::printNotes() { W.printString("Type", "Unknown (" + to_string(format_hex(Type, 10)) + ")"); +uint16_t Target = this->Obj.getHeader().e_machine; yetingk wrote: Is it better to

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread Yeting Kuo via cfe-commits
@@ -954,9 +954,18 @@ void readGnuProperty(const InputSection , ObjFile ) { continue; } -uint32_t featureAndType = config->emachine == EM_AARCH64 - ? GNU_PROPERTY_AARCH64_FEATURE_1_AND - :

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread via cfe-commits
https://github.com/SuHo-llrr ready_for_review https://github.com/llvm/llvm-project/pull/77414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread via cfe-commits
SuHo-llrr wrote: @yetingk I have updated to the latest version. If you have any suggestions, please let me know. https://github.com/llvm/llvm-project/pull/77414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-05-10 Thread via cfe-commits
https://github.com/SuHo-llrr updated https://github.com/llvm/llvm-project/pull/77414 >From 61aaf8df2fbd0abfa4dfcd807f3366ce67f5603d Mon Sep 17 00:00:00 2001 From: SuHsien Ho Date: Thu, 23 Nov 2023 14:36:43 +0800 Subject: [PATCH 1/5] [RISCV][ELF] Add RISCV GNU property label ---

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-03-01 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-risc-v Author: None (SuHo-llrr) Changes Emit Zicfiss/Zicfilp to .note.gnu.property sections 1. for spec v0.4.0 Zicifss/Zicfilp is AND feature means that all objects need to have this feature. 2. Emit note section when Zicifss/Zicfilp extension

[clang] [lld] [llvm] [RISCV] Support .note.gnu.property for enable Zicfiss and Zicfilp extension (PR #77414)

2024-03-01 Thread Kito Cheng via cfe-commits
https://github.com/kito-cheng edited https://github.com/llvm/llvm-project/pull/77414 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits