Discussion:
[PATCH] SPARC: add mcpu=leon3v7 target
Sebastian Huber
2014-09-01 06:07:56 UTC
Permalink
Hello,

what is the status for this patch?
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : ***@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Daniel Hellstrom
2014-09-01 09:04:01 UTC
Permalink
Hello,

I have not received any comments on the patch yet.

Eric, do you have any thoughts?

Best Regards,

Daniel Hellstrom
Software Section Head
Aeroflex Gaisler AB
Aeroflex Microelectronic Solutions – HiRel
Kungsgatan 12
SE-411 19 Gothenburg, Sweden
Phone: +46 31 7758657
***@gaisler.com
www.Aeroflex.com/Gaisler
Post by Sebastian Huber
Hello,
what is the status for this patch?
Sebastian Huber
2014-09-16 05:09:27 UTC
Permalink
Ping.
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : ***@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
Eric Botcazou
2014-10-02 21:22:13 UTC
Permalink
[Sorry for the long delay]
The LEON3/4 soft-core CPU has support for both SPARCv7 and SPARCv8 that
is configurable at design time. The majority of the LEON3 ASICs are v8
compatible, however when designing an as small LEON3 as possible, v7
without FPU is frequently used.
The current GCC leon3 support implies the SPARCv8 instruction set
which is not compatible with SPARCv7. Relying on the standard SPARCv7
(-mcpu=v7) target for a LEON3-V7 is not feasible since the atomic
instruction (CAS) can not be generated by standard v7 target. This
is also a problem for binaries aiming to be compatible with all LEON3/4
processors.
* config.gcc (sparc*-*-*): Accept mcpu=leon3v7 processor
* doc/invoke.texi (SPARC options): add mcpu=leon3v7 comment
handle leon3v7 as leon3
* config/sparc/sparc-opts.h (enum processor_type): Add PROCESSOR_LEON3V7
* config/sparc/sparc.c (sparc_option_override): add leon3v7 support
* config/sparc/sparc.h (TARGET_CPU_leon3v7): new define
* config/sparc/sparc.md (cpu): add leon3v7
* config/sparc/sparc.opt (enum processor_type): Add leon3v7
OK for all branches (it should apply everywhere I think).

I don't remember if I already asked... does Aeroflex/Gaisler have a copyright
assignment on file for GCC? If so, do you also want to have SVN write access?
--
Eric Botcazou
Daniel Hellstrom
2014-10-03 14:17:29 UTC
Permalink
Hi,
Post by Eric Botcazou
[Sorry for the long delay]
The LEON3/4 soft-core CPU has support for both SPARCv7 and SPARCv8 that
is configurable at design time. The majority of the LEON3 ASICs are v8
compatible, however when designing an as small LEON3 as possible, v7
without FPU is frequently used.
The current GCC leon3 support implies the SPARCv8 instruction set
which is not compatible with SPARCv7. Relying on the standard SPARCv7
(-mcpu=v7) target for a LEON3-V7 is not feasible since the atomic
instruction (CAS) can not be generated by standard v7 target. This
is also a problem for binaries aiming to be compatible with all LEON3/4
processors.
* config.gcc (sparc*-*-*): Accept mcpu=leon3v7 processor
* doc/invoke.texi (SPARC options): add mcpu=leon3v7 comment
handle leon3v7 as leon3
* config/sparc/sparc-opts.h (enum processor_type): Add PROCESSOR_LEON3V7
* config/sparc/sparc.c (sparc_option_override): add leon3v7 support
* config/sparc/sparc.h (TARGET_CPU_leon3v7): new define
* config/sparc/sparc.md (cpu): add leon3v7
* config/sparc/sparc.opt (enum processor_type): Add leon3v7
OK for all branches (it should apply everywhere I think).
I have sent an updated patch just now. In case -Aleon does not exist it should select -Av7 instead of -Av8.
Post by Eric Botcazou
I don't remember if I already asked... does Aeroflex/Gaisler have a copyright
assignment on file for GCC? If so, do you also want to have SVN write access?
Yes, we have. Just verified that with the FSF. It would be a nice for us to have write access to the sparc parts.

Thanks!
Daniel
Eric Botcazou
2014-10-06 08:40:56 UTC
Permalink
Post by Daniel Hellstrom
I have sent an updated patch just now. In case -Aleon does not exist it
should select -Av7 instead of -Av8.
No patch was attached to this message though.
Post by Daniel Hellstrom
Yes, we have. Just verified that with the FSF. It would be a nice for us to
have write access to the sparc parts.
OK, but the granularity is limited so you'll have write access to the entire
SVN repository of GCC. You'll have "Write after approval" status so you'll
still need to post patches on gcc-patches@ and wait for someone (usually me
for SPARC) to approve them before installing them.

Everything is explained on http://gcc.gnu.org/svnwrite.html, including how to
request write access (you can mention me as the sponsor).
--
Eric Botcazou
Daniel Hellstrom
2014-10-06 09:43:28 UTC
Permalink
Post by Eric Botcazou
Post by Daniel Hellstrom
I have sent an updated patch just now. In case -Aleon does not exist it
should select -Av7 instead of -Av8.
No patch was attached to this message though.
I posted it with v2 in the subject. I have now attached it.
Post by Eric Botcazou
Post by Daniel Hellstrom
Yes, we have. Just verified that with the FSF. It would be a nice for us to
have write access to the sparc parts.
OK, but the granularity is limited so you'll have write access to the entire
SVN repository of GCC. You'll have "Write after approval" status so you'll
for SPARC) to approve them before installing them.
Everything is explained on http://gcc.gnu.org/svnwrite.html, including how to
request write access (you can mention me as the sponsor).
Thanks, I will check it out.

Daniel
Eric Botcazou
2014-10-06 16:57:28 UTC
Permalink
Post by Daniel Hellstrom
I posted it with v2 in the subject. I have now attached it.
There is a pasto in the v2:

@@ -1764,6 +1772,12 @@ extern int sparc_indent_opcode;
#define AS_LEON_FLAG "-Av8"
#endif

+#ifdef HAVE_AS_LEONV7
+#define AS_LEONV7_FLAG "-Aleon"
+#else
+#define AS_LEONV7_FLAG "-Av7"
+#endif
+
/* We use gcc _mcount for profiling. */
#define NO_PROFILE_COUNTERS 0


I think you would be better off adding a line to the arms of the existing code

#ifdef HAVE_AS_LEON
#define AS_LEON_FLAG "-Aleon"
#else
#define AS_LEON_FLAG "-Av8"
#endif

rather than duplicating it.
--
Eric Botcazou
Daniel Hellstrom
2014-10-07 06:06:02 UTC
Permalink
Post by Eric Botcazou
Post by Daniel Hellstrom
I posted it with v2 in the subject. I have now attached it.
@@ -1764,6 +1772,12 @@ extern int sparc_indent_opcode;
#define AS_LEON_FLAG "-Av8"
#endif
+#ifdef HAVE_AS_LEONV7
+#define AS_LEONV7_FLAG "-Aleon"
+#else
+#define AS_LEONV7_FLAG "-Av7"
+#endif
+
/* We use gcc _mcount for profiling. */
#define NO_PROFILE_COUNTERS 0
I think you would be better off adding a line to the arms of the existing code
#ifdef HAVE_AS_LEON
#define AS_LEON_FLAG "-Aleon"
#else
#define AS_LEON_FLAG "-Av8"
#endif
rather than duplicating it.
You're right. I have attached an updated patch. The new code becomes:

#ifdef HAVE_AS_LEON
#define AS_LEON_FLAG "-Aleon"
+#define AS_LEONV7_FLAG "-Aleon"
#else
#define AS_LEON_FLAG "-Av8"
+#define AS_LEONV7_FLAG "-Av7"
#endif

Thanks!
Eric Botcazou
2014-10-07 07:26:43 UTC
Permalink
Post by Eric Botcazou
#ifdef HAVE_AS_LEON
#define AS_LEON_FLAG "-Aleon"
+#define AS_LEONV7_FLAG "-Aleon"
#else
#define AS_LEON_FLAG "-Av8"
+#define AS_LEONV7_FLAG "-Av7"
#endif
The patch is OK for all active branches (trunk, 4.9 and 4.8), modulo nits in
the ChangeLog entry: capital letter at the beginning and period at the end of
every sentence.

* config.gcc (sparc*-*-*): Accept mcpu=leon3v7 processor.
* doc/invoke.texi (SPARC options): Add mcpu=leon3v7 comment.
* config/sparc/leon.md (leon3_load, leon_store, leon_fp_*): Handle
leon3v7 as leon3.
* config/sparc/sparc-opts.h (enum processor_type): Add LEON3V7.
* config/sparc/sparc.c (sparc_option_override): Add leon3v7 support.
* config/sparc/sparc.h (TARGET_CPU_leon3v7): New define.
* config/sparc/sparc.md (cpu): Add leon3v7.
* config/sparc/sparc.opt (enum processor_type): Add leon3v7.

I assume that you have applied for write access so you'll be able to install
it yourself. Otherwise let me know if I can lend a hand.
--
Eric Botcazou
Daniel Hellstrom
2014-10-07 08:47:28 UTC
Permalink
Post by Eric Botcazou
Post by Eric Botcazou
#ifdef HAVE_AS_LEON
#define AS_LEON_FLAG "-Aleon"
+#define AS_LEONV7_FLAG "-Aleon"
#else
#define AS_LEON_FLAG "-Av8"
+#define AS_LEONV7_FLAG "-Av7"
#endif
The patch is OK for all active branches (trunk, 4.9 and 4.8), modulo nits in
the ChangeLog entry: capital letter at the beginning and period at the end of
every sentence.
* config.gcc (sparc*-*-*): Accept mcpu=leon3v7 processor.
* doc/invoke.texi (SPARC options): Add mcpu=leon3v7 comment.
* config/sparc/leon.md (leon3_load, leon_store, leon_fp_*): Handle
leon3v7 as leon3.
* config/sparc/sparc-opts.h (enum processor_type): Add LEON3V7.
* config/sparc/sparc.c (sparc_option_override): Add leon3v7 support.
* config/sparc/sparc.h (TARGET_CPU_leon3v7): New define.
* config/sparc/sparc.md (cpu): Add leon3v7.
* config/sparc/sparc.opt (enum processor_type): Add leon3v7.
Ok, I will update that. Is there a way of generating the comments automatically?
Post by Eric Botcazou
I assume that you have applied for write access so you'll be able to install
it yourself. Otherwise let me know if I can lend a hand.
Thanks, I'll let you know. I just applied.

Daniel
Eric Botcazou
2014-10-07 09:07:39 UTC
Permalink
Post by Daniel Hellstrom
Ok, I will update that. Is there a way of generating the comments automatically?
Do you mean the ChangeLog? If so, contrib/mklog will generate a skeleton but
you'll still need to write the decription sentences.
--
Eric Botcazou
Daniel Hellstrom
2014-10-07 09:12:25 UTC
Permalink
Post by Eric Botcazou
Post by Daniel Hellstrom
Ok, I will update that. Is there a way of generating the comments automatically?
Do you mean the ChangeLog? If so, contrib/mklog will generate a skeleton but
you'll still need to write the decription sentences.
Perfect, thanks!

Loading...