[llvm] [RISCV][MC] Implement ISA mapping symbols (PR #67541)

Joe Faulls via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 16 08:48:40 PDT 2023


https://github.com/joe-img updated https://github.com/llvm/llvm-project/pull/67541

>From f948bd7a7125314a9bf2138ae827bb2ea5f79cb6 Mon Sep 17 00:00:00 2001
From: "Joseph.Faulls" <Joseph.Faulls at imgtec.com>
Date: Tue, 26 Sep 2023 16:49:00 +0100
Subject: [PATCH 1/3] [RISCV][MC] Implement ISA mapping symbols

$x<ISA> indicates the start of a sequence of instructions with <ISA>
extension [1].

[1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#mapping-symbol
---
 .../RISCV/MCTargetDesc/RISCVELFStreamer.cpp   | 16 ++++++-
 .../RISCV/MCTargetDesc/RISCVELFStreamer.h     |  5 +-
 llvm/test/MC/RISCV/mapping-isa.s              | 47 +++++++++++++++++++
 3 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100644 llvm/test/MC/RISCV/mapping-isa.s

diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
index 9db5148208b3ec0..38c0c759bc53b80 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
@@ -59,6 +59,7 @@ void RISCVTargetELFStreamer::emitAttribute(unsigned Attribute, unsigned Value) {
 void RISCVTargetELFStreamer::emitTextAttribute(unsigned Attribute,
                                                StringRef String) {
   getStreamer().setAttributeItem(Attribute, String, /*OverwriteExisting=*/true);
+  getStreamer().changeISAMappingSymbol(Attribute, String);
 }
 
 void RISCVTargetELFStreamer::emitIntTextAttribute(unsigned Attribute,
@@ -140,7 +141,10 @@ void RISCVELFStreamer::emitDataMappingSymbol() {
 void RISCVELFStreamer::emitInstructionsMappingSymbol() {
   if (LastEMS == EMS_Instructions)
     return;
-  emitMappingSymbol("$x");
+  if (LastEMS == EMS_ChangeISA)
+    emitMappingSymbol("$x" + ISAString);
+  else
+    emitMappingSymbol("$x");
   LastEMS = EMS_Instructions;
 }
 
@@ -152,6 +156,16 @@ void RISCVELFStreamer::emitMappingSymbol(StringRef Name) {
   Symbol->setBinding(ELF::STB_LOCAL);
 }
 
+void RISCVELFStreamer::changeISAMappingSymbol(unsigned Attribute,
+                                              StringRef arch) {
+  if (Attribute != RISCVAttrs::ARCH)
+    return;
+  if (arch != ISAString) {
+    LastEMS = EMS_ChangeISA;
+    ISAString = std::string(arch);
+  }
+}
+
 void RISCVELFStreamer::changeSection(MCSection *Section,
                                      const MCExpr *Subsection) {
   // We have to keep track of the mapping symbol state of any sections we
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
index a6f54bf67b5d2bb..88fb5b235388efa 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
@@ -20,11 +20,13 @@ class RISCVELFStreamer : public MCELFStreamer {
   void emitInstructionsMappingSymbol();
   void emitMappingSymbol(StringRef Name);
 
-  enum ElfMappingSymbol { EMS_None, EMS_Instructions, EMS_Data };
+  enum ElfMappingSymbol { EMS_None, EMS_ChangeISA, EMS_Instructions,
+    EMS_Data };
 
   int64_t MappingSymbolCounter = 0;
   DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
   ElfMappingSymbol LastEMS = EMS_None;
+  std::string ISAString;
 
 public:
   RISCVELFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> MAB,
@@ -37,6 +39,7 @@ class RISCVELFStreamer : public MCELFStreamer {
   void emitBytes(StringRef Data) override;
   void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) override;
   void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override;
+  void changeISAMappingSymbol(unsigned Attribute, StringRef arch);
 };
 
 namespace llvm {
diff --git a/llvm/test/MC/RISCV/mapping-isa.s b/llvm/test/MC/RISCV/mapping-isa.s
new file mode 100644
index 000000000000000..737746e889ffb52
--- /dev/null
+++ b/llvm/test/MC/RISCV/mapping-isa.s
@@ -0,0 +1,47 @@
+## Instruction mapping symbols with ISA string
+
+# RUN: llvm-mc -triple=riscv32 -filetype=obj -o %t.o %s
+# RUN: llvm-objdump -t %t.o | FileCheck %s -check-prefix=CHECK-MAPPINGSYMBOLS
+# RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t.o %s
+# RUN: llvm-objdump -t %t.o | FileCheck %s -check-prefix=CHECK-MAPPINGSYMBOLS
+
+.text
+.attribute arch, "rv32i"
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1
+
+.attribute arch, "rv32i"
+nop
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1
+## Multiple instructions with same isa string, so no mapping symbol expected.
+
+.word 4
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1
+# CHECK-MAPPINGSYMBOLS: $x
+## Data followed by an instruction should produce an instruction mapping
+## symbol, but the isa string should not be present.
+
+.attribute arch, "rv32i2p1"
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1
+## The arch "rv32i" and "rv32i2p1" has the same isa string, so no mapping
+## symbol expected.
+
+.attribute arch, "rv32e"
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32e2p0
+
+.attribute arch, "rv64e"
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64e2p0
+
+.attribute arch, "rv32g"
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1_m2p0_a2p1_f2p2_d2p2_zicsr2p0_zifencei2p0
+
+.attribute arch, "rv64g"
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64i2p1_m2p0_a2p1_f2p2_d2p2_zicsr2p0_zifencei2p0
+

>From 393f5681a42181daccfe6fc812759715bb4ef113 Mon Sep 17 00:00:00 2001
From: "Joseph.Faulls" <Joseph.Faulls at imgtec.com>
Date: Thu, 28 Sep 2023 17:06:02 +0100
Subject: [PATCH 2/3] Fix formatting

---
 llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
index 88fb5b235388efa..46b56298b7885f8 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
@@ -20,8 +20,7 @@ class RISCVELFStreamer : public MCELFStreamer {
   void emitInstructionsMappingSymbol();
   void emitMappingSymbol(StringRef Name);
 
-  enum ElfMappingSymbol { EMS_None, EMS_ChangeISA, EMS_Instructions,
-    EMS_Data };
+  enum ElfMappingSymbol { EMS_None, EMS_ChangeISA, EMS_Instructions, EMS_Data };
 
   int64_t MappingSymbolCounter = 0;
   DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;

>From 6768d631691f961a0d544a4bbe7066093f915edc Mon Sep 17 00:00:00 2001
From: "Joseph.Faulls" <Joseph.Faulls at imgtec.com>
Date: Mon, 16 Oct 2023 16:20:08 +0100
Subject: [PATCH 3/3] Add support for .option assembler directive

---
 .../RISCV/MCTargetDesc/RISCVELFStreamer.cpp   | 110 +++++++++++++++---
 .../RISCV/MCTargetDesc/RISCVELFStreamer.h     |  11 +-
 ...{mapping-isa.s => mapping-isa-attribute.s} |  15 ++-
 llvm/test/MC/RISCV/mapping-isa-option-rv32.s  |  36 ++++++
 llvm/test/MC/RISCV/mapping-isa-option-rv64.s  |  36 ++++++
 5 files changed, 183 insertions(+), 25 deletions(-)
 rename llvm/test/MC/RISCV/{mapping-isa.s => mapping-isa-attribute.s} (72%)
 create mode 100644 llvm/test/MC/RISCV/mapping-isa-option-rv32.s
 create mode 100644 llvm/test/MC/RISCV/mapping-isa-option-rv64.s

diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
index 38c0c759bc53b80..e6381ceb2c25d4b 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
@@ -25,6 +25,7 @@
 #include "llvm/MC/MCValue.h"
 #include "llvm/Support/LEB128.h"
 #include "llvm/Support/RISCVAttributes.h"
+#include <sstream>
 
 using namespace llvm;
 
@@ -37,14 +38,33 @@ RISCVTargetELFStreamer::RISCVTargetELFStreamer(MCStreamer &S,
   auto &MAB = static_cast<RISCVAsmBackend &>(MCA.getBackend());
   setTargetABI(RISCVABI::computeTargetABI(STI.getTargetTriple(), Features,
                                           MAB.getTargetOptions().getABIName()));
+
+  // Using RISCVISAInfo, construct ISAString from given features.
+  std::stringstream SS(STI.getFeatureString().str());
+  std::string Feature;
+  std::vector<std::string> FeatureVec;
+  while (std::getline(SS, Feature, ','))
+    FeatureVec.push_back(Feature);
+
+  auto ParseResult = RISCVISAInfo::parseFeatures(
+      STI.getTargetTriple().isRISCV64() ? 64 : 32, FeatureVec);
+  if (ParseResult) {
+    auto &ISAInfo = *ParseResult;
+    ISAString = ISAInfo->toString();
+  }
 }
 
 RISCVELFStreamer &RISCVTargetELFStreamer::getStreamer() {
   return static_cast<RISCVELFStreamer &>(Streamer);
 }
 
-void RISCVTargetELFStreamer::emitDirectiveOptionPush() {}
-void RISCVTargetELFStreamer::emitDirectiveOptionPop() {}
+void RISCVTargetELFStreamer::setArchString(StringRef Arch) {
+  if (Arch != ISAString) {
+    getStreamer().setNewISAString(Arch);
+    ISAString = Arch;
+  }
+}
+
 void RISCVTargetELFStreamer::emitDirectiveOptionPIC() {}
 void RISCVTargetELFStreamer::emitDirectiveOptionNoPIC() {}
 void RISCVTargetELFStreamer::emitDirectiveOptionRVC() {}
@@ -59,7 +79,69 @@ void RISCVTargetELFStreamer::emitAttribute(unsigned Attribute, unsigned Value) {
 void RISCVTargetELFStreamer::emitTextAttribute(unsigned Attribute,
                                                StringRef String) {
   getStreamer().setAttributeItem(Attribute, String, /*OverwriteExisting=*/true);
-  getStreamer().changeISAMappingSymbol(Attribute, String);
+  if (Attribute == RISCVAttrs::ARCH)
+    setArchString(String);
+}
+
+void RISCVTargetELFStreamer::emitDirectiveOptionArch(
+    ArrayRef<RISCVOptionArchArg> Args) {
+  if (Args.size() == 1) {
+    RISCVOptionArchArg Arg = Args[0];
+    if (Arg.Type == RISCVOptionArchArgType::Full) {
+      // If there is a full arch string, then just set the arch string and
+      // return. It is illegal to have more than one argument with this option.
+      setArchString(Arg.Value);
+      return;
+    }
+  }
+
+  auto ParseResult = RISCVISAInfo::parseArchString(ISAString, false);
+  if (!ParseResult) {
+    std::string Buffer;
+    raw_string_ostream OutputErrMsg(Buffer);
+    handleAllErrors(ParseResult.takeError(), [&](llvm::StringError &ErrMsg) {
+      OutputErrMsg << "invalid arch name '" << ISAString << "', "
+                   << ErrMsg.getMessage();
+    });
+    return;
+  }
+  auto &ISAInfo = *ParseResult;
+  std::vector<std::string> NewFeatures = ISAInfo->toFeatureVector();
+  for (RISCVOptionArchArg Arg : Args) {
+    switch (Arg.Type) {
+    case RISCVOptionArchArgType::Minus:
+      NewFeatures.push_back("-" + Arg.Value);
+      break;
+    case RISCVOptionArchArgType::Plus:
+      NewFeatures.push_back("+" + Arg.Value);
+      break;
+    case RISCVOptionArchArgType::Full:
+      // This is special cased at the beginning of this function.
+      // It is illegal to have more than one argument for this option.
+      llvm_unreachable("Improperly formed arch option");
+      break;
+    }
+  }
+  auto NewParseResult = RISCVISAInfo::parseFeatures(
+      STI.hasFeature(RISCV::Feature64Bit) ? 64 : 32, NewFeatures);
+  if (!NewParseResult) {
+    std::string Buffer;
+    raw_string_ostream OutputErrMsg(Buffer);
+    handleAllErrors(ParseResult.takeError(), [&](llvm::StringError &ErrMsg) {
+      OutputErrMsg << "Bad set of features. " << ErrMsg.getMessage();
+    });
+    return;
+  }
+  auto &NewISAInfo = *NewParseResult;
+  setArchString(NewISAInfo->toString());
+}
+
+void RISCVTargetELFStreamer::emitDirectiveOptionPush() {
+  ISAStringStack.push_back(ISAString);
+}
+
+void RISCVTargetELFStreamer::emitDirectiveOptionPop() {
+  setArchString(ISAStringStack.pop_back_val());
 }
 
 void RISCVTargetELFStreamer::emitIntTextAttribute(unsigned Attribute,
@@ -139,12 +221,14 @@ void RISCVELFStreamer::emitDataMappingSymbol() {
 }
 
 void RISCVELFStreamer::emitInstructionsMappingSymbol() {
-  if (LastEMS == EMS_Instructions)
-    return;
-  if (LastEMS == EMS_ChangeISA)
-    emitMappingSymbol("$x" + ISAString);
-  else
+  // If NewISAString string has a value, this means there has been a change
+  // of ISA, so emit an ISA mapping symbol.
+  if (!NewISAString.empty()) {
+    emitMappingSymbol("$x" + NewISAString);
+    NewISAString.clear();
+  } else if (LastEMS != EMS_Instructions) {
     emitMappingSymbol("$x");
+  }
   LastEMS = EMS_Instructions;
 }
 
@@ -156,14 +240,8 @@ void RISCVELFStreamer::emitMappingSymbol(StringRef Name) {
   Symbol->setBinding(ELF::STB_LOCAL);
 }
 
-void RISCVELFStreamer::changeISAMappingSymbol(unsigned Attribute,
-                                              StringRef arch) {
-  if (Attribute != RISCVAttrs::ARCH)
-    return;
-  if (arch != ISAString) {
-    LastEMS = EMS_ChangeISA;
-    ISAString = std::string(arch);
-  }
+void RISCVELFStreamer::setNewISAString(StringRef Arch) {
+  NewISAString = std::string(Arch);
 }
 
 void RISCVELFStreamer::changeSection(MCSection *Section,
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
index 46b56298b7885f8..d8f0e555302914d 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.h
@@ -20,12 +20,12 @@ class RISCVELFStreamer : public MCELFStreamer {
   void emitInstructionsMappingSymbol();
   void emitMappingSymbol(StringRef Name);
 
-  enum ElfMappingSymbol { EMS_None, EMS_ChangeISA, EMS_Instructions, EMS_Data };
+  enum ElfMappingSymbol { EMS_None, EMS_Instructions, EMS_Data };
 
   int64_t MappingSymbolCounter = 0;
   DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
   ElfMappingSymbol LastEMS = EMS_None;
-  std::string ISAString;
+  std::string NewISAString;
 
 public:
   RISCVELFStreamer(MCContext &C, std::unique_ptr<MCAsmBackend> MAB,
@@ -38,7 +38,7 @@ class RISCVELFStreamer : public MCELFStreamer {
   void emitBytes(StringRef Data) override;
   void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) override;
   void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override;
-  void changeISAMappingSymbol(unsigned Attribute, StringRef arch);
+  void setNewISAString(StringRef Arch);
 };
 
 namespace llvm {
@@ -46,6 +46,8 @@ namespace llvm {
 class RISCVTargetELFStreamer : public RISCVTargetStreamer {
 private:
   StringRef CurrentVendor;
+  std::string ISAString;
+  SmallVector<std::string, 4> ISAStringStack;
 
   MCSection *AttributeSection = nullptr;
   const MCSubtargetInfo &STI;
@@ -71,6 +73,9 @@ class RISCVTargetELFStreamer : public RISCVTargetStreamer {
   void emitDirectiveOptionRelax() override;
   void emitDirectiveOptionNoRelax() override;
   void emitDirectiveVariantCC(MCSymbol &Symbol) override;
+  void emitDirectiveOptionArch(ArrayRef<RISCVOptionArchArg> Args) override;
+
+  void setArchString(StringRef Arch);
 
   void finish() override;
 };
diff --git a/llvm/test/MC/RISCV/mapping-isa.s b/llvm/test/MC/RISCV/mapping-isa-attribute.s
similarity index 72%
rename from llvm/test/MC/RISCV/mapping-isa.s
rename to llvm/test/MC/RISCV/mapping-isa-attribute.s
index 737746e889ffb52..0b942f0c87c0355 100644
--- a/llvm/test/MC/RISCV/mapping-isa.s
+++ b/llvm/test/MC/RISCV/mapping-isa-attribute.s
@@ -1,13 +1,17 @@
 ## Instruction mapping symbols with ISA string
 
-# RUN: llvm-mc -triple=riscv32 -filetype=obj -o %t.o %s
+# RUN: llvm-mc -triple=riscv32 -filetype=obj -mattr=+c -o %t.o %s
 # RUN: llvm-objdump -t %t.o | FileCheck %s -check-prefix=CHECK-MAPPINGSYMBOLS
-# RUN: llvm-mc -triple=riscv64 -filetype=obj -o %t.o %s
+# RUN: llvm-mc -triple=riscv64 -filetype=obj -mattr=+c -o %t.o %s
 # RUN: llvm-objdump -t %t.o | FileCheck %s -check-prefix=CHECK-MAPPINGSYMBOLS
 
 .text
-.attribute arch, "rv32i"
+.attribute arch, "rv32ic"
 nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1_c2p0
+# No mapping symbol as arch has not changed given the attributes
+
+.attribute arch, "rv32i"
 # CHECK-MAPPINGSYMBOLS: $xrv32i2p1
 
 .attribute arch, "rv32i"
@@ -25,8 +29,8 @@ nop
 
 .attribute arch, "rv32i2p1"
 nop
-# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1
-## The arch "rv32i" and "rv32i2p1" has the same isa string, so no mapping
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p0
+## The arch "rv32ic" and "rv32i2p1" has the same isa string, so no mapping
 ## symbol expected.
 
 .attribute arch, "rv32e"
@@ -44,4 +48,3 @@ nop
 .attribute arch, "rv64g"
 nop
 # CHECK-MAPPINGSYMBOLS: $xrv64i2p1_m2p0_a2p1_f2p2_d2p2_zicsr2p0_zifencei2p0
-
diff --git a/llvm/test/MC/RISCV/mapping-isa-option-rv32.s b/llvm/test/MC/RISCV/mapping-isa-option-rv32.s
new file mode 100644
index 000000000000000..0815c7c5bf029df
--- /dev/null
+++ b/llvm/test/MC/RISCV/mapping-isa-option-rv32.s
@@ -0,0 +1,36 @@
+## Instruction mapping symbols with ISA string
+
+# RUN: llvm-mc -triple=riscv32 -mattr=+f,+a -filetype=obj -o %t.o %s
+# RUN: llvm-objdump -t %t.o | FileCheck %s -check-prefix=CHECK-MAPPINGSYMBOLS
+
+.text
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32
+
+.option push
+.option arch, -f
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1_a2p1_zicsr2p0
+
+.option pop
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1_a2p1_f2p2_zicsr2p0
+
+.option push
+.option arch, +c
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1_a2p1_f2p2_c2p0_zicsr2p0
+
+.option pop
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1_a2p1_f2p2_zicsr2p0
+
+.option arch, rv32imac
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv32i2p1_m2p0_a2p1_c2p0
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1_m2p0_a2p1_c2p0
+
+.word 4
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv32i2p1_m2p0_a2p1_c2p0
diff --git a/llvm/test/MC/RISCV/mapping-isa-option-rv64.s b/llvm/test/MC/RISCV/mapping-isa-option-rv64.s
new file mode 100644
index 000000000000000..3d3ab9384dda652
--- /dev/null
+++ b/llvm/test/MC/RISCV/mapping-isa-option-rv64.s
@@ -0,0 +1,36 @@
+## Instruction mapping symbols with ISA string
+
+# RUN: llvm-mc -triple=riscv64 -mattr=+f,+a -filetype=obj -o %t.o %s
+# RUN: llvm-objdump -t %t.o | FileCheck %s -check-prefix=CHECK-MAPPINGSYMBOLS
+
+.text
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv64
+
+.option push
+.option arch, -f
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64i2p1_a2p1_zicsr2p0
+
+.option pop
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64i2p1_a2p1_f2p2_zicsr2p0
+
+.option push
+.option arch, +c
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64i2p1_a2p1_f2p2_c2p0_zicsr2p0
+
+.option pop
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64i2p1_a2p1_f2p2_zicsr2p0
+
+.option arch, rv64imac
+nop
+# CHECK-MAPPINGSYMBOLS: $xrv64i2p1_m2p0_a2p1_c2p0
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv64i2p1_m2p0_a2p1_c2p0
+
+.word 4
+nop
+# CHECK-MAPPINGSYMBOLS-NOT: $xrv64i2p1_m2p0_a2p1_c2p0



More information about the llvm-commits mailing list