gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > compiler flags -march, -mtune, -mcpu

#143314 - a128 - Fri Oct 19, 2007 1:51 pm

Some use
-march=armv5te -mtune=arm946e-s
others use
-mcpu=arm9tdmi -mtune=arm9tdmi

which is correct?

#143320 - Vich - Fri Oct 19, 2007 3:34 pm

I'm not sure but:
http://en.wikipedia.org/wiki/Nintendo_DS
-> "ARM946E-S main CPU and ARM7TDMI co-processor"

And then:
http://en.wikipedia.org/wiki/ARM_architecture
-> "ARM9E ARMv5TE ARM946E-S"

So I'd say that the first line appears technically correct... but I have to say that I'm using the second one and it seems to work fine too.
_________________
[project website] [personal website]

#143330 - freemaan - Fri Oct 19, 2007 5:44 pm

"-march=armv5te -mtune=arm946e-s" is the correct one.
_________________
My other nickname: davido2

#143344 - tepples - Fri Oct 19, 2007 10:43 pm

a128 wrote:
others use
-mcpu=arm9tdmi -mtune=arm9tdmi

This was from the arm-elf- days before Binutils was properly modified to distinguish between ARM9 configurations with an FPU and ARM9 configurations without an FPU. The arm-eabi- versions of devkitARM have fixed this, and freemaan is right.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#143352 - Undefined Error - Sat Oct 20, 2007 2:05 am

Not that I'm arguing, but for curiosity's sake - What's the benefit of having the right architecture if the other one worked? Or to put it another way, what extra features that the old setup didn't support but the DS CPU does support were we missing before?
_________________
This post was spawned from an Undefined Error.

#143354 - Dwedit - Sat Oct 20, 2007 3:26 am

I've seen zero difference between using this switch and not using the switch. For comparison, use the -S option to generate ASM code and see how it differs.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#143400 - M3d10n - Sat Oct 20, 2007 7:38 pm

Undefined Error wrote:
Not that I'm arguing, but for curiosity's sake - What's the benefit of having the right architecture if the other one worked? Or to put it another way, what extra features that the old setup didn't support but the DS CPU does support were we missing before?


There are no extra features, but it doesn't really hurt, does it?

The question can go the other way: why use the wrong architecture when the correct one is available at no cost other than changing a line in the makefile? If anything, projects compiled with the correct architecture could become slightly more compatible with emulators.

#143406 - DekuTree64 - Sat Oct 20, 2007 9:52 pm

The only difference I've noticed is that having it set to arm9tdmi won't let you use the DSP instructions (smulxy, qadd, etc) in assembly code.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#143438 - a128 - Sun Oct 21, 2007 3:53 pm

DekuTree64 wrote:
The only difference I've noticed is that having it set to arm9tdmi won't let you use the DSP instructions (smulxy, qadd, etc) in assembly code.


Thanks for all the awnsers.....no i know whats going on with those flags