mirror of https://github.com/microsoft/clang.git
[mips] Relax -mnan=2008 acceptance to permit MIPS32R2 and MIPS64R2.
Summary: Strictly speaking, the MIPS*R2 ISA's should not permit -mnan=2008 since this feature was added in MIPS*R3. However, other toolchains permit this and we should do the same. Reviewers: atanasyan Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D13057 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248481 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a638ce2afc
commit
f138c78edd
|
@ -6191,6 +6191,9 @@ void arm::appendEBLinkFlags(const ArgList &Args, ArgStringList &CmdArgs,
|
|||
}
|
||||
|
||||
mips::NanEncoding mips::getSupportedNanEncoding(StringRef &CPU) {
|
||||
// Strictly speaking, mips32r2 and mips64r2 are NanLegacy-only since Nan2008
|
||||
// was first introduced in Release 3. However, other compilers have
|
||||
// traditionally allowed it for Release 2 so we should do the same.
|
||||
return (NanEncoding)llvm::StringSwitch<int>(CPU)
|
||||
.Case("mips1", NanLegacy)
|
||||
.Case("mips2", NanLegacy)
|
||||
|
@ -6198,12 +6201,12 @@ mips::NanEncoding mips::getSupportedNanEncoding(StringRef &CPU) {
|
|||
.Case("mips4", NanLegacy)
|
||||
.Case("mips5", NanLegacy)
|
||||
.Case("mips32", NanLegacy)
|
||||
.Case("mips32r2", NanLegacy)
|
||||
.Case("mips32r2", NanLegacy | Nan2008)
|
||||
.Case("mips32r3", NanLegacy | Nan2008)
|
||||
.Case("mips32r5", NanLegacy | Nan2008)
|
||||
.Case("mips32r6", Nan2008)
|
||||
.Case("mips64", NanLegacy)
|
||||
.Case("mips64r2", NanLegacy)
|
||||
.Case("mips64r2", NanLegacy | Nan2008)
|
||||
.Case("mips64r3", NanLegacy | Nan2008)
|
||||
.Case("mips64r5", NanLegacy | Nan2008)
|
||||
.Case("mips64r6", Nan2008)
|
||||
|
|
|
@ -1,24 +1,44 @@
|
|||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips2 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS2 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips3 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS3 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips4 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS4 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS32 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32r2 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS32R2 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32r3 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-NOT-MIPS32R3 -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=legacy -march=mips32r6 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS32R6 -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips64 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS64 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips64r2 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS64R2 -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=legacy -march=mips64r6 -emit-llvm -S %s -o - 2>&1 | FileCheck -check-prefix=CHECK-MIPS64R6 -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips2 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS2 %s < %t
|
||||
//
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips3 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS3 %s < %t
|
||||
//
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips4 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS4 %s < %t
|
||||
//
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS32 %s < %t
|
||||
//
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32r2 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: FileCheck -allow-empty -check-prefix=NO-WARNINGS %s < %t
|
||||
//
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=2008 -march=mips32r3 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: FileCheck -allow-empty -check-prefix=NO-WARNINGS %s < %t
|
||||
//
|
||||
// RUN: %clang -target mipsel-unknown-linux -mnan=legacy -march=mips32r6 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS32R6 %s < %t
|
||||
//
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips64 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NANLEGACY %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS64 %s < %t
|
||||
//
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=2008 -march=mips64r2 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: FileCheck -allow-empty -check-prefix=NO-WARNINGS %s < %t
|
||||
//
|
||||
// RUN: %clang -target mips64el-unknown-linux -mnan=legacy -march=mips64r6 -emit-llvm -S %s -o - 2>%t | FileCheck -check-prefix=CHECK-NAN2008 %s
|
||||
// RUN: FileCheck -check-prefix=CHECK-MIPS64R6 %s < %t
|
||||
|
||||
// NO-WARNINGS-NOT: warning: ignoring '-mnan=legacy' option
|
||||
// NO-WARNINGS-NOT: warning: ignoring '-mnan=2008' option
|
||||
|
||||
// CHECK-MIPS2: warning: ignoring '-mnan=2008' option because the 'mips2' architecture does not support it
|
||||
// CHECK-MIPS3: warning: ignoring '-mnan=2008' option because the 'mips3' architecture does not support it
|
||||
// CHECK-MIPS4: warning: ignoring '-mnan=2008' option because the 'mips4' architecture does not support it
|
||||
// CHECK-MIPS32: warning: ignoring '-mnan=2008' option because the 'mips32' architecture does not support it
|
||||
// CHECK-MIPS32R2: warning: ignoring '-mnan=2008' option because the 'mips32r2' architecture does not support it
|
||||
// CHECK-MIPS32R3: warning: ignoring '-mnan=2008' option because the 'mips32r3' architecture does not support it
|
||||
// CHECK-MIPS32R6: warning: ignoring '-mnan=legacy' option because the 'mips32r6' architecture does not support it
|
||||
// CHECK-MIPS64: warning: ignoring '-mnan=2008' option because the 'mips64' architecture does not support it
|
||||
// CHECK-MIPS64R2: warning: ignoring '-mnan=2008' option because the 'mips64r2' architecture does not support it
|
||||
// CHECK-MIPS64R6: warning: ignoring '-mnan=legacy' option because the 'mips64r6' architecture does not support it
|
||||
|
||||
// CHECK-NANLEGACY: float 0x7FF4000000000000
|
||||
// CHECK-NAN2008: float 0x7FF8000000000000
|
||||
|
||||
|
|
Loading…
Reference in New Issue