Unix Technical Forum

Pentium-m gcc optimization.

This is a discussion on Pentium-m gcc optimization. within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> Hi, just got a centrino laptop (for free) so have to use it whether I want it or not ...


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 07:29 AM
hrv
 
Posts: n/a
Default Pentium-m gcc optimization.

Hi,

just got a centrino laptop (for free) so have to use it whether I want it or
not . I can swear I've seen "-march=pentium-m" somewhere on the Net but
now when I actualy have the hardware and have gone through gcc man it seems
like I was hallucinating and there is now such thing.
I'd really appreciate some comments on pentium-m optimization. Has anybody
tried it with "-march=pentium4"? Any weird behavior?
AFAIK, pentium-m is just a P3 CPU with added ess2, SpeedStep gen.3, 3d
predictor, "fixed up" pipe-lines and few other tweaks. So optimizing for P3
would definitely work but seems like loosing few things, at the same time
optimizing for P4 seems a bit worrying since I'm not sure about the ABI of
both CPUs.
Comments ??

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 07:29 AM
Geoff Mishkin
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

I believe the Pentium M arch is only in gcc 3.4. So I think you should
use Pentium 3 for march, and also use flags to enable sse2, etc.

--Geoff Mishkin <gmishkin@comcast.net>


On Wed, 09 Jun 2004 19:24:40 +0100, hrv wrote:

> Hi,
>
> just got a centrino laptop (for free) so have to use it whether I want it or
> not . I can swear I've seen "-march=pentium-m" somewhere on the Net but
> now when I actualy have the hardware and have gone through gcc man it seems
> like I was hallucinating and there is now such thing.
> I'd really appreciate some comments on pentium-m optimization. Has anybody
> tried it with "-march=pentium4"? Any weird behavior?
> AFAIK, pentium-m is just a P3 CPU with added ess2, SpeedStep gen.3, 3d
> predictor, "fixed up" pipe-lines and few other tweaks. So optimizing for P3
> would definitely work but seems like loosing few things, at the same time
> optimizing for P4 seems a bit worrying since I'm not sure about the ABI of
> both CPUs.
> Comments ??
>
> Thanks.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 07:29 AM
hrv
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

Geoff Mishkin wrote:

> I believe the Pentium M arch is only in gcc 3.4. So I think you should
> use Pentium 3 for march, and also use flags to enable sse2, etc.
>
> --Geoff Mishkin <gmishkin@comcast.net>


That's an option, thanks, I forgot I can add sse2 with "-msse2".
That's what I thought, gcc 3.4 should have "pentium-m" but just looked at
gcc 3.4 man and it's not to be found anywhere. Hmm!
Has anyone tried gcc 3.4? Is it usable?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 07:29 AM
sarylo
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

hrv wrote:
> Hi,
>
> I'd really appreciate some comments on pentium-m optimization. Has anybody
> tried it with "-march=pentium4"? Any weird behavior?


I saw a page somewhere on intel.com where it is said that the gcc flag
to use for a pentium-M is 'pentium4'.

My settings :

gcc (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)

Linux wok 2.6.5-gentoo-r1 #7 Sun May 16 00:53:38 CEST 2004 i686 Intel(R)
Pentium(R) M processor 1700MHz GenuineIntel GNU/Linux

CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"

I had -march=pentium4 since the begining, more than 6 months now, and
never had any problem with it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 07:29 AM
W.B.
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

On Wed, 09 Jun 2004 21:32:29 +0200, sarylo wrote:

> hrv wrote:
>> Hi,
>>
>> I'd really appreciate some comments on pentium-m optimization. Has anybody
>> tried it with "-march=pentium4"? Any weird behavior?

>
> I saw a page somewhere on intel.com where it is said that the gcc flag
> to use for a pentium-M is 'pentium4'.
>
>
> I had -march=pentium4 since the begining, more than 6 months now, and
> never had any problem with it.


I have been installing on a P-M over the last couple days. Why I decided
to go with -march=pentium3 is the following post I found on the Kernel
list: (quote):

P-M is not a P4 core, it's an enhanced PIII core.
SSE2 was added, but compiler support for SSE2 f.p.
math shouldn't matter for the kernel.

Using P4 optimisations on a P-M may actually reduce
performance, due to the different micro-architectures.
(P4 made shifts and some leas more expensive, and
simple add/and/sub/etc less expensive.)

IOW, don't lie to the compiler and pretend P-M == P4
with that -march=pentium4.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2008, 07:29 AM
=?ISO-8859-15?Q?Lu=EDs?= Ferreira
 
Posts: n/a
Default Re: Pentium-m gcc optimization.



http://www.freehackers.org/gentoo/gc...flag_gcc3.html

--
Luís Ferreira
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-21-2008, 07:58 AM
numlock
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

hrv wrote:
> Hi,
>
> just got a centrino laptop (for free) so have to use it whether I want it or
> not . I can swear I've seen "-march=pentium-m" somewhere on the Net but
> now when I actualy have the hardware and have gone through gcc man it seems
> like I was hallucinating and there is now such thing.
> I'd really appreciate some comments on pentium-m optimization. Has anybody
> tried it with "-march=pentium4"? Any weird behavior?
> AFAIK, pentium-m is just a P3 CPU with added ess2, SpeedStep gen.3, 3d
> predictor, "fixed up" pipe-lines and few other tweaks. So optimizing for P3
> would definitely work but seems like loosing few things, at the same time
> optimizing for P4 seems a bit worrying since I'm not sure about the ABI of
> both CPUs.
> Comments ??
>
> Thanks.
>


Hi,

Here are the combination of flags which work the best (for me):

CFLAGS="-pipe -O3 -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse,387
-maccumulate-outgoing-args -mno-align-stringops -fomit-frame-pointer
-ffast-math -funroll-all-loops -fsched-spec-load -fprefetch-loop-arrays
-ftracer -fmove-all-movables --param max-gcse-passes=4"

With gcc 3.3 It yielded the fastest code for my projects (intensive
integer calculations) and I haven't had any problems with any ebuilds at
all :-)

Regards,
numlock
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-21-2008, 07:58 AM
=?UTF-8?B?TWFjaWVqIEfDs3JuaWNraQ==?=
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

Użytkownik numlock napisał:
> hrv wrote:
>
>> Hi,
>>
>> just got a centrino laptop (for free) so have to use it whether I want
>> it or
>> not . I can swear I've seen "-march=pentium-m" somewhere on the Net but
>> now when I actualy have the hardware and have gone through gcc man it
>> seems
>> like I was hallucinating and there is now such thing.
>> I'd really appreciate some comments on pentium-m optimization. Has
>> anybody
>> tried it with "-march=pentium4"? Any weird behavior?
>> AFAIK, pentium-m is just a P3 CPU with added ess2, SpeedStep gen.3, 3d
>> predictor, "fixed up" pipe-lines and few other tweaks. So optimizing
>> for P3
>> would definitely work but seems like loosing few things, at the same time
>> optimizing for P4 seems a bit worrying since I'm not sure about the
>> ABI of
>> both CPUs.
>> Comments ??
>>


Just installed 2004.2 from stage1 with
CFLAGS="-pipe -O2 -march=pentium4 -mmmx -msse -msse2
-mfpmath=sse -fomit-frame-pointer" \
running kde now and all is ok
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-21-2008, 07:58 AM
W.B
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

On Thu, 26 Aug 2004 14:46:49 +0200, numlock wrote:

> hrv wrote:
>> Hi,
>>
>> just got a centrino laptop (for free) so have to use it whether I want it or
>> not . I can swear I've seen "-march=pentium-m" somewhere on the Net but
>> now when I actualy have the hardware and have gone through gcc man it seems
>> like I was hallucinating and there is now such thing.
>> I'd really appreciate some comments on pentium-m optimization. Has anybody
>> tried it with "-march=pentium4"? Any weird behavior?
>> AFAIK, pentium-m is just a P3 CPU with added ess2, SpeedStep gen.3, 3d
>> predictor, "fixed up" pipe-lines and few other tweaks. So optimizing for P3
>> would definitely work but seems like loosing few things, at the same time
>> optimizing for P4 seems a bit worrying since I'm not sure about the ABI of
>> both CPUs.
>> Comments ??
>>
>> Thanks.
>>

>
> Hi,
>
> Here are the combination of flags which work the best (for me):
>
> CFLAGS="-pipe -O3 -march=pentium4 -mmmx -msse -msse2 -mfpmath=sse,387
> -maccumulate-outgoing-args -mno-align-stringops -fomit-frame-pointer
> -ffast-math -funroll-all-loops -fsched-spec-load -fprefetch-loop-arrays
> -ftracer -fmove-all-movables --param max-gcse-passes=4"
>
> With gcc 3.3 It yielded the fastest code for my projects (intensive
> integer calculations) and I haven't had any problems with any ebuilds at
> all :-)
>
> Regards,
> numlock


Should be

"-march=pentium3"

According to the kernel developers. But as always, do whatever you want to
do .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-21-2008, 07:58 AM
Timo Maier
 
Posts: n/a
Default Re: Pentium-m gcc optimization.

Hi!

> "-march=pentium3"

IIRC there's a -march=pentium-m in gcc 3.4.x

--
http://tam.belchenstuermer.de/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com