FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 04-20-2011, 05:59 PM
Jerry James
 
Default Package with x86 vector instruction support

I've got a question whose answer I expected to find on one of these
pages, but no joy:

https://fedoraproject.org/wiki/Architectures
https://fedoraproject.org/wiki/Architectures/x86
https://fedoraproject.org/wiki/Architectures/x86-64

I'm packaging a library that does some heavy mathematical
computations. The build system tries to cleverly determine whether an
Intel CPU with vector instructions is being used. Until I can
convince upstream to do this at runtime, I'll need to build the
package (a library) for the lowest common denominator. The package
checks for MMX, SSE, SSE2, SSE3, and SSSE3. For i686, can I assume
MMX? SSE? I believe I can also build an SSE2 version of the library
and drop it into /usr/lib/sse2. How about for x86_64? Can I assume
SSE2 is available? (I thought I could, but I see that /usr/lib64/sse2
exists on my machine, so now I'm uncertain.) I don't see a
/usr/lib64/sse3 or /usr/lib64/ssse3, so I just have to forget those,
right?

If there is a wiki page that answers these questions, I'd appreciate a
pointer. If not, perhaps someone with edit privileges could add the
answer to one of the pages listed above. Thanks,
--
Jerry James
http://www.jamezone.org/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-20-2011, 09:32 PM
Adam Jackson
 
Default Package with x86 vector instruction support

On 4/20/11 1:59 PM, Jerry James wrote:

> I'm packaging a library that does some heavy mathematical
> computations. The build system tries to cleverly determine whether an
> Intel CPU with vector instructions is being used. Until I can
> convince upstream to do this at runtime, I'll need to build the
> package (a library) for the lowest common denominator. The package
> checks for MMX, SSE, SSE2, SSE3, and SSSE3. For i686, can I assume
> MMX? SSE?

The least capable processor we've gone out of our way to fix things for
is the AMD Geode GX, which has MMX and 3DNow, but is also slightly less
than a proper Pentium Pro in that it doesn't have nopl or cmov.

However, rpm sets --march=i686, which implies only Pentium Pro and does
not imply MMX or anything newer. Not that I know of anyone who's tried
running Fedora on a bare i686 in recent memory.

> I believe I can also build an SSE2 version of the library
> and drop it into /usr/lib/sse2. How about for x86_64? Can I assume
> SSE2 is available? (I thought I could, but I see that /usr/lib64/sse2
> exists on my machine, so now I'm uncertain.) I don't see a
> /usr/lib64/sse3 or /usr/lib64/ssse3, so I just have to forget those,
> right?

All AMD64 and compatible chips support SSE and SSE2, correct. I'm
reasonably sure that path is simply for symmetry with i686 in case some
application was relying on it.

- ajax
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-20-2011, 09:57 PM
Jerry James
 
Default Package with x86 vector instruction support

On Wed, Apr 20, 2011 at 3:32 PM, Adam Jackson <ajax@redhat.com> wrote:
> The least capable processor we've gone out of our way to fix things for is
> the AMD Geode GX, which has MMX and 3DNow, but is also slightly less than a
> proper Pentium Pro in that it doesn't have nopl or cmov.
>
> However, rpm sets --march=i686, which implies only Pentium Pro and does not
> imply MMX or anything newer. *Not that I know of anyone who's tried running
> Fedora on a bare i686 in recent memory.

OK, that's fine. I'll compile without any of the fancy vector
instructions for i686, then explicitly pass an -march arg of my own (I
see some other packages use -march=pentium4) for the version that will
live in /usr/lib/sse2. For x86_64, I'll make sure that SSE3 and SSSE3
support is off and let it do its thing otherwise.

Thanks, Ajax!
--
Jerry James
http://www.jamezone.org/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-20-2011, 10:13 PM
Adam Jackson
 
Default Package with x86 vector instruction support

On 4/20/11 5:57 PM, Jerry James wrote:
> On Wed, Apr 20, 2011 at 3:32 PM, Adam Jackson<ajax@redhat.com> wrote:
>> The least capable processor we've gone out of our way to fix things for is
>> the AMD Geode GX, which has MMX and 3DNow, but is also slightly less than a
>> proper Pentium Pro in that it doesn't have nopl or cmov.
>>
>> However, rpm sets --march=i686, which implies only Pentium Pro and does not
>> imply MMX or anything newer. Not that I know of anyone who's tried running
>> Fedora on a bare i686 in recent memory.
>
> OK, that's fine. I'll compile without any of the fancy vector
> instructions for i686, then explicitly pass an -march arg of my own (I
> see some other packages use -march=pentium4) for the version that will
> live in /usr/lib/sse2. For x86_64, I'll make sure that SSE3 and SSSE3
> support is off and let it do its thing otherwise.

There do exist amd64 chips with sse3 and above. I don't know offhand
whether there's a %{_libdir}/sse3 for them, though I'd not be surprised
and I suspect a quick read of the ld.so source would tell you.

- ajax
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-20-2011, 11:27 PM
Jussi Lehtola
 
Default Package with x86 vector instruction support

On Wed, 20 Apr 2011 11:59:18 -0600
Jerry James <loganjerry@gmail.com> wrote:
> I'm packaging a library that does some heavy mathematical
> computations. The build system tries to cleverly determine whether an
> Intel CPU with vector instructions is being used.

What package are we talking about?

There is already at least one package in Fedora which does a similar
thing: ATLAS. It normally automatically tunes itself for the optimal
build flags, so some special tricks have to be done for packaging.

ATLAS has currently the following versions on Fedora:

i686: plain, 3dnow, sse, sse2 and sse3
x86_64: plain and sse2

The plain stands for the "atlas" package. I don't know what flags it
uses.
--
Jussi Lehtola
Fedora Project Contributor
jussilehtola@fedoraproject.org
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-21-2011, 01:45 AM
Jerry James
 
Default Package with x86 vector instruction support

On Wed, Apr 20, 2011 at 5:27 PM, Jussi Lehtola
<jussilehtola@fedoraproject.org> wrote:
> What package are we talking about?
>
> There is already at least one package in Fedora which does a similar
> thing: ATLAS. It normally automatically tunes itself for the optimal
> build flags, so some special tricks have to be done for packaging.
>
> ATLAS has currently the following versions on Fedora:
>
> i686: plain, 3dnow, sse, sse2 and sse3
> x86_64: plain and sse2
>
> The plain stands for the "atlas" package. I don't know what flags it
> uses.

I"m trying to update the m4ri package, which now does such tricks.
Thanks for the pointer. I'll look at the atlas spec file and see how
it's done there.
--
Jerry James
http://www.jamezone.org/
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-02-2011, 08:36 AM
Christoph Frieben
 
Default Package with x86 vector instruction support

On Wed, Apr 20, 2011 at 5:27 PM, Jussi Lehtola wrote:
> x86_64: plain and sse2

This does not look good to me, because the x86-64 instruction set only
includes sse2. sse3 is not available on every amd64 processor and thus
should not be used by default. The maintainer should rather build the
base package for sse2 and create an sse3 optimized subpackage
atlas-sse3. Otherwise illegal instruction errors can occur
unexpectedly.
~C
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 06:52 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org