On Thu, Jan 11, 2018 at 01:11:05PM -0500, Michael Meissner wrote: > In working on the transition of PowerPC long double from using the IBM > extended > double format to IEEE 128-bit floating point, I noticed that the long double > .gnu_attribute (#4) was not set if the compiler can handle long double > directly > without doing the call to an emulator, such as using IEEE 128-bit floating > point on an ISA 3.0 (power9) 64-bit system. This patch sets the attribute if > there is a move of the appropriate type. I only check TF/TCmode for the > normal > case, and DF/DCmode for -mlong-double-64, since IFmode is used for __ibm128 > when long double is IEEE and KFmode is used for __float128 when long double is > IEEE. > > I have checked this on a little endian power8 system with bootstrap and make > check. There were no regressions, and I verified that the three new tests are > run and pass. Can I check this into the trunk?
> [gcc] > 2018-01-11 Michael Meissner <meiss...@linux.vnet.ibm.com> > > (rs6000_emit_move): If we load or store a long double type, set > the flags for noting the default long double type, even if we > don't pass or return a long double type. > > [gcc/testsuite] > 2018-01-11 Michael Meissner <meiss...@linux.vnet.ibm.com> > > * gcc.target/powerpc/gnuattr1.c: New test to make sure we set the > appropriate .gnu_attribute for the long double type, if we use the > long double type, but do not generate any calls. > * gcc.target/powerpc/gnuattr2.c: Likewise. > * gcc.target/powerpc/gnuattr3.c: Likewise. > + if (rs6000_gnu_attr > + && ((HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE || TARGET_64BIT)) One pair of parens is enough ;-) > + && ((TARGET_LONG_DOUBLE_128 > + && (mode == TFmode || mode == TCmode)) > + || (!TARGET_LONG_DOUBLE_128 > + && (mode == DFmode || mode == DCmode)))) It's easier to read if you join these lines pairwise: > + && ((TARGET_LONG_DOUBLE_128 && (mode == TFmode || mode == TCmode)) > + || (!TARGET_LONG_DOUBLE_128 && (mode == DFmode || mode == DCmode)))) Or maybe something with ?:, or break the statement into multiple. Okay for trunk if you make it a bit more readable :-) Thanks, Segher