[mips] Show error in case of using FP64 mode on pre MIPS32R2 CPU

llvm-svn: 365508
This commit is contained in:
Simon Atanasyan 2019-07-09 15:48:16 +00:00
parent 623282f0dd
commit e3892d84e0
2 changed files with 7 additions and 2 deletions

View File

@ -108,6 +108,11 @@ MipsSubtarget::MipsSubtarget(const Triple &TT, StringRef CPU, StringRef FS,
"See -mattr=+fp64.",
false);
if (isFP64bit() && !hasMips64() && hasMips32() && !hasMips32r2())
report_fatal_error(
"FPU with 64-bit registers is not available on MIPS32 pre revision 2. "
"Use -mcpu=mips32r2 or greater.");
if (!isABI_O32() && !useOddSPReg())
report_fatal_error("-mattr=+nooddspreg requires the O32 ABI.", false);

View File

@ -6,9 +6,8 @@
; We don't test MIPS32r1 since support for 64-bit coprocessors (such as a 64-bit
; FPU) on a 32-bit architecture was added in MIPS32r2.
; FIXME: We currently don't test that attempting to use FP64 on MIPS32r1 is an
; error either.
; RUN: not llc -march=mips -mcpu=mips32 -mattr=fp64 < %s 2>&1 | FileCheck %s -check-prefix=32R1-FP64
; RUN: llc -march=mips -mcpu=mips32r2 -mattr=fp64 < %s | FileCheck %s -check-prefixes=ALL,32R2-NO-FP64A-BE
; RUN: llc -march=mips -mcpu=mips32r2 -mattr=fp64,nooddspreg < %s | FileCheck %s -check-prefixes=ALL,32R2-FP64A
; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=fp64 < %s | FileCheck %s -check-prefixes=ALL,32R2-NO-FP64A-LE
@ -19,6 +18,7 @@
; RUN: llc -march=mips64el -mcpu=mips64 -mattr=fp64 < %s | FileCheck %s -check-prefixes=ALL,64-NO-FP64A
; RUN: not llc -march=mips64el -mcpu=mips64 -mattr=fp64,nooddspreg < %s 2>&1 | FileCheck %s -check-prefix=64-FP64A
; 32R1-FP64: LLVM ERROR: FPU with 64-bit registers is not available on MIPS32 pre revision 2. Use -mcpu=mips32r2 or greater.
; 64-FP64A: LLVM ERROR: -mattr=+nooddspreg requires the O32 ABI.
declare double @dbl();