Commit graph

40 commits

Author SHA1 Message Date
George Koehler 34cf0c8b63 Kill registers a, de, when i80 ncg does Call libem.
I compiled tests/plat/lib/test.c with ack -mcpm, but i80 ncg did emit
wrong code in writehex(uint32_t) for

    "0123456789abcdef"[code & 0xf]

The code called '.and' to evaluate `code & 0xf`, then tried to call
'.cii' to narrow the result from 4 to 2 bytes, but it passed garbage
instead of 4 to '.cii'.  The rule for '.and' was

    pat and defined($1)
    kills ALL
    uses dereg={const2,$1}
    gen Call {label,".and"}

This failed to kill register de={const2,4}, so ncg pushed de,
expecting to push 4, but actually pushing garbage.

Fix such rules using `mvi a,...` or `lxi de,...` so ncg doesn't track
the token in the register.  This is like the i86 table.  A different
fix would use a dummy instruction `killreg a` or `killreg de` like the
m68020 table.

Also correct 1 to $1 when calling '.exg'.
2017-12-06 22:14:00 -05:00
George Koehler 5301cceee3 Declare machine-dependent functions in mach/proto/ncg
This breaks all machines because the declared return type void
disagrees with the implicit return type int (when I compile mach.c
with clang).  Unbreak i386, i80, i86, m68020, powerpc, vc4 by adding
the return types to mach.c.  We don't build any other machines; they
are broken since commit a46ee91 (May 19, 2013) declared void prolog()
and commit fd91851 (Nov 10, 2016) declared void mes(), with both
declarations in mach/proto/ncg/fillem.c.

Also fix mach/vc4/ncg/mach.c where type full is long, so fprintf()
must use "%ld" not "%d" to print full nlocals.
2017-11-13 14:23:44 -05:00
David Given fd91851005 Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.
2016-11-10 22:04:18 +01:00
David Given f67c98e239 Distributions are a pain --- let's not bother any more. Instead, we just tag
the repository and download a complete snapshot, old and ancient stuff and all.
2016-09-02 23:00:38 +02:00
George Koehler 0131ca4d46 Delete 689 undead files.
These files "magically reappeared" after the conversion from CVS to
Mercurial.  The old CVS repository deleted these files but did not
record *when* it deleted these files.  The conversion resurrected these
files because they have no history of deletion.  These files were
probably deleted before year 1995.  The CVS repository begins to record
deletions around 1995.

These files may still appear in older revisions of this Mercurial
repository, when they should already be deleted.  There is no way to fix
this, because the CVS repository provides no dates of deletion.

See http://sourceforge.net/mailarchive/message.php?msg_id=29823032
2012-09-20 22:26:32 -04:00
dtrg df088c184b Added optimised rules for int<<8 and uint>>8 (which can be done with simple register shuffling rather than calling .sli). 2007-04-29 23:00:31 +00:00
dtrg 440d6faadd Fixed a bug where loc lol stf was getting the constant pushed onto the stack *after* stf had popped it off. 2007-04-27 22:15:31 +00:00
ceriel 1db6a3029b Header --> Id 1994-06-24 14:02:31 +00:00
ceriel 6f03cff48f Some minor modifications reflecting some changes in the peephole optimizer 1992-09-01 09:39:15 +00:00
ceriel 564cbc6eba Only call NOP routine when debugging table 1991-09-04 10:55:52 +00:00
ceriel c7edcc34d6 New installation mechanism 1991-08-27 10:47:25 +00:00
ceriel 22378eaff8 produce commons for newlbss 1991-03-18 15:06:01 +00:00
ceriel 0d65b92220 removed -i flag 1991-02-19 16:57:39 +00:00
eck 4ef2c70ed3 added stackheight message handling 1990-07-18 14:53:19 +00:00
eck 78d3e500fb added CPP variable to Makefile 1989-10-20 11:05:00 +00:00
ceriel c820d77690 new floating point constant mechanism 1989-07-10 16:52:02 +00:00
ceriel 2f7e414d42 corrected lint entry 1988-06-28 14:36:21 +00:00
ceriel c998623932 Some more adaptions to new semantics of ncgg 1987-11-10 13:49:04 +00:00
ceriel 12d731dfcf adapted table to new semantics of STACK 1987-08-26 13:47:37 +00:00
ceriel 69843cf9ce Added -DNDEBUG to Makefile, table now kills regvars 1987-07-06 15:28:59 +00:00
ceriel d41028a664 pass EMHOME to nested make 1987-06-30 18:30:45 +00:00
ceriel 81b1d21c35 Initial revision 1987-04-13 10:32:47 +00:00
ceriel 96d15a6c05 minor mod 1987-04-03 11:18:49 +00:00
ceriel 410bfa3cb2 "word" is always a "long" 1987-04-02 10:04:25 +00:00
ceriel 88db8b43da Added distr entry 1987-03-19 10:12:51 +00:00
ceriel 5537abbdfb Added copyright notice 1987-03-10 01:26:51 +00:00
ceriel 815166e421 Added copyright notice 1987-03-09 19:15:41 +00:00
ceriel 0d1c90a23e Adapted to new assembler 1987-02-09 16:49:13 +00:00
ceriel ebd44261fe cc --> $(CC), added -O flag to CFLAGS 1987-01-28 12:49:42 +00:00
ceriel e77bde5e75 Added TABLEFLAGS and CGGFLAGS. 1987-01-12 15:10:49 +00:00
ceriel 031d26deb4 Preprocess table. 1987-01-12 14:50:25 +00:00
em 94534b7c15 1- Floating point routines now call routines instead of calling trp. 1985-04-12 14:25:59 +00:00
garde 80e349860b Added RCS id. 1985-03-18 12:55:07 +00:00
garde d52117c8dd Some less important changes 1985-03-18 10:00:30 +00:00
garde 736a2d1022 Many things improved and extended 1985-03-04 13:42:38 +00:00
keie 815b0e0f0f *** empty log message *** 1985-02-12 14:20:30 +00:00
garde 8e154eb826 Many, many improvements made, ususually small ones.
For example: many em-patterns have got alternative code-rules.
1985-02-01 12:51:56 +00:00
garde a849b751a9 src1 and src2 extended.
Errors in 'pat loc cmi teq' and 'pat loc cmi tne' recovered.
Second stack-pattern for 'pat zlt' and 'pat zge' added.
Patterns for 'lil loc adi sil', 'lil inc sil', 'lil dec sil'
and 'sil lil' added.
1985-01-22 19:55:11 +00:00
garde cd78a1a27a case 8 and case 6 deleted in switch of function 'prolog' 1985-01-21 14:17:11 +00:00
garde d8d2068664 Initial revision 1985-01-17 14:31:34 +00:00