[clang] [llvm] [X86][MC] Added support for -msse2avx option in llvm-mc (PR #96860)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 06:12:00 PDT 2024


================
@@ -335,6 +337,31 @@ void X86InstrMappingEmitter::emitND2NonNDTable(
   printTable(Table, "X86ND2NonNDTable", "GET_X86_ND2NONND_TABLE", OS);
 }
 
+void X86InstrMappingEmitter::emitSSE2AVXTable(
+    ArrayRef<const CodeGenInstruction *> Insts, raw_ostream &OS) {
+  std::vector<Entry> Table;
+  for (const CodeGenInstruction *Inst : Insts) {
+    const Record *Rec = Inst->TheDef;
+    StringRef Name = Rec->getName();
+    if (!isInteresting(Rec))
+      continue;
+    auto *NewRec = Records.getDef(Name);
+    if (!NewRec)
+      continue;
+
+    std::string NewName = ("V" + Name).str();
+    // Handle instructions BLENDVPD, BLENDVPS ,PBLENDVB
+    if (Name.ends_with("rm0") || Name.ends_with("rr0"))
+      NewName.back() = 'r';
----------------
KanRobert wrote:

This is not clear. Like what we did in line 306-308, put it in def file.

https://github.com/llvm/llvm-project/pull/96860


More information about the llvm-commits mailing list