[HECnet] Benchmarks - WHETSTONE.C

Johnny Billquist bqt at softjar.se
Wed Jan 16 13:37:35 PST 2013


On 2013-01-16 21:26, Steve Davidson wrote:
Is their a version of PCC that could generate PDP-11 assembly code?

Generating assembly code is only half of the problem. To compile and run this thing, you also need enough parts of a C library to make it work, and matching calling conventions between your compiled code and that C library...

	Johnny


-Steve

________________________________

From: owner-hecnet at Update.UU.SE on behalf of John Wilson
Sent: Tue 1/15/2013 21:46
To: hecnet at Update.UU.SE
Subject: Re: [HECnet] Benchmarks - WHETSTONE.C



On Tue, Jan 15, 2013 at 05:56:33PM +0100, Johnny Billquist wrote:
That it would... Anyone have GCC setup to generate something that can
be linked under RSX?

That's a tall order (adding .OBJ to binutils?) ... and lately I think GCC for
PDP-11s is pretty badly broken.   I built the (then-)latest GCC to cross-compile
for PDP-11s a few weeks ago (working on porting Conticki) and it's pretty
broken -- stack frames get all tangled up on any function with >2 locals.
Turning off frame pointers or enabling optimization just makes it worse.

I did a temporary hack which got it generating seemingly correct (but *awful*)
code, but I didn't understand how it worked well enough to really fix it.   It
seems like it's trying to keep track of modifications to SP but apparently on
*any* modification it assumes that it's lost track of the top of the stack
(even if the modification was push and then pop, i.e. no net change) and tries
to dig its way out with the frame pointer (which it gets off by a word).

But anyway ... I would think a GAS-to-MACRO translator wouldn't be too
difficult to write, since GCC doesn't depend too heavily on GASsisms.

John Wilson
D Bit




-- 
Johnny Billquist                                   || "I'm on a bus
                                                                  ||   on a psychedelic trip
email: bqt at softjar.se                         ||   Reading murder books
pdp is alive!                                         ||   tryin' to stay hip" - B. Idol



More information about the Hecnet-list mailing list