[oe] [PATCH] cortex-m3: adjusted target cflags

Khem Raj raj.khem at gmail.com
Mon Feb 7 21:35:57 UTC 2011


On Mon, Feb 7, 2011 at 12:59 PM, Enrico Scholz
<enrico.scholz at sigma-chemnitz.de> wrote:
> Khem Raj <raj.khem at gmail.com> writes:
>
>>> The '-mcpu=cortex-m3' is shorter than '-march=armv7-m -mtune=cortex-m3'
>>> and enables workarounds like '-mfix-cortex-m3-ldrd'.
>>
>> Does -mcpu=cortex-m3 also cause gcc to tune for cortex-m3 ?
>
> Yes; logic in gcc/config/arm/arm.c is:
>
> |    if (i == ARM_OPT_SET_CPU || i == ARM_OPT_SET_TUNE)
> |      arm_tune = (enum processor_type) (sel - ptr->processors);
> |
> |    if (i == ARM_OPT_SET_ARCH)
> |      target_arch_cpu = sel->core;
> |
> |    if (i == ARM_OPT_SET_CPU)
> |      selected_cpu = (enum processor_type) (sel - ptr->processors);
>
> '-mcpu' causes the highest optimization level (both for the used instruction
> set (--> '-march') and the "soft" optimizations (--> '-mcpu')).

OK that seems better. Can you check what does gcc emits in an assembly file
when using -mcpu=cortex-m3 in your case. If it emits sdiv instruction or not

int foo (long a, long b)
{
        return a/b;
}


Acked-by: Khem Raj <raj.khem at gmail.com>

>
>
>
> Enrico
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>




More information about the Openembedded-devel mailing list