From: Magnus Damm <damm@opensource.se>
To: Nathan Ingersoll <ningerso@ruralcenter.org>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Runtime Altivec detection
Date: Fri, 7 Mar 2003 19:44:45 +0000 [thread overview]
Message-ID: <20030307194445.270e7dfc.damm@opensource.se> (raw)
In-Reply-To: <20030307180802.GB6252@ruralcenter.org>
On Fri, 7 Mar 2003 12:08:02 -0600
Nathan Ingersoll <ningerso@ruralcenter.org> wrote:
> > mplayer and ffmpeg does some kind of detection runtime.
> > I'm playing with it right now actually.
>
> Last I heard, it was a compile time detection or flag. So you had to build
> separate binaries for your G4 and non-G4 machines.
The latest released mplayer requires you to pass --enable-altivec to configure.
A runtime check is then performed in:
mplayer/cpudetect.c and ffmpeg/libavcodec/ppc/dsputil_altivec.c
> > I've seen that -maltivec and -mabi=altivec is passed sometimes.
> > If I want to build a binary that should be able to run on a
> > G3 without altivec and utilize altivec when present on a G4,
> > what flags should I use?
>
> There is no specific flag for doing so, you need some code to detect the
> capability, and then decide whether to use the Altivec routine.
Sorry, I think I was a little bit unclear in my question,
Do you have to pass any specific flags to gcc to be able to complile
altivec code, and if these flags are "-maltivec -mabi=altivec", is
it possible to pass them to gcc and still compile for G3 (-mcpu=750)?
It's a nice feature to be able to build one binary that is optimized
for G3 but does runtime checks and enables altivec if present.
/ magnus
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2003-03-07 19:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-07 16:47 Runtime Altivec detection Nathan Ingersoll
2003-03-07 17:24 ` Dan Malek
2003-03-07 17:35 ` Nathan Ingersoll
2003-03-07 17:37 ` Anton Blanchard
2003-03-07 17:41 ` Benjamin Herrenschmidt
2003-03-07 17:52 ` Nathan Ingersoll
2003-03-07 18:55 ` Magnus Damm
2003-03-07 18:06 ` Benjamin Herrenschmidt
2003-03-07 18:18 ` Hollis Blanchard
2003-03-07 18:54 ` Magnus Damm
2003-03-07 18:08 ` Nathan Ingersoll
2003-03-07 19:44 ` Magnus Damm [this message]
2003-03-07 19:23 ` Nathan Ingersoll
-- strict thread matches above, loose matches on Subject: below --
2003-03-08 2:02 Bill Fink
2003-03-08 2:11 ` Hollis Blanchard
2003-03-08 8:04 ` Bill Fink
2003-03-08 18:21 ` Nathan Ingersoll
2003-03-09 4:01 Albert Cahalan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030307194445.270e7dfc.damm@opensource.se \
--to=damm@opensource.se \
--cc=linuxppc-dev@lists.linuxppc.org \
--cc=ningerso@ruralcenter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).