Skip to content

Commit bf996f7

Browse files
committed
[mips] Write AFL_EXT_OCTEONP flag to the .MIPS.abiflags section
Differential Revision: https://reviews.llvm.org/D69851
1 parent 3718102 commit bf996f7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ struct MipsABIFlagsSection {
139139

140140
template <class PredicateLibrary>
141141
void setISAExtensionFromPredicates(const PredicateLibrary &P) {
142-
if (P.hasCnMips())
142+
if (P.hasCnMipsP())
143+
ISAExtension = Mips::AFL_EXT_OCTEONP;
144+
else if (P.hasCnMips())
143145
ISAExtension = Mips::AFL_EXT_OCTEON;
144146
else
145147
ISAExtension = Mips::AFL_EXT_NONE;

llvm/test/MC/Mips/mips_abi_flags_xx.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
# RUN: llvm-readobj --sections --section-data --section-relocations -A - | \
1818
# RUN: FileCheck %s -check-prefixes=CHECK-OBJ,CHECK-OBJ-64R2,CHECK-OBJ-OCTEON
1919

20+
# RUN: llvm-mc -triple mips64-unknown-linux-gnu \
21+
# RUN: -mcpu=octeon+ -filetype=obj -o - /dev/null \
22+
# RUN: | llvm-readobj --sections --section-data --section-relocations -A - \
23+
# RUN: | FileCheck %s -check-prefixes=CHECK-OBJ,CHECK-OBJ-64R2,CHECK-OBJ-OCTEONP
24+
2025
# CHECK-ASM: .module fp=xx
2126

2227
# Checking if the Mips.abiflags were correctly emitted.
@@ -43,6 +48,7 @@
4348
# CHECK-OBJ-64R2-NEXT: ISA: MIPS64r2
4449
# CHECK-OBJ-MIPS-NEXT: ISA Extension: None (0x0)
4550
# CHECK-OBJ-OCTEON-NEXT: ISA Extension: Cavium Networks Octeon (0x5)
51+
# CHECK-OBJ-OCTEONP-NEXT: ISA Extension: Cavium Networks OcteonP (0x3)
4652
# CHECK-OBJ-NEXT: ASEs [ (0x0)
4753
# CHECK-OBJ-NEXT: ]
4854
# CHECK-OBJ-32R1-NEXT: FP ABI: Hard float (32-bit CPU, Any FPU) (0x5)

0 commit comments

Comments
 (0)