Skip to content

Commit

Permalink
[mips] Write AFL_EXT_OCTEONP flag to the .MIPS.abiflags section
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D69851
  • Loading branch information
atanasyan committed Nov 7, 2019
1 parent 3718102 commit bf996f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llvm/lib/Target/Mips/MCTargetDesc/MipsABIFlagsSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ struct MipsABIFlagsSection {

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;
Expand Down
6 changes: 6 additions & 0 deletions llvm/test/MC/Mips/mips_abi_flags_xx.s
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit bf996f7

Please sign in to comment.