From: Andrey Turetskiy Date: Wed, 4 May 2016 11:28:22 +0000 (+0000) Subject: [X86] Add -m[no-]x87 and -m[no-]80387 options to control FeatureX87. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6eab9724157636a70be55321345cbaa9fe607d98;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268489 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 0ec750b4ba..150a35caa5 100644 --- a/include/clang/Driver/Options.td +++ b/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/test/Driver/x86-target-features.c b/test/Driver/x86-target-features.c index 3378d5e6f9..ce35b2cfd0 100644 --- a/test/Driver/x86-target-features.c +++ b/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"