[Coco] OS-9 / NitOS-9 C programmers, lend me your makefiles

Jeff Teunissen deek at d2dc.net
Sun Nov 29 03:53:44 EST 2020


I managed to get the C optimizer to do the "CnoY" optimization, so I
was able to pull it back out of the compiler! I didn't like doing that
optimization in the compiler, because the compiler is already very
large and I don't yet know how to turn it back into a 2-pass process
like the one Tandy released.

The next DCC release, currently being prepared for NitrOS-9 EOU beta
6, will have the ability to optimize for OS-9 level 2 without adding
an additional stage. I gave the optimizer the ability to read
specially-formatted text files to hold its optimization patterns, and
translated all of the optimizations it already knew how to do into
that format. There are two files, "level1.patterns" and
"level2.patterns", which can be read from /DD/Lib/ when the optimizer
runs, before it starts processing the input file.

The optimizer always reads level1.patterns, but if you call it with
the -2 option, it will also read level2.patterns. Support for this
option has been added to the main DCC executable, so you can (for
example) do "dcc -s2 program.c" for a self-contained C program source
and get an optimized build out of it.

Most big programs that I have seen get about 4 percent smaller with
the -2 option, but the better you code the less benefit you'll get out
of it. If your program is heavy with global variables, (direct,
extern, bare strings, etc.) and other 'static' data, then your
programs could get significantly faster -- but variables declared
inside functions, those will get almost no benefit.

On Wed, Nov 18, 2020 at 4:37 AM Bill Pierce via Coco
<coco at maltedmedia.com> wrote:
>
> Glad I haven't tried it yet LMAO
> Bill
>
>
> -----Original Message-----
> From: Jeff Teunissen <deek at d2dc.net>
> To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> Sent: Wed, Nov 18, 2020 12:31 am
> Subject: Re: [Coco] OS-9 / NitOS-9 C programmers, lend me your makefiles
>
> Replying to myself, sheesh.
>
> I was wrong, the Y-indexing stripping in the compiler doesn't work
> correctly yet. I will upload a version with it removed when I get a
> chance, to save some bytes.
>
> On Tue, Nov 17, 2020 at 1:17 PM Jeff Teunissen <deek at d2dc.net> wrote:
> >
> > Bill,
> >
> > The dcc68 binary that is in my repo currently has an undocumented feature: I accidentally left in the code that added "CnoY" support. The dcc executive doesn't support it (yet?), but if you do:
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list