Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!noao!ncar!gatech!wrdis01!mips!daver!bungi.com!news From: culberts@hplwbc.hpl.hp.com (Bruce Culbertson) Newsgroups: comp.sys.nsc.32k Subject: Re: Gcc 1.39, some bugs fixed & cleaner diffs Message-ID: <9103051916.AA02529@hplwbc.hpl.hp.com> Date: 5 Mar 91 19:16:41 GMT Sender: news@daver.bungi.com Lines: 53 Approved: news@daver.bungi.com Hurray for Jyrki and all the work he has done with the GNU stuff! I haven't tried his code yet because my pc532 is down at the moment, thanks to my recent move, but I have heard good reports from others who have tried them. > ...But structure alignment is still only > 16 bits in the Minix tm file (properly 32 for Mach), which I don't > like, but can't change because my filesystem is done with 16-bit > alignment and I have no decent backup scheme. The Minix FS code reads and writes arrays of inode structures to the inode blocks in the file system. This kind of code is inherently non-portable since different compilers pack structures differently. It would be nice if the Minix code were made portable, although it would result in some performance penalty. I better not criticize to loudly because someone might point out that my assembler and linker have the same kind of problem -- they read and write arrays of symbol table structures. I need to fix that -- I want the a.out format to stay the same, regardless of what compiler you use. > Bruce's way of generating pc-relative addressing modes does make the > code smaller if the called function happens to be near - a macro > PC_RELATIVE now controls the behavious - if defined, SYMBOL_REFS and > LABEL_REFS are compiled to pc-relative addressing modes. I developed an algorithm which allows my assembler to crunch displacements (which are variable length on the 32000) down to the smallest usable size (with some rare exceptions), even for forward references. My assembler crunches all displacements it can, even in addressing modes other than PC-relative. While this may not quite be a miracle of programming, you can pay a fair amount of money for assemblers which cannot do this, e.g. Microsoft's MASM and National's GENIX assembler (at least in versions I have tried). Unfortunately, since this is done at assemble time, not link time, displacements to external symbols and symbols in BSS and DATA cannot be crunched. Crunching displacements does make the code a little smaller, which takes better advantage of the small 32532 I-cache. > So, it seems the most efficient thing would be to use bsr whenever > possible. The 1.35 gcc, which I distributed with pc532-minix, uses bsr most of the time. 1.37 seems to use jsr for some reason and, I gather, 1.39 does also. Those later versions seem to have a problem recognizing constant addresses. By the way, I used PC-relative addressing as much as possible in an effort to make the code as position-independent as possible. Because C lets you do things like initialize pointers, and because I like tools which do such initializations at compile-time, it is hard to make the code completely position-independent. Keep up the good work, Jyrki!