From e54375d85d4aa5889869c2672158083b2106b623 Mon Sep 17 00:00:00 2001 From: liuhongt Date: Mon, 12 Dec 2022 15:43:58 +0800 Subject: x86: Add a new option -mdaz-ftz to enable FTZ and DAZ flags in MXCSR. if (mdaz-ftz) link crtfastmath.o else if ((Ofast || ffast-math || funsafe-math-optimizations) && !shared && !mno-daz-ftz) link crtfastmath.o else Don't link crtfastmath.o gcc/ChangeLog: PR target/55522 PR target/36821 * config/i386/gnu-user-common.h (GNU_USER_TARGET_MATHFILE_SPEC): Link crtfastmath.o whenever -mdaz-ftz is specified. Don't link crtfastmath.o when -share or -mno-daz-ftz is specified. * config/i386/i386.opt (mdaz-ftz): New option. * doc/invoke.texi (x86 options): Document mftz-daz. --- gcc/config/i386/gnu-user-common.h | 2 +- gcc/config/i386/i386.opt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/config') diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h index 9910cd6..f910524 100644 --- a/gcc/config/i386/gnu-user-common.h +++ b/gcc/config/i386/gnu-user-common.h @@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see /* Similar to standard GNU userspace, but adding -ffast-math support. */ #define GNU_USER_TARGET_MATHFILE_SPEC \ - "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \ + "%{mdaz-ftz:crtfastmath.o%s;Ofast|ffast-math|funsafe-math-optimizations:%{!shared:%{!mno-daz-ftz:crtfastmath.o%s}}} \ %{mpc32:crtprec32.o%s} \ %{mpc64:crtprec64.o%s} \ %{mpc80:crtprec80.o%s}" diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index fb4e57a..0b7df42 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -420,6 +420,10 @@ mpc80 Target RejectNegative Set 80387 floating-point precision to 80-bit. +mdaz-ftz +Target +Set the FTZ and DAZ Flags. + mpreferred-stack-boundary= Target RejectNegative Joined UInteger Var(ix86_preferred_stack_boundary_arg) Attempt to keep stack aligned to this power of 2. -- cgit v1.1