Re: [PATCH 1/1] sparc leon: Use -Aleon assembler switch for -mcpu=leon arch

2011-11-05 Thread David Miller
From: Konrad Eisele kon...@gaisler.com
Date: Tue,  1 Nov 2011 10:22:13 +0100

 Use -Aleon to enable binutils sparc-leon architecture. The leon-arch
 binutils GAS has umul/smul and casa enabled.
 
 Signed-off-by: Konrad Eisele kon...@gaisler.com

You can't just add new assembler options that are only right now
being added to binutils.

Instead, you have to add a test to make sure that the binutils being
used alongside gcc actually supports the new option, and only pass it
in if so.  And subsequently, you cannot emit instructions that require
the -Aleon option unless this support is present too.

This is exactly what we had to do for VIS 3.0, FMAF, and HPC instructions
on Niagara3.

Look at the FMAF, HPC, and VIS 3.0 instructions
gcc_GAS_CHECK_FEATURE code in gcc/configure.ac for how to do such a
test.

Then once you have that, you can conditionlize instruction emission as
well based upon whether the feature CPP define is set or not.


[PATCH 1/1] sparc leon: Use -Aleon assembler switch for -mcpu=leon arch

2011-11-01 Thread Konrad Eisele
Use -Aleon to enable binutils sparc-leon architecture. The leon-arch
binutils GAS has umul/smul and casa enabled.

Signed-off-by: Konrad Eisele kon...@gaisler.com
---
 gcc/config/sparc/sparc.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 65b4527..bbadeb2 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -236,7 +236,7 @@ extern enum cmodel sparc_cmodel;
 
 #if TARGET_CPU_DEFAULT == TARGET_CPU_leon
 #define CPP_CPU32_DEFAULT_SPEC -D__leon__ -D__sparc_v8__
-#define ASM_CPU32_DEFAULT_SPEC 
+#define ASM_CPU32_DEFAULT_SPEC -Aleon
 #endif
 
 #endif
@@ -324,7 +324,7 @@ extern enum cmodel sparc_cmodel;
 
 /* Override in target specific files.  */
 #define ASM_CPU_SPEC \
-%{mcpu=sparclet:-Asparclet} %{mcpu=tsc701:-Asparclet} \
+%{mcpu=sparclet:-Asparclet} %{mcpu=leon:-Aleon} %{mcpu=tsc701:-Asparclet} \
 %{mcpu=sparclite:-Asparclite} \
 %{mcpu=sparclite86x:-Asparclite} \
 %{mcpu=f930:-Asparclite} %{mcpu=f934:-Asparclite} \
-- 
1.6.4.1