public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Moving code generation from gcc 4.3.0 to gcc 12?
@ 2023-07-10 12:57 Sid Maxwell
  2023-07-10 13:04 ` Jonathan Wakely
  2023-07-10 17:13 ` Segher Boessenkool
  0 siblings, 2 replies; 11+ messages in thread
From: Sid Maxwell @ 2023-07-10 12:57 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 308 bytes --]

I'm exploring updating a compiler built against the GCC 4.3.0 codebase to
(likely) GCC 12.3.  Is there any documentation regarding API changes
between these versions affecting the machine description (.md) and other
machine-specific code?

Thanks for any pointers, comments, suggestions....

-+- Sid Maxwell

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 12:57 Moving code generation from gcc 4.3.0 to gcc 12? Sid Maxwell
@ 2023-07-10 13:04 ` Jonathan Wakely
  2023-07-10 14:34   ` Sid Maxwell
  2023-07-10 17:13 ` Segher Boessenkool
  1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2023-07-10 13:04 UTC (permalink / raw)
  To: Sid Maxwell; +Cc: gcc-help

On Mon, 10 Jul 2023 at 13:58, Sid Maxwell via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> I'm exploring updating a compiler built against the GCC 4.3.0 codebase to
> (likely) GCC 12.3.  Is there any documentation regarding API changes
> between these versions affecting the machine description (.md) and other
> machine-specific code?

These are probably a good place to start:
https://gcc.gnu.org/gcc-4.4/changes.html
...
https://gcc.gnu.org/gcc-4.9/changes.html
https://gcc.gnu.org/gcc-5/changes.html
...
https://gcc.gnu.org/gcc-12/changes.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 13:04 ` Jonathan Wakely
@ 2023-07-10 14:34   ` Sid Maxwell
  0 siblings, 0 replies; 11+ messages in thread
From: Sid Maxwell @ 2023-07-10 14:34 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

Thanks, Johnathon, I was aware of these, and I'll definitely check them out.

-+- Sid

On Mon, Jul 10, 2023 at 9:04 AM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

> On Mon, 10 Jul 2023 at 13:58, Sid Maxwell via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
> >
> > I'm exploring updating a compiler built against the GCC 4.3.0 codebase to
> > (likely) GCC 12.3.  Is there any documentation regarding API changes
> > between these versions affecting the machine description (.md) and other
> > machine-specific code?
>
> These are probably a good place to start:
> https://gcc.gnu.org/gcc-4.4/changes.html
> ...
> https://gcc.gnu.org/gcc-4.9/changes.html
> https://gcc.gnu.org/gcc-5/changes.html
> ...
> https://gcc.gnu.org/gcc-12/changes.html
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 12:57 Moving code generation from gcc 4.3.0 to gcc 12? Sid Maxwell
  2023-07-10 13:04 ` Jonathan Wakely
@ 2023-07-10 17:13 ` Segher Boessenkool
  2023-07-10 18:51   ` Sid Maxwell
  1 sibling, 1 reply; 11+ messages in thread
From: Segher Boessenkool @ 2023-07-10 17:13 UTC (permalink / raw)
  To: Sid Maxwell; +Cc: gcc-help

Hi!

On Mon, Jul 10, 2023 at 08:57:50AM -0400, Sid Maxwell via Gcc-help wrote:
> I'm exploring updating a compiler built against the GCC 4.3.0 codebase to
> (likely) GCC 12.3.  Is there any documentation regarding API changes
> between these versions affecting the machine description (.md) and other
> machine-specific code?

In fifteen years a lot has changed in GCC, but a (perhaps) surprising
amount has stayed the same as well.  Most earlier optimisations are done
on the Gimple representation now, since such a higher-level
representation is better suited for higher-level transformations; but
most of the lower-level optimisation is still done in RTL, a
representation that is much better suited for lower level things.  So
most stuff in .md files will still work as-is!

There are some new target macros you should implement.  Some just for
better results, but a few will be absolutely necessary.  There are some
changes like constraint strings in expander definitions are frowned upon
these days (just leave them out completely, instead of empty strings).
And new pseudo-registers from splitters are allowed now (but this does
not invalidate old code).

My advice is to go through *all* internals documentation.  Just skim
things you find boring or uninteresting, but hopefully you will remember
what is there, at least!  And see what new stuff there is that you could
take advantage of.

There will be new failures in the testsuite, of course, and some of
those will point to new features you do not implement yet.
Unfortunately for many new features the testsuite is opt-in only, so you
get no indication you could do better there unless you activly go
looking there.

Oh, and please change your backend to use LRA instead of just old
reload, since we are trying to get rid of the latter.  For many targets
this does not need more than just flipping the switch, but testing can
reveal shortcomings in your backend, or in the generic compiler as well.

Good luck, and have fun!  Maybe in a year or half year or whatever you
can write a retrospective for us, what things were surprising, what we
did well and what not, etc.?


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 17:13 ` Segher Boessenkool
@ 2023-07-10 18:51   ` Sid Maxwell
  2023-07-10 19:00     ` Arsen Arsenović
  0 siblings, 1 reply; 11+ messages in thread
From: Sid Maxwell @ 2023-07-10 18:51 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 2792 bytes --]

Thank you, Segher.

One thing that might be helpful would be, as I read the current "GNU
Compiler Collection Internals
For gcc version 14.0.0 (pre-release)", to compare it with the version of
the same document that was relevant for 4.3.0.  Do you know where I might
learn which version is appropriate, and where I might find it?  (
https://gcc.gnu.org/onlinedocs/ only seems to have the current version.)

-+- Sid

On Mon, Jul 10, 2023 at 1:15 PM Segher Boessenkool <
segher@kernel.crashing.org> wrote:

> Hi!
>
> On Mon, Jul 10, 2023 at 08:57:50AM -0400, Sid Maxwell via Gcc-help wrote:
> > I'm exploring updating a compiler built against the GCC 4.3.0 codebase to
> > (likely) GCC 12.3.  Is there any documentation regarding API changes
> > between these versions affecting the machine description (.md) and other
> > machine-specific code?
>
> In fifteen years a lot has changed in GCC, but a (perhaps) surprising
> amount has stayed the same as well.  Most earlier optimisations are done
> on the Gimple representation now, since such a higher-level
> representation is better suited for higher-level transformations; but
> most of the lower-level optimisation is still done in RTL, a
> representation that is much better suited for lower level things.  So
> most stuff in .md files will still work as-is!
>
> There are some new target macros you should implement.  Some just for
> better results, but a few will be absolutely necessary.  There are some
> changes like constraint strings in expander definitions are frowned upon
> these days (just leave them out completely, instead of empty strings).
> And new pseudo-registers from splitters are allowed now (but this does
> not invalidate old code).
>
> My advice is to go through *all* internals documentation.  Just skim
> things you find boring or uninteresting, but hopefully you will remember
> what is there, at least!  And see what new stuff there is that you could
> take advantage of.
>
> There will be new failures in the testsuite, of course, and some of
> those will point to new features you do not implement yet.
> Unfortunately for many new features the testsuite is opt-in only, so you
> get no indication you could do better there unless you activly go
> looking there.
>
> Oh, and please change your backend to use LRA instead of just old
> reload, since we are trying to get rid of the latter.  For many targets
> this does not need more than just flipping the switch, but testing can
> reveal shortcomings in your backend, or in the generic compiler as well.
>
> Good luck, and have fun!  Maybe in a year or half year or whatever you
> can write a retrospective for us, what things were surprising, what we
> did well and what not, etc.?
>
>
> Segher
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 18:51   ` Sid Maxwell
@ 2023-07-10 19:00     ` Arsen Arsenović
  2023-07-10 19:01       ` Sid Maxwell
  0 siblings, 1 reply; 11+ messages in thread
From: Arsen Arsenović @ 2023-07-10 19:00 UTC (permalink / raw)
  To: Sid Maxwell; +Cc: Segher Boessenkool, gcc-help

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]


Sid Maxwell via Gcc-help <gcc-help@gcc.gnu.org> writes:

> Thank you, Segher.
>
> One thing that might be helpful would be, as I read the current "GNU
> Compiler Collection Internals
> For gcc version 14.0.0 (pre-release)", to compare it with the version of
> the same document that was relevant for 4.3.0.  Do you know where I might
> learn which version is appropriate, and where I might find it?  (
> https://gcc.gnu.org/onlinedocs/ only seems to have the current version.)

You should have received a copy in the info format in your gcc 4.3.0
source tarball or distribution.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 19:00     ` Arsen Arsenović
@ 2023-07-10 19:01       ` Sid Maxwell
  2023-07-10 20:06         ` Segher Boessenkool
  0 siblings, 1 reply; 11+ messages in thread
From: Sid Maxwell @ 2023-07-10 19:01 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Segher Boessenkool, gcc-help

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Of course, I should've thought of that.  Thank you, Arsen!

On Mon, Jul 10, 2023 at 3:01 PM Arsen Arsenović <arsen@aarsen.me> wrote:

>
> Sid Maxwell via Gcc-help <gcc-help@gcc.gnu.org> writes:
>
> > Thank you, Segher.
> >
> > One thing that might be helpful would be, as I read the current "GNU
> > Compiler Collection Internals
> > For gcc version 14.0.0 (pre-release)", to compare it with the version of
> > the same document that was relevant for 4.3.0.  Do you know where I might
> > learn which version is appropriate, and where I might find it?  (
> > https://gcc.gnu.org/onlinedocs/ only seems to have the current version.)
>
> You should have received a copy in the info format in your gcc 4.3.0
> source tarball or distribution.
> --
> Arsen Arsenović
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 19:01       ` Sid Maxwell
@ 2023-07-10 20:06         ` Segher Boessenkool
  2023-07-10 20:31           ` Sid Maxwell
  2023-07-10 22:04           ` Arsen Arsenović
  0 siblings, 2 replies; 11+ messages in thread
From: Segher Boessenkool @ 2023-07-10 20:06 UTC (permalink / raw)
  To: Sid Maxwell; +Cc: Arsen Arsenović, gcc-help

On Mon, Jul 10, 2023 at 03:01:58PM -0400, Sid Maxwell wrote:
> Of course, I should've thought of that.  Thank you, Arsen!

[ Please don't top-post. ]

> On Mon, Jul 10, 2023 at 3:01 PM Arsen Arsenović <arsen@aarsen.me> wrote:
> > Sid Maxwell via Gcc-help <gcc-help@gcc.gnu.org> writes:
> > > Thank you, Segher.
> > >
> > > One thing that might be helpful would be, as I read the current "GNU
> > > Compiler Collection Internals
> > > For gcc version 14.0.0 (pre-release)", to compare it with the version of
> > > the same document that was relevant for 4.3.0.  Do you know where I might
> > > learn which version is appropriate, and where I might find it?  (
> > > https://gcc.gnu.org/onlinedocs/ only seems to have the current version.)
> >
> > You should have received a copy in the info format in your gcc 4.3.0
> > source tarball or distribution.

Not in the info format, those are binary files (.info files).  Instead,
the source code (in the doc/ directory) has the documentation in TeXinfo
format (.texi files).

https://gcc.gnu.org/onlinedocs/ has all versions going back to 2.95.3,
just look a bit further down?  :-)

But yeah, just   git log -p gcc/doc/   will tell you most.  Maybe not in
the best presentation for what you need -- but usually it is best to
have multiple representations and use what most suitable in any
particular situation :-)


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 20:06         ` Segher Boessenkool
@ 2023-07-10 20:31           ` Sid Maxwell
  2023-07-10 22:04           ` Arsen Arsenović
  1 sibling, 0 replies; 11+ messages in thread
From: Sid Maxwell @ 2023-07-10 20:31 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Arsen Arsenović, gcc-help

[-- Attachment #1: Type: text/plain, Size: 1150 bytes --]

On Mon, Jul 10, 2023 at 4:11 PM Segher Boessenkool <
segher@kernel.crashing.org> wrote:

> On Mon, Jul 10, 2023 at 03:01:58PM -0400, Sid Maxwell wrote:
> > Of course, I should've thought of that.  Thank you, Arsen!
>
> [ Please don't top-post. ]
>
> ...
>
> Not in the info format, those are binary files (.info files).  Instead,
> the source code (in the doc/ directory) has the documentation in TeXinfo
> format (.texi files).
>
> https://gcc.gnu.org/onlinedocs/ has all versions going back to 2.95.3,
> just look a bit further down?  :-)
>
> But yeah, just   git log -p gcc/doc/   will tell you most.  Maybe not in
> the best presentation for what you need -- but usually it is best to
> have multiple representations and use what most suitable in any
> particular situation :-)
>
>
> Segher
>

(Regarding top posting: I blame GMail, but only because I wasn't paying
attention.)

Thanks for the explanation.  I'd looked at the online docs, but didn't see
"internals" mentioned except under "Current Development".  Until you
mentioned .info/.texi, it hadn't occurred to me to look for gccint.texi.
:-)

-+- Sid

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 20:06         ` Segher Boessenkool
  2023-07-10 20:31           ` Sid Maxwell
@ 2023-07-10 22:04           ` Arsen Arsenović
  2023-07-10 22:29             ` Segher Boessenkool
  1 sibling, 1 reply; 11+ messages in thread
From: Arsen Arsenović @ 2023-07-10 22:04 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: Sid Maxwell, gcc-help

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]


Segher Boessenkool <segher@kernel.crashing.org> writes:

> On Mon, Jul 10, 2023 at 03:01:58PM -0400, Sid Maxwell wrote:
>> Of course, I should've thought of that.  Thank you, Arsen!
>
> [ Please don't top-post. ]
>
>> On Mon, Jul 10, 2023 at 3:01 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>> > Sid Maxwell via Gcc-help <gcc-help@gcc.gnu.org> writes:
>> > > Thank you, Segher.
>> > >
>> > > One thing that might be helpful would be, as I read the current "GNU
>> > > Compiler Collection Internals
>> > > For gcc version 14.0.0 (pre-release)", to compare it with the version of
>> > > the same document that was relevant for 4.3.0.  Do you know where I might
>> > > learn which version is appropriate, and where I might find it?  (
>> > > https://gcc.gnu.org/onlinedocs/ only seems to have the current version.)
>> >
>> > You should have received a copy in the info format in your gcc 4.3.0
>> > source tarball or distribution.
>
> Not in the info format, those are binary files (.info files).  Instead,
> the source code (in the doc/ directory) has the documentation in TeXinfo
> format (.texi files).

No, the distribution also contains gccint.info.

> https://gcc.gnu.org/onlinedocs/ has all versions going back to 2.95.3,
> just look a bit further down?  :-)
>
> But yeah, just   git log -p gcc/doc/   will tell you most.  Maybe not in
> the best presentation for what you need -- but usually it is best to
> have multiple representations and use what most suitable in any
> particular situation :-)
>
>
> Segher


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Moving code generation from gcc 4.3.0 to gcc 12?
  2023-07-10 22:04           ` Arsen Arsenović
@ 2023-07-10 22:29             ` Segher Boessenkool
  0 siblings, 0 replies; 11+ messages in thread
From: Segher Boessenkool @ 2023-07-10 22:29 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: Sid Maxwell, gcc-help

On Tue, Jul 11, 2023 at 12:04:49AM +0200, Arsen Arsenović wrote:
> Segher Boessenkool <segher@kernel.crashing.org> writes:
> > Not in the info format, those are binary files (.info files).  Instead,
> > the source code (in the doc/ directory) has the documentation in TeXinfo
> > format (.texi files).
> 
> No, the distribution also contains gccint.info.

Well, colour me purple!  The source tarballs indeed contain this as
well.  Huh!  Thanks for the correction.


Segher

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-07-10 22:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 12:57 Moving code generation from gcc 4.3.0 to gcc 12? Sid Maxwell
2023-07-10 13:04 ` Jonathan Wakely
2023-07-10 14:34   ` Sid Maxwell
2023-07-10 17:13 ` Segher Boessenkool
2023-07-10 18:51   ` Sid Maxwell
2023-07-10 19:00     ` Arsen Arsenović
2023-07-10 19:01       ` Sid Maxwell
2023-07-10 20:06         ` Segher Boessenkool
2023-07-10 20:31           ` Sid Maxwell
2023-07-10 22:04           ` Arsen Arsenović
2023-07-10 22:29             ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).