# pentium m cflags

## no_hope

what CFALGS should I use for a Pentium M laptop, pentium3 or pentium4? Will I get away with using -march?

thanks!

----------

## xcham

I'm taking a stab in the dark here but I'd say pentium 3, as the clock speed/featureset seems more like that of a p3...

Let us all know whether or not the Centrino wireless card works  :Smile: 

----------

## ScubaStreb

I've got a Centrino 1.3 (yes it has that damn Intel wireless card). From what I've read, the Pentium M is more like a Pentium 3 than a Pentium 4.  Technically, it's not really either.  You can find success stories of people who have compiled with both.

I decided to compile with conservative PIII flags.  Here are my settings.

CHOST=i686-pc-linux-gnu

CFLAGS=-march=pentium3 -02 -pipe -fomit-frame-pointer

CXXFLAGS=${CFLAGS}

So far, it's running well, but it's only been up for a day.  I'm still installing/adding a few things to the system and will update after I've had a chance to play with the system some more.

Cheers!

----------

## andrewfu

I think the Pentium M (Banias) chip is closer to Pentium III than to P4, although it isn't really close to either.  It has a longer pipeline than PIII which allows for higher clock speeds, but less than P4.  Pentium M also has a higher IPC than both Pentium III and Pentium 4.   Pentium M has the same execution unit layout as the Pentium III.

There's a pretty good article about the chip at: http://www.anandtech.com/mobile/showdoc.html?i=1800

I'm about to get a new ThinkPad T40 so I am too curious about what the best optimization settings would be for the Pentium M chip.  I'd like to see some benchmarks with different optimization settings on that chip...

Oh by the way, does anyone know if the Intel Wireless is integrated into the chipset or is it just a mini PCI card that I can replace?

----------

## kamikaz3

I compiled every thing fine with march=pentium4 with gcc 3.2.1 and now 3.2.2

I think it's closer to pentium 4, cause it has sse2

maybe future gcc releases should contain march=pentiumm or something like that

----------

## ScubaStreb

 *andrewfu wrote:*   

> 
> 
> I'm about to get a new ThinkPad T40 so I am too curious about what the best optimization settings would be for the Pentium M chip.  I'd like to see some benchmarks with different optimization settings on that chip...
> 
> Oh by the way, does anyone know if the Intel Wireless is integrated into the chipset or is it just a mini PCI card that I can replace?

 

The T40 does have a mini-pci wireless card.  Apparently it has some wireless card restrictions in the bios though.  Here's a link http://www.ussg.iu.edu/hypermail/linux/kernel/0306.1/0700.html

----------

## fishhead

 *andrewfu wrote:*   

> I think the Pentium M (Banias) chip is closer to Pentium III than to P4, although it isn't really close to either.  It has a longer pipeline than PIII which allows for higher clock speeds, but less than P4.  Pentium M also has a higher IPC than both Pentium III and Pentium 4.   Pentium M has the same execution unit layout as the Pentium III.
> 
> 

 

If this is true, then you will almost ceartnly want -march=pentium3, since the execution unit layout is probably the most significant of all in optimizing.

----------

## smiler.se

 *kamikaz3 wrote:*   

> I compiled every thing fine with march=pentium4 with gcc 3.2.1 and now 3.2.2
> 
> I think it's closer to pentium 4, cause it has sse2

 

And thats about it. I do has same instructionset as the p4 but the _core_ is still much closer to p3 than p4. Check this thread for more info.

 *kamikaz3 wrote:*   

> maybe future gcc releases should contain march=pentiumm or something like that

 

Sounds like a good idea. Let the gcc-people hear about it  :Smile: 

Also, this thread is a dupe.

----------

## smiler.se

 *xcham wrote:*   

> Let us all know whether or not the Centrino wireless card works 

 

I does NOT work   :Crying or Very sad: 

----------

## jaloha

I recently conducted some benchmarks on some cryptography code I wrote.  These were performed on a Pentium-M 1.5ghz with GCC 3.2.3.  The results are as follows (lower numbers are better):

```

no optimizations:

score 1:114

score 2:122

-O2

score 1:62

score 2:59

-O3

score 1:44

score 2:38

-O3 -mcpu=pentium4

score 1:43

score 2:38

-O3 -mcpu=pentium3

score 1:45

score 2:38

-O3 -march=pentium4 -mcpu=pentium4

score 1:46

score 2:44

-O3 -march=pentium3 -mcpu=pentium4

score 1:46

score 2:44

-O3 -march=pentium3 -mcpu=pentium3

score 1:47

score 2:42

-O3 -march=pentium4 -mcpu=pentium3

score 1:47

score 2:42

```

-fomit-frame-pointer did not change any of the previous results.

Probably because of the simple code structure (You should not use this anyway since it makes bug hunting more difficult for developers when your program crashes).

Score 2 is my code and score 1 is someone elses.  We both have different optimization stratigies.

Conclusion:

I think that the pentium-M is different than both the PIII and PIV and does not appear to gain from the instruction structuring hueristics for either.  Infact, it appears to hurt the performance.  mcpu=pentium4 seems to help since it takes advantage of special instructions that only the pentium4 and pentium-M have.  If you have to pick one, I would say the M is more like the 4 since they share more instructions.  Execution structure does not appear to matter since it seems definately better to just optimize in general instead of for just one processor.

----------

## ian!

I did some benchmarking and testing for stability. Now I'm using this CFLAGS and didn't have any problems yet:

CFLAGS="-03 -march=pentium3 -fomit-frame-pointer -funroll-all-loops -ftracer -momit-leaf-frame-pointer -pipe"

I experienced problems with '-march=pentium4' (e.g. SDL) so that I'm using 'pentium3' now.

--ian!

----------

## ian!

I experienced problems with "-funroll-all-loops". See: https://forums.gentoo.org/viewtopic.php?t=25586

Now I'm using this flags:

CFLAGS="-O3 -march=pentium3 -fomit-frame-pointer -ftracer -momit-leaf-frame-pointer -pipe"

----------

## Malakin

 *smiler.se wrote:*   

>  *xcham wrote:*   Let us all know whether or not the Centrino wireless card works :) 
> 
> I does NOT work  :cry:

 Isn't this a centrino wifi driver?

http://ipw2100.sourceforge.net/

----------

## IvanHoe

I used -march=pentium3 (because it's based on the Pentium 3 core) and -mcpu=pentium4 so I could enable sse2 instructions (-msse2).

----------

## Malakin

 *Quote:*   

> I used -march=pentium3 (because it's based on the Pentium 3 core) and -mcpu=pentium4 so I could enable sse2 instructions (-msse2)

 Maybe that was just a typo but it works the other way around, march indicates which instructions are available to use and mcpu indicates which instruction scheduling to use.

----------

## WindforceV2

I just go to extreme. Take all the flags i can use safely, at least i think.

```
CFLAGS="-O3 -march=pentium3 -mfpmath=sse -mmmx -msse -msse2 -maccumulate-outgoing-args -mno-push-args -fomit-frame-pointer -pipe"

```

And it works fine now, tho just up for one day.

----------

## nukem996

These are the use cflags my friend and I both use and we are very happy with them

```

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

CHOST="i686-pc-linux-gnu"

```

The p-m(centrino) is a heavily modifed p4 for laptop use. My laptop is much newer then my desktop(a p4) and the laptop is much much faster even though my desktop is a 1.4ghz 512RDRAM while my laptop is 1.5ghz(Ive read this is really closer to a 2.6ghz p4 though) 512DDR.

----------

## Malakin

 *Quote:*   

> The p-m(centrino) is a heavily modifed p4 for laptop use.

 The design team started off with the P3 to base their design from. There are plenty of articles on it like the one andrewfu linked to above:

http://www.anandtech.com/mobile/showdoc.html?i=1800

----------

## nukem996

Well compiling as a p4 works fine and I have had no problems with it.

----------

## jhgz1

 *Quote:*   

> 
> 
> Intel 386 and AMD x86-64 Options
> 
> These -m options are defined for the i386 and x86-64 family of computers: 
> ...

 

http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html

so it seems, that we will get a specific pentium-m type with the next gcc release. how long will that take? probably a while since 3.4.0 isn't even in unstable. dang! me want it now!

----------

## Raistlin

kind of a revival for this thread  :Wink: 

Now, that gcc-3.4.6 knows the -march=pentium-m flag I was wondering if it is save to change my 

```
-march=pentium3
```

 to 

```
-march=pentium-m
```

----------

## ronmon

Your best bet is "-mtune=pentium-m". I've been using that for a while now and it is quite safe.

----------

## Raistlin

 *Quote:*   

> -march=cpu-type
> 
>     Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type. 

  (GCC documentation)

Ok, I'll try it out then   :Shocked:   :Rolling Eyes: 

----------

