diff mbox

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

Message ID 1320139333-23550-1-git-send-email-konrad@gaisler.com
State New
Headers show

Commit Message

Konrad Eisele Nov. 1, 2011, 9:22 a.m. UTC
Use -Aleon to enable binutils sparc-leon architecture. The leon-arch
binutils GAS has umul/smul and casa enabled.

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

Comments

David Miller Nov. 5, 2011, 9:41 p.m. UTC | #1
From: Konrad Eisele <konrad@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 <konrad@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.
diff mbox

Patch

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} \