[PATCH] D69851: [mips] Write `AFL_EXT_OCTEONP` flag to the `.MIPS.abiflags` section

Simon Atanasyan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 08:10:19 PST 2019


atanasyan created this revision.
atanasyan added a reviewer: Petar.Avramovic.
Herald added subscribers: jrtc27, hiraditya, arichardson, sdardis.
Herald added a project: LLVM.
atanasyan added a parent revision: D69849: [mips] Implement Octeon+ `saa` and `saad` instructions.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69851

Files:
  llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
  llvm/test/MC/Mips/mips_abi_flags_xx.s


Index: llvm/test/MC/Mips/mips_abi_flags_xx.s
===================================================================
--- llvm/test/MC/Mips/mips_abi_flags_xx.s
+++ llvm/test/MC/Mips/mips_abi_flags_xx.s
@@ -17,6 +17,11 @@
 # RUN:   llvm-readobj --sections --section-data --section-relocations -A - | \
 # RUN:   FileCheck %s -check-prefixes=CHECK-OBJ,CHECK-OBJ-64R2,CHECK-OBJ-OCTEON
 
+# RUN: llvm-mc -triple mips64-unknown-linux-gnu \
+# RUN:         -mcpu=octeon+ -filetype=obj -o - /dev/null \
+# RUN:   | llvm-readobj --sections --section-data --section-relocations -A - \
+# RUN:   | FileCheck %s -check-prefixes=CHECK-OBJ,CHECK-OBJ-64R2,CHECK-OBJ-OCTEONP
+
 # CHECK-ASM: .module fp=xx
 
 # Checking if the Mips.abiflags were correctly emitted.
@@ -43,6 +48,7 @@
 # CHECK-OBJ-64R2-NEXT: ISA: MIPS64r2
 # CHECK-OBJ-MIPS-NEXT:   ISA Extension: None (0x0)
 # CHECK-OBJ-OCTEON-NEXT: ISA Extension: Cavium Networks Octeon (0x5)
+# CHECK-OBJ-OCTEONP-NEXT: ISA Extension: Cavium Networks OcteonP (0x3)
 # CHECK-OBJ-NEXT:    ASEs [ (0x0)          
 # CHECK-OBJ-NEXT:    ]                     
 # CHECK-OBJ-32R1-NEXT: FP ABI: Hard float (32-bit CPU, Any FPU) (0x5)
Index: llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
===================================================================
--- llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
+++ llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
@@ -139,7 +139,9 @@
 
   template <class PredicateLibrary>
   void setISAExtensionFromPredicates(const PredicateLibrary &P) {
-    if (P.hasCnMips())
+    if (P.hasCnMipsP())
+      ISAExtension = Mips::AFL_EXT_OCTEONP;
+    else if (P.hasCnMips())
       ISAExtension = Mips::AFL_EXT_OCTEON;
     else
       ISAExtension = Mips::AFL_EXT_NONE;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69851.227881.patch
Type: text/x-patch
Size: 1751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191105/f5ffaa2b/attachment.bin>


More information about the llvm-commits mailing list