The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] pcc in 8th edition
@ 2021-04-25 12:35 Paul Ruizendaal
  2021-04-25 12:49 ` arnold
  0 siblings, 1 reply; 18+ messages in thread
From: Paul Ruizendaal @ 2021-04-25 12:35 UTC (permalink / raw)
  To: TUHS main list

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

For clarity and ease of reference:

- The “Tour of paper” is for instance here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.48.3512 <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.48.3512>

- A machine description for the VAX that matches with that paper is for instance in the SysIII source: https://www.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/src/cmd/cc/vax/pcc/table.c <https://www.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/src/cmd/cc/vax/pcc/table.c>

- The new style description in 8th edition is here: https://www.tuhs.org/cgi-bin/utree.pl?file=V8/usr/src/cmd/ccom/vax/stin <https://www.tuhs.org/cgi-bin/utree.pl?file=V8/usr/src/cmd/ccom/vax/stin>

- The program that translates the “stin” file to a “table.c” file is here: https://www.tuhs.org/cgi-bin/utree.pl?file=V8/usr/src/cmd/ccom/common/sty.y <https://www.tuhs.org/cgi-bin/utree.pl?file=V8/usr/src/cmd/ccom/common/sty.y>


====

Sometimes one thing leads to another.

Following the recent mention of some retro-brew 68K single board systems, I decided to build a CB030 board (in progress). I figure it is a rough proxy for a 1980 VAX and would allow for some experimentation with the 32V / SysIII / 8th edition code.

My first thought was to use the M68K compiler that is included with the Blit sources (see THUS Archive for this), as I had used that before to explore some of the Blit source. That compiler is LP32, not ILP32 - which may be a source of trouble. Just changing the SZINT parameter yielded some issues, so I started looking at the PCC source.

This source does not have a “table.c” in the well known format as described in the “A tour of the portable C compiler” paper. Instead it uses a file “stin” which appears to be in a more compact format and is translated into a “table.c” file by a new pre-processor ("sty.y”). Then looking at the VAX compilers for 8th and 10th edition, these too use this “stin” file.

All the other m68K compilers (based on pcc) that I found appear to derive from the V7/32V/SysIII lineage, not from the 8th edition lineage.

A quick google did not yield much background or documentation on the STY format.

Anybody on this list that can shed some light on the history of the STY table and on how to use it? Any surviving reports or memos that would be useful?

Many thanks in advance

Paul


[-- Attachment #2: Type: text/html, Size: 3109 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [TUHS] pcc in 8th edition
@ 2021-04-26 18:00 Norman Wilson
  2021-04-26 18:11 ` Dan Cross
  0 siblings, 1 reply; 18+ messages in thread
From: Norman Wilson @ 2021-04-26 18:00 UTC (permalink / raw)
  To: tuhs

Adam Thornton:

  I sat in on an undergrad course from [Dave Hanson] my first year of
  grad school (94-95) and he taught it with lcc.  I asked `why not
  gcc' and he said, `gcc is 100,000 lines and I don't know what 90%
  of them are doing; lcc is 10,000'.

===

My copy is indeed about 10K lines, not counting the code-generator
modules.  Those are C files generated by a utility program lburg
from a template file.  The three architectures supplied in the
distribution, for MIPS, SPARC, and X86, have template files of
about 900, 1200, and 700 lines respectively.

The template file for the VAX is about 2800 lines, but includes
some metalanguage of my own, interpreted by an awk script, to
generate extra rules for all the direct-store type-to-type
instructions.  The C output from lburg for the other architectures
is 5000-6000 lines; for the VAX, after expansion by my awk
program and then by lburg, is nearly 20K.

Did someone say Complex Instruction Set?

Norman Wilson
Toronto ON

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [TUHS] pcc in 8th edition
@ 2021-04-25 22:02 Norman Wilson
  2021-04-26  0:18 ` Nemo Nusquam
  2021-04-26 16:51 ` Adam Thornton
  0 siblings, 2 replies; 18+ messages in thread
From: Norman Wilson @ 2021-04-25 22:02 UTC (permalink / raw)
  To: tuhs

Dan Cross:

  I seem to recall that LCC was also used, at least on 10th Ed. Am I
  imagining things, or was that real?

===

Some of the earliest work on lcc was done in 1127; Chris
Fraser worked for the Labs for some years, Dave Hanson
collaborated from his appointment at Princeton.  I believe
there was a /usr/bin/lcc.  Some programs used it, either
because they needed some part of the ISO syntax (pcc2 was
pre-ISO) or just because.

I don't think that version of lcc used Reiser's c2 optimizer;
it generated reasonably good code by itself, including
emitting auto-increment/decrement instructions.  Later
versions of lcc (such as that I later adopted as cc in
my personal V10 world) couldn't do that any more, so I
had to keep c2, and in fact to modify it to turn
	addl3 a,b,(p)
	mova 4(p),p
into
	addl3 a,b,(p)+
(or maybe it was addl2 $4,p, I forget)

But that's another story which I'll tell only if asked,
and nothing to do with the original question.

^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [TUHS] pcc in 8th edition
@ 2021-04-25 20:48 Norman Wilson
  2021-04-25 20:54 ` Dan Cross
  2021-04-26  6:29 ` Noel Hunt
  0 siblings, 2 replies; 18+ messages in thread
From: Norman Wilson @ 2021-04-25 20:48 UTC (permalink / raw)
  To: tuhs

I was waiting to see whether Steve Johnson would speak
up, because I'm not much of an expert; but yes, the VAX
C compiler in V8/V9/V10 is pcc2.

I think there are a few Research-specific hacks to add
additional stab info for pi(9.1) and on request insert
basic-block profiling for lcomp(1), but nothing major.

Maybe we did some hacking on c2 as well.  I know I did
a lot of c2 cleanup later in my personal hacking in
Toronto, but I don't think I did much if any in New
Jersey.  But that's independent of the compiler (modulo,
I think, some of my later fixes discovered by using c2
with a different compiler).

Norman Wilson
Toronto ON

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [TUHS] pcc in 8th edition
@ 2021-04-25  9:15 Paul Ruizendaal via TUHS
  0 siblings, 0 replies; 18+ messages in thread
From: Paul Ruizendaal via TUHS @ 2021-04-25  9:15 UTC (permalink / raw)
  To: TUHS main list

Sometimes one thing leads to another.

Following the recent mention of some retro-brew 68K single board systems, I decided to build a CB030 board (in progress). I figure it is a rough proxy for a 1980 VAX and would allow for some experimentation with the 32V / SysIII / 8th edition code.

My first thought was to use the M68K compiler that is included with the bit sources (see THUS Archive for this), as I had used that before to explore some of the Blit source. That compiler is LP32, not ILP32 - which may be a source of trouble. Just changing the SZINT parameter yielded some issues, so I started looking at the PCC source.

This source does not have a “table.c” in the well known format as described in the “A tour of the portable C compiler” paper. Instead it uses a file “stin” which appears to be in a more compact format and is translated into a “table.c” file by a new pre-processor ("sty.y”). Then looking at the VAX compilers for 8th and 10th edition, these to use this “stin” file.

All the other m68K compilers (based on pcc) that I found appear to derive from the V7/32V/SysIII lineage, not from the 8th edition lineage.

A quick google did not yield much background or documentation on the STY format.

Anybody on this list that can shed some light on the history of the STY table and on how to use it? Any surviving reports or memos that would be useful?

Many thanks in advance

Paul


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

end of thread, other threads:[~2021-04-30 23:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 12:35 [TUHS] pcc in 8th edition Paul Ruizendaal
2021-04-25 12:49 ` arnold
2021-04-25 14:04   ` Paul Ruizendaal
2021-04-25 15:45   ` Paul Ruizendaal
2021-04-25 17:11     ` Clem Cole
2021-04-25 17:32       ` arnold
2021-04-25 17:46         ` Clem Cole
2021-04-25 20:11       ` Paul Ruizendaal
2021-04-30 23:08       ` Paul Ruizendaal
  -- strict thread matches above, loose matches on Subject: below --
2021-04-26 18:00 Norman Wilson
2021-04-26 18:11 ` Dan Cross
2021-04-25 22:02 Norman Wilson
2021-04-26  0:18 ` Nemo Nusquam
2021-04-26 16:51 ` Adam Thornton
2021-04-25 20:48 Norman Wilson
2021-04-25 20:54 ` Dan Cross
2021-04-26  6:29 ` Noel Hunt
2021-04-25  9:15 Paul Ruizendaal via TUHS

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 NNTP newsgroup(s).