From b7a29675fcd1802e06e3f03231fd53650f784822 Mon Sep 17 00:00:00 2001 From: Andrey Turetskiy Date: Wed, 4 May 2016 11:28:22 +0000 Subject: [PATCH] [X86] Add -m[no-]x87 and -m[no-]80387 options to control FeatureX87. Add -m[no-]x87 and -m[no-]80387 options to control FeatureX87. -m[no-]80387 options is added for compatibility with GCC. Differential Revision: http://reviews.llvm.org/D19658 llvm-svn: 268489 --- clang/include/clang/Driver/Options.td | 4 ++++ clang/test/Driver/x86-target-features.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 0ec750b4ba4c..150a35caa56a 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1370,6 +1370,8 @@ def mno_relax_all : Flag<["-"], "mno-relax-all">, Group; def mno_rtd: Flag<["-"], "mno-rtd">, Group; def mno_soft_float : Flag<["-"], "mno-soft-float">, Group; def mno_stackrealign : Flag<["-"], "mno-stackrealign">, Group; +def mno_x87 : Flag<["-"], "mno-x87">, Group; +def mno_80387 : Flag<["-"], "mno-80387">, Alias; def mno_sse2 : Flag<["-"], "mno-sse2">, Group; def mno_sse3 : Flag<["-"], "mno-sse3">, Group; def mno_sse4a : Flag<["-"], "mno-sse4a">, Group; @@ -1547,6 +1549,8 @@ def mno_implicit_float : Flag<["-"], "mno-implicit-float">, Group, def mimplicit_float : Flag<["-"], "mimplicit-float">, Group; def mrecip : Flag<["-"], "mrecip">, Group; def mrecip_EQ : CommaJoined<["-"], "mrecip=">, Group, Flags<[CC1Option]>; +def mx87 : Flag<["-"], "mx87">, Group; +def m80387 : Flag<["-"], "m80387">, Alias; def msse2 : Flag<["-"], "msse2">, Group; def msse3 : Flag<["-"], "msse3">, Group; def msse4a : Flag<["-"], "msse4a">, Group; diff --git a/clang/test/Driver/x86-target-features.c b/clang/test/Driver/x86-target-features.c index 3378d5e6f95b..ce35b2cfd0dc 100644 --- a/clang/test/Driver/x86-target-features.c +++ b/clang/test/Driver/x86-target-features.c @@ -1,3 +1,10 @@ +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mx87 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=X87 %s +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-x87 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-X87 %s +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -m80387 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=X87 %s +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-80387 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-X87 %s +// X87: "-target-feature" "+x87" +// NO-X87: "-target-feature" "-x87" + // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mmmx -m3dnow -m3dnowa %s -### -o %t.o 2>&1 | FileCheck -check-prefix=MMX %s // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-mmx -mno-3dnow -mno-3dnowa %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-MMX %s // MMX: "-target-feature" "+mmx" "-target-feature" "+3dnow" "-target-feature" "+3dnowa"