public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Function specific optimizations call for discussion
@ 2007-11-28 22:25 Michael Meissner
  2007-11-29 13:43 ` Karthik Kumar
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Michael Meissner @ 2007-11-28 22:25 UTC (permalink / raw)
  To: gcc, christophe.harle; +Cc: michael.meissner

One of the things that I've been interested in is adding support to GCC to
compile individual functions with specific target options.  I first presented a
draft at the Google mini-summit, and then another draft at the GCC developer
summit last July.

In the x86 world this would mean saying that an individual function can use
SSE5 instructions or SSE4.1 instructions.  This would simplify things for
people who need to write high performance libraries that run on different
architectures, and need to be optimal on each platform.  Ultimately, the goal
is to allow hotspot functions to be compiled several times with different
target specific optimizations.  I would welcome any thoughts or suggestions
about this proposal.

The proposal is at:
http://gcc.gnu.org/wiki/FunctionSpecificOpt

Part of the infrastructure work for doing this is already addressed in function
adaption project and we will work together with that team:
http://gcc.gnu.org/wiki/functionAdaptation

One of the things that I have considered and not added to the current proposal
is to change most of the -f, -O, -W options for a function.  This would be
relatively simple to add once the infrastructure is in place, but it can really
complicate things, since various optimizations depend on other optimizations
having been done.  Similarly, the -mtune= and -march= options can overly
complicate matters.

In addition, attribute(cold) and attribute(hot) will set the optimization level
to -Os and -O3.

I will be away on vacation from December 3-8th, and not reading mail during
that time.

-- 
Michael Meissner, AMD
90 Central Street, MS 83-29, Boxborough, MA, 01719, USA
michael.meissner@amd.com


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: Function specific optimizations call for discussion
@ 2007-11-29 18:40 J.C. Pizarro
  2007-11-29 20:30 ` J.C. Pizarro
  0 siblings, 1 reply; 18+ messages in thread
From: J.C. Pizarro @ 2007-11-29 18:40 UTC (permalink / raw)
  To: Sylvain Pion, gcc

On 2007/11/29, Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
> Michael Meissner a écrit :
> > One of the things that I've been interested in is adding support to GCC to
> > compile individual functions with specific target options.  I first presented a
> > draft at the Google mini-summit, and then another draft at the GCC developer
> > summit last July
> >
> > In the x86 world this would mean saying that an individual function can use
> > SSE5 instructions or SSE4.1 instructions.  This would simplify things for
> > people who need to write high performance libraries that run on different
> > architectures, and need to be optimal on each platform.  Ultimately, the goal
> > is to allow hotspot functions to be compiled several times with different
> > target specific optimizations.  I would welcome any thoughts or suggestions
> > about this proposal.
>
>
> I'm wondering if this proposal would support specifying things
> like adding -frounding-math when compiling specific functions.
> ( This particular case is connected to pragma FENV_ACCESS though. )
>
>
> Also, would this work when the functions is inline?
> I mean the case when the caller does not have the same attribute,
> but the inlined code of the callee still respects the attribute
> set for the inlined callee.

Autovectorization is still a researching issue.

The generated program/library should depend of the capabilities of present
historical machines from no-SIMD instructions until the last SSE9
instructions set (SSE, SSE2, SSE3, SSE4, SSE4.1, SSE5, 3DNow!, 3DNow+!...)

But there are many distros LiveCDs/LiveDVDs that they don't want to
grow brutally their sizes
(e.g. one specific LiveCD for supporting each one i-arch that has SSEi, i=1..9).

The good solution is extending the ELF format to insert SIMD stubs to unique
portable program/library for historical machines, and the loader will do the
work of choosing the adequate stub for the correspondent old or new machine.

But there is another problem, this strategy doesn't works fully in clusters
with processes's migration (ala old OpenMosix) because OpenMosix only
migrates processes with identical instructions sets to use for all machines.

   J.C.Pizarro

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-12-06  4:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-28 22:25 Function specific optimizations call for discussion Michael Meissner
2007-11-29 13:43 ` Karthik Kumar
2007-11-29 13:55 ` Ramana Radhakrishnan
     [not found]   ` <d841b3f30711290259m461d7378mc4aab0812c57df38@mail.gmail.com>
2007-11-29 15:19     ` Fwd: " Karthik Kumar
2007-11-29 16:39     ` Ramana Radhakrishnan
2007-11-29 23:28       ` Michael Meissner
2007-11-29 22:13   ` Michael Meissner
2007-11-29 14:53 ` Ramana Radhakrishnan
2007-11-29 22:06   ` Michael Meissner
2007-11-29 18:26 ` Sylvain Pion
2007-11-29 22:33   ` Michael Meissner
2007-11-30 14:53     ` Joseph S. Myers
2007-11-29 22:03 ` Weddington, Eric
2007-11-29 22:37   ` Michael Meissner
2007-11-29 22:44   ` tbp
2007-12-06  4:04 ` Jonathan Adamczewski
2007-11-29 18:40 J.C. Pizarro
2007-11-29 20:30 ` J.C. Pizarro

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 read-only IMAP folder(s) and NNTP newsgroup(s).