[cfe-commits] r154389 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/linux-as.c

Hal Finkel hfinkel at anl.gov
Sat Apr 21 18:41:07 PDT 2012


Evgeniy,

Unfortunately, we need to be much more careful here. While gas for ARM
does support -mcpu, -march and -mfpu, this is not true for other ISAs.
Looking at the man page, it seems that the supported flags are:

ARM: -mcpu=, -march=, -mfpu=
i386: -march= (-mtune=: should we map -mcpu= to -mtune=?)
MIPS: (same as i386)
PowerPC: supports cpu, but as -m<cpu> (meaning -m403|-m405|-mppc64|...)
SPARC: supports arch, but as -xarch=

How do you think we should fix this?

 -Hal

On Tue, 10 Apr 2012 09:05:41 -0000
Evgeniy Stepanov <eugeni.stepanov at gmail.com> wrote:

> Author: eugenis
> Date: Tue Apr 10 04:05:40 2012
> New Revision: 154389
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=154389&view=rev
> Log:
> Pass -march, -mcpu, -mfpu to linuxtools assembler.
> 
> Added:
>     cfe/trunk/test/Driver/linux-as.c
> Modified:
>     cfe/trunk/lib/Driver/Tools.cpp
> 
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=154389&r1=154388&r2=154389&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original) +++
> cfe/trunk/lib/Driver/Tools.cpp Tue Apr 10 04:05:40 2012 @@ -5089,6
> +5089,10 @@ CmdArgs.push_back("-EL");
>    }
>  
> +  Args.AddLastArg(CmdArgs, options::OPT_march_EQ);
> +  Args.AddLastArg(CmdArgs, options::OPT_mcpu_EQ);
> +  Args.AddLastArg(CmdArgs, options::OPT_mfpu_EQ);
> +
>    Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
>                         options::OPT_Xassembler);
>  
> 
> Added: cfe/trunk/test/Driver/linux-as.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/linux-as.c?rev=154389&view=auto
> ==============================================================================
> --- cfe/trunk/test/Driver/linux-as.c (added) +++
> cfe/trunk/test/Driver/linux-as.c Tue Apr 10 04:05:40 2012 @@ -0,0
> +1,31 @@ +// Check passing options to the assembler for ARM targets.
> +//
> +// RUN: %clang -target arm-linux -### \
> +// RUN:   -no-integrated-as -c %s 2>&1 \
> +// RUN:   | FileCheck -check-prefix=ARM %s
> +// CHECK-ARM: as{{(.exe)?}}"
> +//
> +// RUN: %clang -target arm-linux -mcpu=cortex-a8 -### \
> +// RUN:   -no-integrated-as -c %s 2>&1 \
> +// RUN:   | FileCheck -check-prefix=ARM-MCPU %s
> +// CHECK-ARM-MCPU: as{{(.exe)?}}" "-mcpu=cortex-a8"
> +//
> +// RUN: %clang -target arm-linux -mfpu=neon -### \
> +// RUN:   -no-integrated-as -c %s 2>&1 \
> +// RUN:   | FileCheck -check-prefix=ARM-MFPU %s
> +// CHECK-ARM-MFPU: as{{(.exe)?}}" "-mfpu=neon"
> +//
> +// RUN: %clang -target arm-linux -march=armv7-a -### \
> +// RUN:   -no-integrated-as -c %s 2>&1 \
> +// RUN:   | FileCheck -check-prefix=ARM-MARCH %s
> +// CHECK-ARM-MARCH: as{{(.exe)?}}" "-march=armv7-a"
> +//
> +// RUN: %clang -target arm-linux -mcpu=cortex-a8 -mfpu=neon
> -march=armv7-a -### \ +// RUN:   -no-integrated-as -c %s 2>&1 \
> +// RUN:   | FileCheck -check-prefix=ARM-ALL %s
> +// CHECK-ARM-ALL: as{{(.exe)?}}" "-march=armv7-a" "-mcpu=cortex-a8"
> "-mfpu=neon" +//
> +// RUN: %clang -target armv7-linux -mcpu=cortex-a8 -### \
> +// RUN:   -no-integrated-as -c %s 2>&1 \
> +// RUN:   | FileCheck -check-prefix=ARM-TARGET %s
> +// CHECK-ARM-TARGET: as{{(.exe)?}}" "-mfpu=neon" "-mcpu=cortex-a8"
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-commits mailing list