gcc/4.9 -msse4.2

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

gcc/4.9 -msse4.2

Stuart Henderson
The gcc 4.9 port supports -msse4.2, but our assembler doesn't
support (at least some of the) opcodes that it uses.

: Assembler messages:
:132: Error: no such instruction: `pcmpistri $2,(%rdi),%xmm2'
:172: Error: no such instruction: `pcmpistri $2,%xmm3,%xmm1'
:175: Error: no such instruction: `pcmpistri $58,%xmm3,%xmm3'

Would it make sense to disable the option in the compiler for now?

Reply | Threaded
Open this post in threaded view
|

Re: gcc/4.9 -msse4.2

Pascal Stumpf
On Wed, 14 Oct 2015 18:18:21 +0100, Stuart Henderson wrote:

> The gcc 4.9 port supports -msse4.2, but our assembler doesn't
> support (at least some of the) opcodes that it uses.
>
> : Assembler messages:
> :132: Error: no such instruction: `pcmpistri $2,(%rdi),%xmm2'
> :172: Error: no such instruction: `pcmpistri $2,%xmm3,%xmm1'
> :175: Error: no such instruction: `pcmpistri $58,%xmm3,%xmm3'
>
> Would it make sense to disable the option in the compiler for now?
>
>

Not sure what that would achieve.  Rejecting the flag would just move
the error from as to egcc.  Any port using it would have to patch out
the option anyway (or use clang).

Reply | Threaded
Open this post in threaded view
|

Re: gcc/4.9 -msse4.2

Stuart Henderson-6
On 2015/10/15 18:16, Pascal Stumpf wrote:

> On Wed, 14 Oct 2015 18:18:21 +0100, Stuart Henderson wrote:
> > The gcc 4.9 port supports -msse4.2, but our assembler doesn't
> > support (at least some of the) opcodes that it uses.
> >
> > : Assembler messages:
> > :132: Error: no such instruction: `pcmpistri $2,(%rdi),%xmm2'
> > :172: Error: no such instruction: `pcmpistri $2,%xmm3,%xmm1'
> > :175: Error: no such instruction: `pcmpistri $58,%xmm3,%xmm3'
> >
> > Would it make sense to disable the option in the compiler for now?
> >
> >
>
> Not sure what that would achieve.  Rejecting the flag would just move
> the error from as to egcc.  Any port using it would have to patch out
> the option anyway (or use clang).
>

The port where I ran into this has an autoconf check to see whether
the compiler accepts the flag. Since it's still a fairly new flag,
I assume that anything else trying to use it would do the same.

Reply | Threaded
Open this post in threaded view
|

Re: gcc/4.9 -msse4.2

Jonathan Gray-11
On Thu, Oct 15, 2015 at 08:09:57PM +0100, Stuart Henderson wrote:

> On 2015/10/15 18:16, Pascal Stumpf wrote:
> > On Wed, 14 Oct 2015 18:18:21 +0100, Stuart Henderson wrote:
> > > The gcc 4.9 port supports -msse4.2, but our assembler doesn't
> > > support (at least some of the) opcodes that it uses.
> > >
> > > : Assembler messages:
> > > :132: Error: no such instruction: `pcmpistri $2,(%rdi),%xmm2'
> > > :172: Error: no such instruction: `pcmpistri $2,%xmm3,%xmm1'
> > > :175: Error: no such instruction: `pcmpistri $58,%xmm3,%xmm3'
> > >
> > > Would it make sense to disable the option in the compiler for now?
> > >
> > >
> >
> > Not sure what that would achieve.  Rejecting the flag would just move
> > the error from as to egcc.  Any port using it would have to patch out
> > the option anyway (or use clang).
> >
>
> The port where I ran into this has an autoconf check to see whether
> the compiler accepts the flag. Since it's still a fairly new flag,
> I assume that anything else trying to use it would do the same.
>

I ran into the same problem when trying to build Mesa with gcc 4.9
a few months ago:

https://bugs.freedesktop.org/show_bug.cgi?id=91806

Reply | Threaded
Open this post in threaded view
|

Re: gcc/4.9 -msse4.2

Pascal Stumpf
In reply to this post by Stuart Henderson-6
On Thu, 15 Oct 2015 20:09:57 +0100, Stuart Henderson wrote:

> On 2015/10/15 18:16, Pascal Stumpf wrote:
> > On Wed, 14 Oct 2015 18:18:21 +0100, Stuart Henderson wrote:
> > > The gcc 4.9 port supports -msse4.2, but our assembler doesn't
> > > support (at least some of the) opcodes that it uses.
> > >
> > > : Assembler messages:
> > > :132: Error: no such instruction: `pcmpistri $2,(%rdi),%xmm2'
> > > :172: Error: no such instruction: `pcmpistri $2,%xmm3,%xmm1'
> > > :175: Error: no such instruction: `pcmpistri $58,%xmm3,%xmm3'
> > >
> > > Would it make sense to disable the option in the compiler for now?
> > >
> > >
> >
> > Not sure what that would achieve.  Rejecting the flag would just move
> > the error from as to egcc.  Any port using it would have to patch out
> > the option anyway (or use clang).
> >
>
> The port where I ran into this has an autoconf check to see whether
> the compiler accepts the flag. Since it's still a fairly new flag,
> I assume that anything else trying to use it would do the same.
>
>

Then I'd argue the autoconf check is broken.  It should be trying to
compile an actual code snippet with SSE4.2 instructions (while taking
care that the compiler does not optimise away the inline asm).

Since, as you said, the flag is quite new, it is absolutely necessary to
test both compiler and binutils support.

Reply | Threaded
Open this post in threaded view
|

Re: gcc/4.9 -msse4.2

Pascal Stumpf
In reply to this post by Jonathan Gray-11
On Fri, 16 Oct 2015 13:16:59 +1100, Jonathan Gray wrote:

> On Thu, Oct 15, 2015 at 08:09:57PM +0100, Stuart Henderson wrote:
> > On 2015/10/15 18:16, Pascal Stumpf wrote:
> > > On Wed, 14 Oct 2015 18:18:21 +0100, Stuart Henderson wrote:
> > > > The gcc 4.9 port supports -msse4.2, but our assembler doesn't
> > > > support (at least some of the) opcodes that it uses.
> > > >
> > > > : Assembler messages:
> > > > :132: Error: no such instruction: `pcmpistri $2,(%rdi),%xmm2'
> > > > :172: Error: no such instruction: `pcmpistri $2,%xmm3,%xmm1'
> > > > :175: Error: no such instruction: `pcmpistri $58,%xmm3,%xmm3'
> > > >
> > > > Would it make sense to disable the option in the compiler for now?
> > > >
> > > >
> > >
> > > Not sure what that would achieve.  Rejecting the flag would just move
> > > the error from as to egcc.  Any port using it would have to patch out
> > > the option anyway (or use clang).
> > >
> >
> > The port where I ran into this has an autoconf check to see whether
> > the compiler accepts the flag. Since it's still a fairly new flag,
> > I assume that anything else trying to use it would do the same.
> >
>
> I ran into the same problem when trying to build Mesa with gcc 4.9
> a few months ago:
>
> https://bugs.freedesktop.org/show_bug.cgi?id=91806
>
>

-O2 is likely your problem here.  Is there a way to strip all
optimisation flags before this test and restore them afterwards?