[clang] [RISCV] Use print-enabled-extensions to check the extensions of Andes n45/nx45/a45/ax45 cpus. NFC. (PR #140979)

2025-05-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/140979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Xqci Extensions v0.11.0 (PR #137881)

2025-05-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/137881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add `zihintpause` LLVM/Clang intrinsic (PR #139519)

2025-05-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/139519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Xqci Extensions v0.11.0 (PR #137881)

2025-05-09 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/137881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Xqci Extensions v0.11.0 (PR #137881)

2025-05-09 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/137881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Xqci Extensions v0.10.0 (PR #137881)

2025-05-09 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/137881 >From 77e11986173c1687db5694544337026badb37448 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Tue, 29 Apr 2025 14:28:43 -0700 Subject: [PATCH 1/3] [RISCV] Xqci Extensions v0.10.0 This updates all the extension

[clang] [llvm] [RISCV] Rename XCValu intrinsic name *_slet(u) to *_sle(u)) (PR #138498)

2025-05-05 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/138498 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Xqci Extensions v0.10.0 (PR #137881)

2025-04-29 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/137881 >From 77e11986173c1687db5694544337026badb37448 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Tue, 29 Apr 2025 14:28:43 -0700 Subject: [PATCH 1/2] [RISCV] Xqci Extensions v0.10.0 This updates all the extension

[clang] [llvm] [RISCV] Xqci Extensions v0.10.0 (PR #137881)

2025-04-29 Thread Sam Elliott via cfe-commits
https://github.com/lenary created https://github.com/llvm/llvm-project/pull/137881 This updates all the extensions to their version in the v0.10.0 spec. All changes from this version are already implemented or are not relevant to LLVM. This change also alphabetises the lists of Xqci extension

[clang] [llvm] [RISCV][NFC] Remove duplicate extensions from tt-ascalon-d8 CPU (PR #137865)

2025-04-29 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/137865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Remove duplicate extensions from tt-ascalon-d8 CPU (PR #137865)

2025-04-29 Thread Sam Elliott via cfe-commits
lenary wrote: If the `"-target-feature" "+sscofpmf"` was already present in the test output, just not looked for, then I think you should just mark this as `[NFC]`. https://github.com/llvm/llvm-project/pull/137865 ___ cfe-commits mailing list cfe-comm

[clang] [llvm] [RISCV] Xqccmp v0.3 (PR #137854)

2025-04-29 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/137854 >From f156620203b61fbe48c80b4b45c451f9a6c6eed9 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Tue, 29 Apr 2025 11:10:54 -0700 Subject: [PATCH 1/2] [RISCV] Xqccmp v0.3 --- clang/test/Driver/print-supported-ext

[clang] [llvm] [RISCV] Xqccmp v0.3 (PR #137854)

2025-04-29 Thread Sam Elliott via cfe-commits
https://github.com/lenary created https://github.com/llvm/llvm-project/pull/137854 All the changes for v0.2 and v0.3 are either already implemented, or irrelevant to the compiler implementation. >From f156620203b61fbe48c80b4b45c451f9a6c6eed9 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Tu

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-28 Thread Sam Elliott via cfe-commits
lenary wrote: I pushed an xfail as `31bd7a507152` and will look into the failures now. https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-28 Thread Sam Elliott via cfe-commits
lenary wrote: Sorry! I will look at it today. I'll push an xfail in the meantime, to get it green again. https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-25 Thread Sam Elliott via cfe-commits
@@ -200,6 +203,149 @@ static void emitSCSEpilogue(MachineFunction &MF, MachineBasicBlock &MBB, CFIInstBuilder(MBB, MI, MachineInstr::FrameDestroy).buildRestore(SCSPReg); } +// Insert instruction to swap mscratchsw with sp +static void emitSiFiveCLICStackSwap(MachineFunction

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-25 Thread Sam Elliott via cfe-commits
lenary wrote: I've resolved the merge conflict so I can merge this, now I'm back at work after some travel. I'll let some pre-commit checks run before I finally hit merge though. https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailin

[clang] [llvm] [RISCV] Add support for Ziccamoc (PR #136694)

2025-04-22 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM when there are release notes. https://github.com/llvm/llvm-project/pull/136694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary commented: Broadly happy, but I think two of the CSRs need to be 32-bit only, with tests. https://github.com/llvm/llvm-project/pull/136556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Sam Elliott via cfe-commits
@@ -482,6 +482,14 @@ def : SysReg<"sctrdepth", 0x15f>; def : SysReg<"vsctrctl", 0x24e>; def : SysReg<"mctrctl", 0x34e>; +//===--- +// Cycle and Instret privilege mode filtering (Smcntrpmf) +//===--

[clang] [llvm] [RISCV] Add smcntrpmf extension (PR #136556)

2025-04-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/136556 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NFC] Fix xmipscmov extension name (PR #135647)

2025-04-14 Thread Sam Elliott via cfe-commits
lenary wrote: Oh, can you rename this. It's definitely not NFC, and should have "[RISCV]" in the commit first line instead. https://github.com/llvm/llvm-project/pull/135647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

[clang] [llvm] [NFC] Fix xmipscmov extension name (PR #135647)

2025-04-14 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/135647 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-10 Thread Sam Elliott via cfe-commits
lenary wrote: @kito-cheng sorted, we now hard error (without a crash trace) if you try to combine frame pointers and preemptible interrupts https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread Sam Elliott via cfe-commits
@@ -940,6 +947,14 @@ struct RISCVOperand final : public MCParsedAsmOperand { [](int64_t Imm) { return Imm != INT64_MIN && isInt<5>(Imm - 1); }); } + bool isSImm18() const { return isBareSimmNLsbK<18, 0>(); } + + bool isSImm18Lsb0() const { return isBareSimmNLsb0<18

[clang] [llvm] [RISCV] Add Andes XAndesperf (Andes Performance) extension. (PR #135110)

2025-04-09 Thread Sam Elliott via cfe-commits
@@ -535,21 +540,29 @@ RISCVMCCodeEmitter::getImmOpValueSlist(const MCInst &MI, unsigned OpNo, } } -uint64_t -RISCVMCCodeEmitter::getImmOpValueAsr1(const MCInst &MI, unsigned OpNo, +template +unsigned +RISCVMCCodeEmitter::getImmOpValueAsrN(const MCInst &MI, unsigned OpNo,

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-04-07 Thread Sam Elliott via cfe-commits
lenary wrote: ping? https://github.com/llvm/llvm-project/pull/132481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 4fb9650 - [clang][docs] Release Note for RISC-V qci-(no)nest

2025-04-05 Thread Sam Elliott via cfe-commits
Author: Sam Elliott Date: 2025-03-24T13:04:00-07:00 New Revision: 4fb9650b21fc038ca044ac1ca7fcd5be0b44194a URL: https://github.com/llvm/llvm-project/commit/4fb9650b21fc038ca044ac1ca7fcd5be0b44194a DIFF: https://github.com/llvm/llvm-project/commit/4fb9650b21fc038ca044ac1ca7fcd5be0b44194a.diff L

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilb (Long Branch) extension (PR #131996)

2025-04-05 Thread Sam Elliott via cfe-commits
@@ -96,6 +96,21 @@ def simm32 : RISCVOp { }]; } +// A 32-bit signed immediate where the least significant bit is zero. +def simm32_lsb0 : Operand { + let ParserMatchClass = SImmAsmOperand<32, "Lsb0">; + let PrintMethod = "printBranchOperand"; + let EncoderMethod = "getImm

[clang] [llvm] [RISCV] Add Qualcomm uC Xqciio (External Input Output) extension (PR #132721)

2025-04-05 Thread Sam Elliott via cfe-commits
@@ -741,6 +750,28 @@ def QC_C_MILEAVERET : QCIRVInst16CI_NONE<0b10100, "qc.c.mileaveret">; } // Predicates = [HasVendorXqciint, IsRV32], hasSideEffects = 1 +let Predicates = [HasVendorXqciio, IsRV32] in { +let hasSideEffects = 1, mayLoad = 0, mayStore = 0 in { + def QC_OU

[clang] [llvm] [RISCV] Add Qualcomm uC Xqciio (External Input Output) extension (PR #132721)

2025-03-28 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/132721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomm uC Xqciio (External Input Output) extension (PR #132721)

2025-03-28 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/132721 >From 12e1667575a3b506c5758bd976134e11ccb77f5c Mon Sep 17 00:00:00 2001 From: Harsh Chandel Date: Mon, 24 Mar 2025 16:15:20 +0530 Subject: [PATCH 1/4] [RISCV] Add Qualcomm uC Xqciio (External Input Output) exten

[clang] [llvm] [RISCV] Add Qualcomm uC Xqciio (External Input Output) extension (PR #132721)

2025-03-28 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/132721 >From 12e1667575a3b506c5758bd976134e11ccb77f5c Mon Sep 17 00:00:00 2001 From: Harsh Chandel Date: Mon, 24 Mar 2025 16:15:20 +0530 Subject: [PATCH 1/3] [RISCV] Add Qualcomm uC Xqciio (External Input Output) exten

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-27 Thread Sam Elliott via cfe-commits
@@ -486,6 +486,24 @@ def : SysReg<"mctrctl", 0x34e>; // Vendor CSRs //===--- +// XSfmclic +let FeaturesRequired = [{ {RISCV::FeatureVendorXSfmclic} }] in { +def : SysReg<"mtvt", 0x307>; +def : SysReg<"mnxti", 0x345>; +def : SysReg<"m

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary commented: I commented about the predicates (before i saw the other comments). I thought they'd be ok to do in a follow-up, but you should just to the refactoring now as it won't quite be NFC as I expected. https://github.com/llvm/llvm-project/pull/132259

[clang] [llvm] [RISCV] Add Qualcomm uC Xqciio (External Input Output) extension (PR #132721)

2025-03-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/132721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [RISCV] Make RequiredExtensions for intrinsics scalable to more than 32 extensions. NFC (PR #132895)

2025-03-25 Thread Sam Elliott via cfe-commits
lenary wrote: Do you hit the same problem with `llvm::Bitset` as you do with `std::bitset`. https://github.com/llvm/llvm-project/pull/132895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] Revert "Revert "[RISCV] Add Qualcomm uC Xqcisync (Sync Delay) extensi… (PR #132520)

2025-03-22 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/132520 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-21 Thread Sam Elliott via cfe-commits
@@ -230,10 +230,16 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) { // with stack arguments. TFI->spillFPBP(MF); + LLVM_DEBUG(llvm::dbgs() << "Before calculateCallFrameInfo \n"); lenary wrote: Oh yeah, oops, lots of it. will remove. https://gith

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-21 Thread Sam Elliott via cfe-commits
@@ -1502,6 +1659,9 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF, auto *RVFI = MF.getInfo(); if (RVFI->isPushable(MF) && SavedRegs.test(RISCV::X26)) SavedRegs.set(RISCV::X27); + + // SiFive Preemptible Interrupt Handlers need additional frame en

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-21 Thread Sam Elliott via cfe-commits
@@ -1502,6 +1659,9 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF, auto *RVFI = MF.getInfo(); if (RVFI->isPushable(MF) && SavedRegs.test(RISCV::X26)) SavedRegs.set(RISCV::X27); + + // SiFive Preemptible Interrupt Handlers need additional frame en

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-21 Thread Sam Elliott via cfe-commits
lenary wrote: For Info, the last time this was proposed was in 2020: https://reviews.llvm.org/D79521 - at that time, no vendor extensions had been accepted upstream, and there was not yet a policy for upstream supporting vendor extensions. https://github.com/llvm/llvm-project/pull/132481

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-21 Thread Sam Elliott via cfe-commits
lenary wrote: > Is there a reason why these aren't lowercase like the rest? They match the existing names documented in https://starfivetech.com/uploads/sifive-interrupt-cookbook-v1p2.pdf - we could check them in clang case-insensitively, though. https://github.com/llvm/llvm-project/pull/1324

[clang] [llvm] [RISCV] SiFive CLIC Support (PR #132481)

2025-03-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary created https://github.com/llvm/llvm-project/pull/132481 This Change adds support for two SiFive vendor attributes in clang: - "SiFive-CLIC-preemptible" - "SiFive-CLIC-stack-swap" These can be given together, and can be combined with "machine", but cannot be combined w

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcisync (Sync Delay) extension (PR #132184)

2025-03-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM. Thanks Harsh! https://github.com/llvm/llvm-project/pull/132184 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Sam Elliott via cfe-commits
@@ -378,6 +370,14 @@ def FeatureStdExtZca "part of the C extension, excluding compressed " "floating point loads/stores">; +def FeatureStdExtC +: RISCVExtension<2, 0, "Compressed Instructions", [FeatureStdExtZca]>, + RISCVExte

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM, with one comment. https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-21 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
@@ -856,6 +856,19 @@ void RISCVISAInfo::updateImplication() { }); } + // Add Zcd if C and D are enabled. + if (Exts.count("c") && Exts.count("d") && !Exts.count("zcd")) { +auto Version = findDefaultVersion("zcd"); +Exts["zcd"] = *Version; + } + +

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
@@ -378,6 +370,14 @@ def FeatureStdExtZca "part of the C extension, excluding compressed " "floating point loads/stores">; +def FeatureStdExtC +: RISCVExtension<2, 0, "Compressed Instructions", [FeatureStdExtZca]>, + RISCVExte

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/132259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Implement the implications of C extension (PR #132259)

2025-03-20 Thread Sam Elliott via cfe-commits
@@ -25,8 +25,8 @@ addi a0, a1, 0 # CHECK: # encoding: [0xe0,0x1f] addi s0, sp, 1020 -# CHECK: .option arch, -c -.option arch, -c +# CHECK: .option arch, -c, -zca +.option arch, -c, -zca lenary wrote: This is because your predicates need a little bit of work,

[clang] [clang][AArch64] Don't #define __ARM_FEATURE_CRC32 when -crc is specified in -target-feature (PR #132167)

2025-03-20 Thread Sam Elliott via cfe-commits
lenary wrote: There are lots of bugs like this in this area, this is not the only feature like this. Should this be fixed in a more general way? https://github.com/llvm/llvm-project/pull/132167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [llvm] [RISCV] Add Zilsd and Zclsd Extensions (PR #131094)

2025-03-19 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/131094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilb (Long Branch) extension (PR #131996)

2025-03-19 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM but Craig may have more comments. https://github.com/llvm/llvm-project/pull/131996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcilb (Long Branch) extension (PR #131996)

2025-03-19 Thread Sam Elliott via cfe-commits
@@ -96,6 +96,21 @@ def simm32 : RISCVOp { }]; } +// A 32-bit signed immediate where the least significant bit is zero. +def simm32_lsb0 : Operand { + let ParserMatchClass = SImmAsmOperand<32, "Lsb0">; + let PrintMethod = "printBranchOperand"; + let EncoderMethod = "getImm

[clang] [llvm] [RISCV] Add Zilsd and Zclsd Extensions (PR #131094)

2025-03-19 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/131094 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Zilsd and Zclsd Extensions (PR #131094)

2025-03-18 Thread Sam Elliott via cfe-commits
@@ -401,6 +408,14 @@ def FeatureStdExtZcf "Compressed Single-Precision Floating-Point Instructions", [FeatureStdExtF, FeatureStdExtZca]>; +def FeatureStdExtZclsd +: RISCVExtension<1, 0, + "Compressed Load/Store

[clang] [llvm] [RISCV] Add Zilsd and Zclsd Extensions (PR #131094)

2025-03-18 Thread Sam Elliott via cfe-commits
@@ -780,6 +780,14 @@ Error RISCVISAInfo::checkDependency() { return getIncompatibleError("xwchc", "zcb"); } + if (Exts.count("zclsd") != 0) { +if (XLen != 32) + return getError("'zclsd' is only supported for 'rv32'"); + +if (Exts.count("zcf") != 0) +

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcisim (Simulation Hint) extension (PR #128833)

2025-03-18 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/128833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcisim (Simulation Hint) extension (PR #128833)

2025-03-18 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/128833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Update to Xqciint v0.4 (PR #130219)

2025-03-15 Thread Sam Elliott via cfe-commits
https://github.com/lenary created https://github.com/llvm/llvm-project/pull/130219 The Xqci 0.7.0 spec just came out, with some updates to Xqciint, bringing it to v0.4. The main update of any relevance is that `qc.c.mienter` and `qc.c.mienter.nest` now update both the stack pointer and the fra

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcisim (Simulation Hint) extension (PR #128833)

2025-03-13 Thread Sam Elliott via cfe-commits
lenary wrote: > Is there any documentation thats say what instructions these hint encodings > belong to? Not explicitly, but these overlap with `SLTI` and `C.SLLI` if I'm reading our docs correctly. We do intend to move these to use aliases, but we'd like to land them like this first. https:

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcisim (Simulation Hint) extension (PR #128833)

2025-03-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM. I think we've given plenty of time for further comments on supporting this extension (or not), and given last I heard on the call that @asb was happy for this to land, I think we should proceed. https://github.com/llvm/llvm-project/p

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcibi (Branch Immediate) extension (PR #130779)

2025-03-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/130779 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][driver][NFC] Remove else after return (PR #131182)

2025-03-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. https://github.com/llvm/llvm-project/pull/131182 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomn uC Xqcili (load large immediates) extension (PR #130012)

2025-03-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/130012 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomn uC Xqcili (load large immediates) extension (PR #130012)

2025-03-13 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM. Thank you for doing this PR for Xqcili support, it's great to see interest in this from the RISC-V community beyond Qualcomm. In future, it would be great to coordinate on what you are planning to upstream, as we (Qualcomm) have down

[clang] [llvm] [RISCV] Add Qualcomn uC Xqcili (load large immediates) extension (PR #130012)

2025-03-11 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/130012 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Update to Xqciint v0.4 (PR #130219)

2025-03-11 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/130219 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Update to Xqciint v0.4 (PR #130219)

2025-03-06 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/130219 >From 30cc00694a8c1d57f201101121d008e89444743a Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Thu, 6 Mar 2025 17:25:44 -0800 Subject: [PATCH 1/2] [RISCV] Update to Xqciint v0.4 The Xqci 0.7.0 spec just came ou

[clang] [llvm] [RISCV] QCI Interrupt Support (PR #129957)

2025-03-06 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/129957 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] QCI Interrupt Support (PR #129957)

2025-03-05 Thread Sam Elliott via cfe-commits
@@ -382,6 +410,10 @@ void RISCVFrameLowering::determineFrameLayout(MachineFunction &MF) const { // Get the number of bytes to allocate from the FrameInfo. uint64_t FrameSize = MFI.getStackSize(); + // QCI Interrupts use at least 96 bytes of stack space + if (RVFI->useQC

[clang] [llvm] [RISCV] QCI Interrupt Support (PR #129957)

2025-03-05 Thread Sam Elliott via cfe-commits
@@ -2116,6 +2214,11 @@ bool RISCVFrameLowering::canUseAsEpilogue(const MachineBasicBlock &MBB) const { MachineBasicBlock *TmpMBB = const_cast(&MBB); const auto *RVFI = MF->getInfo(); + // Qe do not want QC.C.MILEAVERET to be subject to shrink-wrapping - it must -

[clang] [llvm] [RISCV] QCI Interrupt Support (PR #129957)

2025-03-05 Thread Sam Elliott via cfe-commits
@@ -2828,8 +2828,17 @@ targets. This attribute may be attached to a function definition and instructs the backend to generate appropriate function entry/exit code so that it can be used directly as an interrupt service routine. -Permissible values for this parameter are ``sup

[clang] [llvm] [RISCV] QCI Interrupt Support (PR #129957)

2025-03-05 Thread Sam Elliott via cfe-commits
@@ -20831,9 +20831,20 @@ SDValue RISCVTargetLowering::LowerFormalArguments( StringRef Kind = MF.getFunction().getFnAttribute("interrupt").getValueAsString(); -if (!(Kind == "supervisor" || Kind == "machine")) +constexpr StringRef SupportedInterruptKinds[] = {

[clang] [llvm] [RISCV] QCI Interrupt Support (PR #129957)

2025-03-05 Thread Sam Elliott via cfe-commits
@@ -1892,9 +1970,23 @@ bool RISCVFrameLowering::spillCalleeSavedRegisters( if (MI != MBB.end() && !MI->isDebugInstr()) DL = MI->getDebugLoc(); - // Emit CM.PUSH with base SPimm & evaluate Push stack RISCVMachineFunctionInfo *RVFI = MF->getInfo(); - if (RVFI->isPusha

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-03-05 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/128815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Remove Last Traces of User Interrupts (PR #129300)

2025-03-03 Thread Sam Elliott via cfe-commits
https://github.com/lenary created https://github.com/llvm/llvm-project/pull/129300 These were left over from when Craig removed `__attribute__((interrupt("user")))` support in 05d0caef6081e1a6cb23a5a5afe43dc82e8ca558. The tests change "interrupt"="user" into "interrupt"="machine" as they are

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-03-01 Thread Sam Elliott via cfe-commits
@@ -974,17 +974,20 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF, emitCFIForCSI(MBB, MBBI, getUnmanagedCSI(MF, CSI)); // Generate new FP. - if (hasFP(MF) && RVFI->getPushPopKind(MF) != - RISCVMachineFunctionInfo::PushPopKind::VendorXqc

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-02-27 Thread Sam Elliott via cfe-commits
lenary wrote: @topperc the two useful changes since you last reviewed are: - Adding a Release Note - Changing the conditions around frame pointers to ensure we don't emit a `add s0, sp, -` (as before), but that we do emit the `.cfi_def_cfa s0, 0` which informs dwarf/cfi that the way to calculat

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-26 Thread Sam Elliott via cfe-commits
https://github.com/lenary closed https://github.com/llvm/llvm-project/pull/128731 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Qualcomm uC Xqcisim (Simulation Hint) extension (PR #128833)

2025-02-26 Thread Sam Elliott via cfe-commits
https://github.com/lenary commented: Looks good with Craig's requested changes. https://github.com/llvm/llvm-project/pull/128833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-26 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/128731 >From 6f8c6d152033505db6f6b1f8a424c01fcfc05c0d Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Mon, 24 Feb 2025 23:07:05 -0800 Subject: [PATCH 1/8] [RISCV] Add Xqccmp Assembly Support Xqccmp is a new spec by Qu

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-26 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/128731 >From 6f8c6d152033505db6f6b1f8a424c01fcfc05c0d Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Mon, 24 Feb 2025 23:07:05 -0800 Subject: [PATCH 1/8] [RISCV] Add Xqccmp Assembly Support Xqccmp is a new spec by Qu

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-02-26 Thread Sam Elliott via cfe-commits
@@ -783,6 +783,54 @@ void RISCVFrameLowering::allocateStack(MachineBasicBlock &MBB, } } +static bool isPush(unsigned Opcode) { + switch (Opcode) { + case RISCV::CM_PUSH: + case RISCV::QC_CM_PUSH: + case RISCV::QC_CM_PUSHFP: +return true; + default: +return fals

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-02-26 Thread Sam Elliott via cfe-commits
@@ -783,6 +783,54 @@ void RISCVFrameLowering::allocateStack(MachineBasicBlock &MBB, } } +static bool isPush(unsigned Opcode) { + switch (Opcode) { + case RISCV::CM_PUSH: + case RISCV::QC_CM_PUSH: + case RISCV::QC_CM_PUSHFP: +return true; + default: +return fals

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-02-25 Thread Sam Elliott via cfe-commits
@@ -141,9 +141,38 @@ class RISCVMachineFunctionInfo : public MachineFunctionInfo { // We cannot use fixed locations for the callee saved spill slots if the // function uses a varargs save area. // TODO: Use a separate placement for vararg registers to enable Zcmp.

[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

2025-02-25 Thread Sam Elliott via cfe-commits
@@ -120,12 +144,7 @@ bool RISCVPushPopOpt::runOnMachineFunction(MachineFunction &Fn) { // If Zcmp extension is not supported, abort. const RISCVSubtarget *Subtarget = &Fn.getSubtarget(); - if (!Subtarget->hasStdExtZcmp()) -return false; - - // If frame pointer elimi

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/128731 >From 6f8c6d152033505db6f6b1f8a424c01fcfc05c0d Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Mon, 24 Feb 2025 23:07:05 -0800 Subject: [PATCH 1/7] [RISCV] Add Xqccmp Assembly Support Xqccmp is a new spec by Qu

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/128731 >From 6f8c6d152033505db6f6b1f8a424c01fcfc05c0d Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Mon, 24 Feb 2025 23:07:05 -0800 Subject: [PATCH 1/6] [RISCV] Add Xqccmp Assembly Support Xqccmp is a new spec by Qu

[clang] [llvm] [RISCV] Xqcia 0.4 Spec renamed qc.(sla/sll)sat to qc.(shl/shlu)sat (PR #128710)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary approved this pull request. LGTM. I edited the description for readability, so please use it as the message when squashing this PR. https://github.com/llvm/llvm-project/pull/128710 ___ cfe-commits mailing list cfe-commits@lis

[clang] [llvm] [RISCV] Xqcia 0.4 Spec renamed qc.(sla/sll)sat to qc.(shl/shlu)sat (PR #128710)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/128710 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][MC] Add assembler support for XRivosVisni (PR #128773)

2025-02-25 Thread Sam Elliott via cfe-commits
@@ -25,3 +65,27 @@ defm RI_VZIP2B_V : VALU_IV_V<"ri.vzip2b", 0b010100>; defm RI_VUNZIP2A_V : VALU_IV_V<"ri.vunzip2a", 0b001000>; defm RI_VUNZIP2B_V : VALU_IV_V<"ri.vunzip2b", 0b011000>; } + +//===--===// +// XR

[clang] [llvm] [RISCV][MC] Add assembler support for XRivosVisni (PR #128773)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary edited https://github.com/llvm/llvm-project/pull/128773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [RISCV][MC] Add assembler support for XRivosVisni (PR #128773)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary commented: Only one nit, otherwise looks good I think. I didn't closely inspect the encodings. https://github.com/llvm/llvm-project/pull/128773 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-25 Thread Sam Elliott via cfe-commits
@@ -0,0 +1,35 @@ +# RUN: not llvm-mc -triple=riscv32 -mattr=+experimental-xqccmp -M no-aliases -show-encoding < %s 2>&1 \ +# RUN: | FileCheck -check-prefixes=CHECK-ERROR %s + +# CHECK-ERROR: error: invalid operand for instruction +qc.cm.mvsa01 a1, a2 + +# CHECK-ERROR: error:

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-25 Thread Sam Elliott via cfe-commits
@@ -0,0 +1,95 @@ +//=== RISCVInstrInfoXqccmp.td --*- tablegen -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [RISCV] Add Xqccmp Assembly Support (PR #128731)

2025-02-25 Thread Sam Elliott via cfe-commits
https://github.com/lenary updated https://github.com/llvm/llvm-project/pull/128731 >From 6f8c6d152033505db6f6b1f8a424c01fcfc05c0d Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Mon, 24 Feb 2025 23:07:05 -0800 Subject: [PATCH 1/6] [RISCV] Add Xqccmp Assembly Support Xqccmp is a new spec by Qu

  1   2   3   >