I am evaluating the following patch to gcc-7 to fix the problem. It's currently building, I'll follow up when I know it works. The patch is added to debian/rules.patch to get it included.
Bas Vermeulen On Tue, Feb 6, 2018 at 5:16 PM, Lennart Sorensen < lsore...@csclub.uwaterloo.ca> wrote: > On Tue, Feb 06, 2018 at 03:40:20PM +0100, Bas Vermeulen wrote: > > I am trying to run the ppc64 unstable on a Freescale T2080, which uses > the > > e6500 CPU. Running python (or any other application using sqrt or sqrtf) > > will cause an illegal instruction exception, because the sqrtf opcode is > > not supported on the e6500. > > > > This seems to be caused by gcc compiling for power4 by default > > (_ARCH_PWR4=1 and _ARCH_PPCSQ=1 set in gcc -E -mD - < /dev/null), > although > > jrtc27 on #debian-ports pointed to > > https://github.com/gcc-mirror/gcc/blob/da8dff89fa9398f04b107e388cb706 > 517ced9505/gcc/config/rs6000/default64.h#L30 > > which sets MASK_PPC_GPOPT by default (which includes fp sqrt). > > > > What would be the best way to solve this problem? > > Why is the default not powerpc64 instead of power4? After all that is > the setting for generic 64 bit bit endian powerpc as far as I know. > > It seems the e6500 is missing quite a few floating point instructions > from the Power ISA so targeting power4 (which is I believe full Power > ISA 2.01) is likely to cause issues. > > -- > Len Sorensen >
--- a/src/gcc/config/rs6000/default64.h 2018-02-06 15:52:53.000000000 +0000 +++ b/src/gcc/config/rs6000/default64.h 2018-02-06 15:53:10.000000000 +0000 @@ -27,5 +27,5 @@ #define TARGET_DEFAULT (ISA_2_7_MASKS_SERVER | MASK_POWERPC64 | MASK_64BIT | MASK_LITTLE_ENDIAN) #else #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64 | MASK_64BIT) +#define TARGET_DEFAULT (MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_64BIT) #endif