[LLVMdev] [PATCH][REQUEST] Could someone submit this CSR Kalimba definitions patch please?

Matthew Gardiner mg11 at csr.com
Tue Jul 8 22:39:11 PDT 2014


Hello LLVMdev!!

Yesterday I posted a patch request to the llvm-commits list requesting 
that someone could apply a patch to Triple.h and Triple.cpp for me. I 
didn't get any response so I wondered whether I should have posted to 
this list instead.

My story is as follows: we are trying to get lldb/llvm support for CSRs 
range of Kalimba DSPs. Eventually we are planning to hire someone to 
write an LLVM backend for the core, but currently we/I are making to do 
with porting lldb to debug Kalimba chips via a bespoke gdbserver 
implementation.

In order to get lldb to recognise Kalimba DSPs I have had to add 
definitions for kalimba as an architecture and CSR as a vendor to 
Triple.h and Triple.cpp. So I have produced a patch with these changes 
and I wondered if anyone would be able to submit the patch for me?

If I am requesting this patch application in the wrong way, could 
someone point out to me the correct patch request process?

Patch pasted on bottom of mail and file attached.

thank you
Matthew Gardiner

    Index: include/llvm/ADT/Triple.h
===================================================================
--- include/llvm/ADT/Triple.h	(revision 212519)
+++ include/llvm/ADT/Triple.h	(working copy)
@@ -76,24 +76,9 @@
      le32,       // le32: generic little-endian 32-bit CPU (PNaCl / 
Emscripten)
      amdil,      // amdil: amd IL
      spir,       // SPIR: standard portable IR for OpenCL 32-bit version
-    spir64      // SPIR: standard portable IR for OpenCL 64-bit version
+    spir64,     // SPIR: standard portable IR for OpenCL 64-bit version
+    kalimba     // Kalimba: generic kalimba
    };
-  enum SubArchType {
-    NoSubArch,
-
-    ARMSubArch_v8,
-    ARMSubArch_v7,
-    ARMSubArch_v7em,
-    ARMSubArch_v7m,
-    ARMSubArch_v7s,
-    ARMSubArch_v6,
-    ARMSubArch_v6m,
-    ARMSubArch_v6t2,
-    ARMSubArch_v5,
-    ARMSubArch_v5te,
-    ARMSubArch_v4t,
-    ARMSubArch_v4
-  };
    enum VendorType {
      UnknownVendor,

@@ -104,7 +89,8 @@
      BGQ,
      Freescale,
      IBM,
-    NVIDIA
+    NVIDIA,
+    CSR
    };
    enum OSType {
      UnknownOS,
@@ -164,9 +150,6 @@
    /// The parsed arch type.
    ArchType Arch;

-  /// The parsed subarchitecture type.
-  SubArchType SubArch;
-
    /// The parsed vendor type.
    VendorType Vendor;

@@ -209,9 +192,6 @@
    /// getArch - Get the parsed architecture type of this triple.
    ArchType getArch() const { return Arch; }

-  /// getSubArch - get the parsed subarchitecture type for this triple.
-  SubArchType getSubArch() const { return SubArch; }
-
    /// getVendor - Get the parsed vendor type of this triple.
    VendorType getVendor() const { return Vendor; }

Index: lib/ExecutionEngine/IntelJITEvents/jitprofiling.c
===================================================================
--- lib/ExecutionEngine/IntelJITEvents/jitprofiling.c	(revision 212519)
+++ lib/ExecutionEngine/IntelJITEvents/jitprofiling.c	(working copy)
@@ -30,7 +30,7 @@

  #include "jitprofiling.h"

-static const char rcsid[] = "\n@(#) $Revision: 243501 $\n";
+static const char rcsid[] = "\n@(#) $Revision: #4 $\n";

  #define DLL_ENVIRONMENT_VAR             "VS_PROFILER"

Index: lib/Support/Triple.cpp
===================================================================
--- lib/Support/Triple.cpp	(revision 212519)
+++ lib/Support/Triple.cpp	(working copy)
@@ -50,6 +50,7 @@
    case amdil:       return "amdil";
    case spir:        return "spir";
    case spir64:      return "spir64";
+  case kalimba:     return "kalimba";
    }

    llvm_unreachable("Invalid ArchType!");
@@ -101,6 +102,7 @@
    case amdil:       return "amdil";
    case spir:        return "spir";
    case spir64:      return "spir";
+  case kalimba:     return "kalimba";
    }
  }

@@ -116,6 +118,7 @@
    case Freescale: return "fsl";
    case IBM: return "ibm";
    case NVIDIA: return "nvidia";
+  case CSR: return "csr";
    }

    llvm_unreachable("Invalid VendorType!");
@@ -207,6 +210,7 @@
      .Case("amdil", amdil)
      .Case("spir", spir)
      .Case("spir64", spir64)
+    .Case("kalimba", kalimba)
      .Default(UnknownArch);
  }

@@ -280,6 +284,7 @@
      .Case("amdil", Triple::amdil)
      .Case("spir", Triple::spir)
      .Case("spir64", Triple::spir64)
+    .Case("kalimba", Triple::kalimba)
      .Default(Triple::UnknownArch);
  }

@@ -293,6 +298,7 @@
      .Case("fsl", Triple::Freescale)
      .Case("ibm", Triple::IBM)
      .Case("nvidia", Triple::NVIDIA)
+    .Case("csr", Triple::CSR)
      .Default(Triple::UnknownVendor);
  }

@@ -350,26 +356,6 @@
      .Default(Triple::UnknownObjectFormat);
  }

-static Triple::SubArchType parseSubArch(StringRef SubArchName) {
-  return StringSwitch<Triple::SubArchType>(SubArchName)
-    .EndsWith("v8", Triple::ARMSubArch_v8)
-    .EndsWith("v8a", Triple::ARMSubArch_v8)
-    .EndsWith("v7", Triple::ARMSubArch_v7)
-    .EndsWith("v7a", Triple::ARMSubArch_v7)
-    .EndsWith("v7em", Triple::ARMSubArch_v7em)
-    .EndsWith("v7m", Triple::ARMSubArch_v7m)
-    .EndsWith("v7s", Triple::ARMSubArch_v7s)
-    .EndsWith("v6", Triple::ARMSubArch_v6)
-    .EndsWith("v6m", Triple::ARMSubArch_v6m)
-    .EndsWith("v6t2", Triple::ARMSubArch_v6t2)
-    .EndsWith("v5", Triple::ARMSubArch_v5)
-    .EndsWith("v5t", Triple::ARMSubArch_v5)
-    .EndsWith("v5te", Triple::ARMSubArch_v5te)
-    .EndsWith("v4t", Triple::ARMSubArch_v4t)
-    .EndsWith("v4", Triple::ARMSubArch_v4)
-    .Default(Triple::NoSubArch);
-}
-
  static const char *getObjectFormatTypeName(Triple::ObjectFormatType 
Kind) {
    switch (Kind) {
    case Triple::UnknownObjectFormat: return "";
@@ -395,7 +381,6 @@
  Triple::Triple(const Twine &Str)
      : Data(Str.str()),
        Arch(parseArch(getArchName())),
-      SubArch(parseSubArch(getArchName())),
        Vendor(parseVendor(getVendorName())),
        OS(parseOS(getOSName())),
        Environment(parseEnvironment(getEnvironmentName())),
@@ -413,7 +398,6 @@
  Triple::Triple(const Twine &ArchStr, const Twine &VendorStr, const 
Twine &OSStr)
      : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr).str()),
        Arch(parseArch(ArchStr.str())),
-      SubArch(parseSubArch(ArchStr.str())),
        Vendor(parseVendor(VendorStr.str())),
        OS(parseOS(OSStr.str())),
        Environment(), ObjectFormat(Triple::UnknownObjectFormat) {
@@ -430,7 +414,6 @@
      : Data((ArchStr + Twine('-') + VendorStr + Twine('-') + OSStr + 
Twine('-') +
              EnvironmentStr).str()),
        Arch(parseArch(ArchStr.str())),
-      SubArch(parseSubArch(ArchStr.str())),
        Vendor(parseVendor(VendorStr.str())),
        OS(parseOS(OSStr.str())),
        Environment(parseEnvironment(EnvironmentStr.str())),
@@ -822,6 +805,7 @@
    case llvm::Triple::x86:
    case llvm::Triple::xcore:
    case llvm::Triple::spir:
+  case llvm::Triple::kalimba:
      return 32;

    case llvm::Triple::arm64:



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Triple.patch
Type: text/x-patch
Size: 5770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140709/c78c2fc0/attachment.bin>


More information about the llvm-dev mailing list