This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH], Add check ppc_cpu_supports_hw to testsuite
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Wed, 28 Jun 2017 14:33:47 -0400
- Subject: Re: [PATCH], Add check ppc_cpu_supports_hw to testsuite
- Authentication-results: sourceware.org; auth=none
- References: <20170627235321.GA13753@ibm-tiger.the-meissners.org> <firstname.lastname@example.org>
On Wed, Jun 28, 2017 at 09:58:40AM -0500, Peter Bergner wrote:
> On 6/27/17 6:53 PM, Michael Meissner wrote:
> > This adds a target supports option in dejagnu so that future tests can use this
> > to determine whether or not to test target_clones.
> I like the idea, but some comments...
> > + #ifdef __MACH__
> > + asm volatile ("xxlor vs0,vs0,vs0");
> > + #else
> > + asm volatile ("xxlor 0,0,0");
> > + #endif
> What is this hunk for? We're only interested in the return value from
> the builtin below, correct?
> > + if (!__builtin_cpu_supports ("vsx"))
> > + return 1;
> > + return 0;
> ...and more importantly, why limit us to testing "vsx"? Why not test
> for "ppc32", which should be true for *all* kernels we'd ever run on,
> including ppc32, ppc64 and ppc64le?
I wanted to make sure the test actually returned true in the correct test.
I.e. guarantee that the machine had VSX instructions (i.e. the asm) and that
__builtin_cpu_supports returned true.
But if you wanted to use a previous ISA flag, feel free to submit patches. I
just wanted a quick way to make sure the clone tests were run properly when GCC
was configured with a 2.23 GLIBC or newer.
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: email@example.com, phone: +1 (978) 899-4797