ack.git
7 years agoaelflod and aslod now default to not showing the memory dump. dtrg-cgen
David Given [Sun, 13 Nov 2016 19:50:23 +0000 (20:50 +0100)]
aelflod and aslod now default to not showing the memory dump.

7 years agoPrecise's qemu package is qemu-system.
David Given [Sun, 13 Nov 2016 13:20:14 +0000 (14:20 +0100)]
Precise's qemu package is qemu-system.

7 years agoTypo fix.
David Given [Sun, 13 Nov 2016 13:17:38 +0000 (14:17 +0100)]
Typo fix.

7 years agoAttempt to enable the qemuppc tests on Travis.
David Given [Sun, 13 Nov 2016 13:10:44 +0000 (14:10 +0100)]
Attempt to enable the qemuppc tests on Travis.

7 years agoFix buffer overrun: if LABEL_STARTER is seen but LABEL_TERMINATOR is not, the
David Given [Sun, 13 Nov 2016 13:04:58 +0000 (14:04 +0100)]
Fix buffer overrun: if LABEL_STARTER is seen but LABEL_TERMINATOR is not, the
label parser will keep going forever looking for the end of the label. It now
stops at the end of the string.

7 years agoAdd a rather bodged test framework for the qemuppc plat, which only runs if the
David Given [Sun, 13 Nov 2016 12:37:22 +0000 (13:37 +0100)]
Add a rather bodged test framework for the qemuppc plat, which only runs if the
qemu-system-ppc emulator is installed.

7 years agoFix (or at least, work around) an issue with library order. Make sure the Basic
David Given [Sun, 13 Nov 2016 12:28:09 +0000 (13:28 +0100)]
Fix (or at least, work around) an issue with library order. Make sure the Basic
error symbols are actually defined.

7 years agoAdd just enough Open Firmware support for an output console.
David Given [Sat, 12 Nov 2016 21:09:54 +0000 (22:09 +0100)]
Add just enough Open Firmware support for an output console.

7 years agoAdd the very experimental qemuppc plat, intended to generate minimal images
David Given [Sat, 12 Nov 2016 18:20:58 +0000 (19:20 +0100)]
Add the very experimental qemuppc plat, intended to generate minimal images
which can be emulated using qemu (for, hopefully, a test suite). Currently it
generates images which won't run because there's no RAM.

7 years agoUpdate the table to return call output values in the right registers. Fix the
David Given [Fri, 11 Nov 2016 20:48:36 +0000 (21:48 +0100)]
Update the table to return call output values in the right registers. Fix the
register allocator so the corrupted registers only apply to throughs
(otherwise, you can't put output registers in corrupted registers).

7 years agoRework the way stack frames are laid out to be simpler and, hopefully, more
David Given [Fri, 11 Nov 2016 20:17:45 +0000 (21:17 +0100)]
Rework the way stack frames are laid out to be simpler and, hopefully, more
correct. Saved registers are now placed in what may be the right place.

7 years agoMerge from default.
David Given [Fri, 11 Nov 2016 19:17:54 +0000 (20:17 +0100)]
Merge from default.

7 years agoRename addr_t to address_t to avoid clashes with the system addr_t.
David Given [Fri, 11 Nov 2016 19:17:10 +0000 (20:17 +0100)]
Rename addr_t to address_t to avoid clashes with the system addr_t.

7 years agoDisable gethostid() in the build system Lua; it's unused and doesn't work on
David Given [Fri, 11 Nov 2016 19:16:43 +0000 (20:16 +0100)]
Disable gethostid() in the build system Lua; it's unused and doesn't work on
Haiku.

7 years agoMerge.
David Given [Thu, 10 Nov 2016 21:06:08 +0000 (22:06 +0100)]
Merge.

7 years agoAdd enough return types to the K&R C that the ACK builds (on Linux) using clang
David Given [Thu, 10 Nov 2016 21:04:18 +0000 (22:04 +0100)]
Add enough return types to the K&R C that the ACK builds (on Linux) using clang
now.

7 years agoRemove sys_time in favour of directly calling time().
David Given [Wed, 9 Nov 2016 20:52:04 +0000 (21:52 +0100)]
Remove sys_time in favour of directly calling time().

7 years agoMerge pull request #9 from kernigh/fix-flt-trek
David Given [Mon, 7 Nov 2016 19:15:48 +0000 (20:15 +0100)]
Merge pull request #9 from kernigh/fix-flt-trek

fixes for floating point and startrek

7 years agoEdit startrek.c so I can compile it with gcc and OpenBSD libc.
George Koehler [Mon, 7 Nov 2016 01:21:48 +0000 (20:21 -0500)]
Edit startrek.c so I can compile it with gcc and OpenBSD libc.

Rename our getline() to get_line() to prevent a conflict with POSIX
getline() declared in stdio.h.

Remove dangerous call to gets().  OpenBSD does not have gets(), C99
deprecated it and C11 removed it.

Also change spelling "sheild" to "shield".

7 years agoConvert 1 to 1.0, not 0.0, for machines with 64-bit long.
George Koehler [Mon, 7 Nov 2016 00:34:51 +0000 (19:34 -0500)]
Convert 1 to 1.0, not 0.0, for machines with 64-bit long.

This fixes flt_arith2flt() when sizeof(arith) != 4, where arith is
long.  When cemcom.ansi sees an expression like d + 1 (where d is some
double), it calls flt_arith2flt() to convert 1 to floating-point.  On
machines where sizeof(arith) != 4, the code did n >>= 1 when n should
not have been changed.  If n was 1, then n == 0 became true.  This
caused the code to convert 1 or -1 to 0.0.

My fix assumes sizeof(arith) >= 8, so I can use n >> 32.  Machines
with sizeof(arith) of 5 to 7 would need to do (uarith)n >> 32, where
uarith must be an unsigned integer type of same size as arith.

In startrek.c, the Enterprise can now dock with a starbase.  The
compiler no longer translates s1 - 1 to s1 - 0.0 and s1 + 1 to s1 +
0.0, so the game now looks for starbases next to the Enterprise.

7 years agoRemove unused defines from lang/cem/libcc.ansi/math/localmath.h
George Koehler [Sun, 6 Nov 2016 20:49:47 +0000 (15:49 -0500)]
Remove unused defines from lang/cem/libcc.ansi/math/localmath.h

This undoes part of bfeb736, and returns to using DBL_MAX_EXP and
DBL_MIN_EXP from float.h.

Add a dependency on math/localmath.h and other local header files so
libc is rebuilt when those headers change.

7 years agoUndo commit bfeb736 for lang/cem/libcc.ansi/headers/float.h
George Koehler [Sun, 6 Nov 2016 20:01:25 +0000 (15:01 -0500)]
Undo commit bfeb736 for lang/cem/libcc.ansi/headers/float.h

This restores the correct values of DBL_MAX, DBL_MIN_EXP, and related
constants.  This fixes some range checks within libc, causing
atof("-36e90") and atof("1.44e-288") to return the correct values.

7 years agoSimplify flt_arith now that mantissa uses uint32_t.
George Koehler [Sun, 6 Nov 2016 01:29:03 +0000 (21:29 -0400)]
Simplify flt_arith now that mantissa uses uint32_t.

It seems that someone wanted to build flt_arith with a compiler that
had long but not unsigned long.  This required extra code to
accomplish unsigned right shift, unsigned division, and unsigned
comparison using the signed operations.  Now that we use uint32_t, we
can simply use the unsigned operations and remove the ucmp() function.
We have similar code in mach/proto/fp/ and in
lang/cem/libcc.ansi/stdlib/ext_comp.c where we use the unsigned
operations.

Some long variables become uint32_t, and some masks with 0xFFFFFFFF
disappear because uint32_t has only 32 bits.

Update flt_arith.3 to show that mantissa uses uint32_t.

Provide a target to install modules/src/flt_arith/test.c as flt_test
so I can run the tests.

7 years agoSwitch flt_mantissa fields from long to uint32_t.
George Koehler [Sat, 5 Nov 2016 21:00:24 +0000 (17:00 -0400)]
Switch flt_mantissa fields from long to uint32_t.

This seems to fix an error when flt_arith converts a literal
double-precision float to IEEE format.  For example, 0.5 and 0.75 got
converted to slightly below their correct values.

My host gcc for amd64 has 64-bit long, but flt_arith needs only 32
bits.  The code (at least flt_add.c) can make 32-bit overflows.  Such
overflows would set the higher bits of a 64-bit long, which might
cause problems later.

I need to use uint32_t and not int32_t because the code still uses
long, and the sign extension from int32_t to long would cause
problems.  The mantissa represents a value in [0, 2) that can't be
negative, so unsigned type is better.  Also, signed overflow is
undefined behavior in C, so flt_add.c better make overflows with
uint32_t and not int32_t.

This commit doesn't touch lang/cem/libcc.ansi/stdlib/ext_fmt.h which
continues to use unsigned long for its mantissa fields.

7 years agoAssume ANSI C in modules/src/flt_arith
George Koehler [Sat, 5 Nov 2016 20:24:18 +0000 (16:24 -0400)]
Assume ANSI C in modules/src/flt_arith

Remove the #include "ansi.h" and always use the prototypes.

7 years agoEnsure the modules properly depend on their headers.
David Given [Sat, 5 Nov 2016 10:52:54 +0000 (11:52 +0100)]
Ensure the modules properly depend on their headers.

7 years agoMerge from default.
David Given [Sat, 5 Nov 2016 10:47:53 +0000 (11:47 +0100)]
Merge from default.

7 years agoProperly declare the library headers as dependencies.
David Given [Sat, 5 Nov 2016 10:47:36 +0000 (11:47 +0100)]
Properly declare the library headers as dependencies.

7 years agoCorrectly mangle labels used in initialisers.
David Given [Mon, 31 Oct 2016 22:21:33 +0000 (23:21 +0100)]
Correctly mangle labels used in initialisers.

7 years agoTypo fix.
David Given [Mon, 31 Oct 2016 22:16:02 +0000 (23:16 +0100)]
Typo fix.

7 years agoAdd, I hope, patterns for fmsub, fnmadd, and fnmsub (also float versions).
David Given [Mon, 31 Oct 2016 21:36:54 +0000 (22:36 +0100)]
Add, I hope, patterns for fmsub, fnmadd, and fnmsub (also float versions).

7 years agoAlso use fmadd for single-precision floats.
David Given [Mon, 31 Oct 2016 18:55:16 +0000 (19:55 +0100)]
Also use fmadd for single-precision floats.

7 years agoUse fmadd for multiply-and-add instructions.
David Given [Mon, 31 Oct 2016 18:52:17 +0000 (19:52 +0100)]
Use fmadd for multiply-and-add instructions.

7 years agoFix a few c11isms.
David Given [Sun, 30 Oct 2016 15:51:06 +0000 (16:51 +0100)]
Fix a few c11isms.

7 years agoMerge from default.
David Given [Sun, 30 Oct 2016 14:59:44 +0000 (15:59 +0100)]
Merge from default.

7 years agoMerge pull request #7 from davidgiven/travis
David Given [Sun, 30 Oct 2016 14:59:04 +0000 (15:59 +0100)]
Merge pull request #7 from davidgiven/travis

Use built-in Lua rather than relying on a system one

7 years agoMerge from default. travis
David Given [Sun, 30 Oct 2016 14:53:26 +0000 (15:53 +0100)]
Merge from default.

7 years agoDon't allow parallel builds in the top-level makefile.
David Given [Sun, 30 Oct 2016 14:49:39 +0000 (15:49 +0100)]
Don't allow parallel builds in the top-level makefile.

7 years agoOld versions of make don't support -r.
David Given [Sun, 30 Oct 2016 13:28:08 +0000 (14:28 +0100)]
Old versions of make don't support -r.

7 years agoProperly export symbols.
David Given [Sat, 29 Oct 2016 21:52:17 +0000 (23:52 +0200)]
Properly export symbols.

7 years agoGet top working with the PowerPC; use it to eliminate useless branches and
David Given [Sat, 29 Oct 2016 21:37:11 +0000 (23:37 +0200)]
Get top working with the PowerPC; use it to eliminate useless branches and
moves.

7 years agoMerge from default (merging in George Koehler's PowerPC changes).
David Given [Sat, 29 Oct 2016 20:40:40 +0000 (22:40 +0200)]
Merge from default (merging in George Koehler's PowerPC changes).

7 years agoAdd support for preserved registers.
David Given [Sat, 29 Oct 2016 18:22:44 +0000 (20:22 +0200)]
Add support for preserved registers.

7 years agoMore opcodes.
David Given [Sat, 29 Oct 2016 11:32:09 +0000 (13:32 +0200)]
More opcodes.

7 years agoMore opcodes.
David Given [Sat, 29 Oct 2016 10:55:34 +0000 (12:55 +0200)]
More opcodes.

7 years agoEmit negative constants correctly.
David Given [Sat, 29 Oct 2016 10:55:21 +0000 (12:55 +0200)]
Emit negative constants correctly.

7 years agoMore opcodes. sti can now cope with non-standard sizes (really need a better
David Given [Sat, 29 Oct 2016 10:48:05 +0000 (12:48 +0200)]
More opcodes. sti can now cope with non-standard sizes (really need a better
fix for this). Hack in crude support for mismatched stack pushes and pops (ints
vs longs).

7 years agoActually, the locals need to go above the spills and saved regs, so fp == lb.
David Given [Sat, 29 Oct 2016 10:00:33 +0000 (12:00 +0200)]
Actually, the locals need to go above the spills and saved regs, so fp == lb.

7 years agoLots more opcodes. Rearrange the stack layout so that fp->ab is a fixed value
David Given [Sat, 29 Oct 2016 09:57:56 +0000 (11:57 +0200)]
Lots more opcodes. Rearrange the stack layout so that fp->ab is a fixed value
(needed for CHAINFP and FPTOAB). Wire up lfrs to calls via a phi when
necessary, to allow call-bra-lfr chains.

7 years agoDon't generate phis if unnecessary (because this breaks the
David Given [Sat, 29 Oct 2016 08:55:48 +0000 (10:55 +0200)]
Don't generate phis if unnecessary (because this breaks the
critical-edge-splitting guarantee and causes insertion of phi copies to fail).

7 years agoMangle label names (turns out that the ACK assembler can't really cope with
David Given [Thu, 27 Oct 2016 21:17:16 +0000 (23:17 +0200)]
Mangle label names (turns out that the ACK assembler can't really cope with
labels that are the same name as instructions...).

7 years agoSwaps work (at least for registers). More opcodes. Rearrange the stack layout
David Given [Thu, 27 Oct 2016 19:50:58 +0000 (21:50 +0200)]
Swaps work (at least for registers). More opcodes. Rearrange the stack layout
so we can always trivially find fp, which lets CHAINFP work.

7 years agoAllow emission of strings containing ".
David Given [Thu, 27 Oct 2016 19:48:46 +0000 (21:48 +0200)]
Allow emission of strings containing ".

7 years agoFix bug where some phis weren't being inserted when a given variable definition
David Given [Thu, 27 Oct 2016 19:40:25 +0000 (21:40 +0200)]
Fix bug where some phis weren't being inserted when a given variable definition
needed more than one phi (due to the dominance frontier containing more than
one basic block).

7 years agoRemove the bytes1, bytes2, bytes4, bytes8 attributes; remove the concept of a
David Given [Tue, 25 Oct 2016 21:04:20 +0000 (23:04 +0200)]
Remove the bytes1, bytes2, bytes4, bytes8 attributes; remove the concept of a
register 'type'; now use int/float/long/double throughout to identify
registers. Lots of register allocator tweaks and table bugfixes --- we now get
through the dreading Mathlib.mod!

7 years agoPhi copies are now inserted as part of type inference. More opcodes.
David Given [Mon, 24 Oct 2016 20:14:08 +0000 (22:14 +0200)]
Phi copies are now inserted as part of type inference. More opcodes.

7 years agoMore opcodes.
David Given [Mon, 24 Oct 2016 18:15:22 +0000 (20:15 +0200)]
More opcodes.

7 years agoMore opcodes.
David Given [Mon, 24 Oct 2016 10:08:40 +0000 (12:08 +0200)]
More opcodes.

7 years agoMore opcodes, including the difficult and fairly stupid los/sts.
David Given [Sun, 23 Oct 2016 20:24:08 +0000 (22:24 +0200)]
More opcodes, including the difficult and fairly stupid los/sts.

7 years agoMassive change to how IR types are handled; we use the type code for matching
David Given [Sun, 23 Oct 2016 19:54:14 +0000 (21:54 +0200)]
Massive change to how IR types are handled; we use the type code for matching
rather than the size. Much cleaner and simpler.

7 years agoRe-re-add the type inference layer, now I know more about how things work.
David Given [Sat, 22 Oct 2016 21:04:13 +0000 (23:04 +0200)]
Re-re-add the type inference layer, now I know more about how things work.
Remove that terrible float promotion code.

7 years agoMore opcodes.
David Given [Sat, 22 Oct 2016 18:32:51 +0000 (20:32 +0200)]
More opcodes.

7 years agoRemove GETRET; values are now returned directly by CALL. Fix a bug in
David Given [Sat, 22 Oct 2016 10:13:57 +0000 (12:13 +0200)]
Remove GETRET; values are now returned directly by CALL. Fix a bug in
convertstackops which was resulting in duplicate IR groups.

7 years agoMore opcodes.
David Given [Sat, 22 Oct 2016 09:26:28 +0000 (11:26 +0200)]
More opcodes.

7 years agoHacky workaround the way the Modula-2 compiler generates non-standard sized
David Given [Sat, 22 Oct 2016 08:48:22 +0000 (10:48 +0200)]
Hacky workaround the way the Modula-2 compiler generates non-standard sized
loads and saves. More opcodes; simplified table using macros.

7 years agoTypo fix.
David Given [Fri, 21 Oct 2016 22:48:55 +0000 (00:48 +0200)]
Typo fix.

7 years agoBetter (and more correct) floating point conversions; fif; various new opcodes.
David Given [Fri, 21 Oct 2016 22:48:26 +0000 (00:48 +0200)]
Better (and more correct) floating point conversions; fif; various new opcodes.

7 years agofef4 and fef8 is now cleaner, albeit slower; add some more register alias
David Given [Fri, 21 Oct 2016 22:02:15 +0000 (00:02 +0200)]
fef4 and fef8 is now cleaner, albeit slower; add some more register alias
stuff.

7 years agoAdd (pretty crummy) support for register aliases and static pairs of registers.
David Given [Fri, 21 Oct 2016 21:31:00 +0000 (23:31 +0200)]
Add (pretty crummy) support for register aliases and static pairs of registers.
We should have enough functionality now for rather buggy 8-bit ints and
doubles. Rework the table and the platform.c to match.

7 years agoAdd parsing support for register aliases.
David Given [Thu, 20 Oct 2016 19:47:28 +0000 (21:47 +0200)]
Add parsing support for register aliases.

7 years agoLots more opcodes; better eviction behaviour; better register moves. Lots more
David Given [Wed, 19 Oct 2016 21:29:05 +0000 (23:29 +0200)]
Lots more opcodes; better eviction behaviour; better register moves. Lots more
PowerPC stuff (some working).

7 years agoFloating point promotion is less buggy.
David Given [Wed, 19 Oct 2016 21:27:53 +0000 (23:27 +0200)]
Floating point promotion is less buggy.

7 years agoMerge pull request #6 from kernigh/pr-linuxppc
David Given [Wed, 19 Oct 2016 18:39:10 +0000 (20:39 +0200)]
Merge pull request #6 from kernigh/pr-linuxppc

PowerPC fixes

7 years agoRemove f14 to f31 from FREG and FSREG.
George Koehler [Wed, 19 Oct 2016 01:16:47 +0000 (21:16 -0400)]
Remove f14 to f31 from FREG and FSREG.

This would have happened later, if f14 to f31 became regvar (like r13
to r31 are now).  I am doing it now because ncg is too slow for rules
"with FREG FREG uses FREG".  We use such rules for adf 8 and other EM
instructions that operate on 2 floats.  Like my last commit cfbc537,
this commit speeds ncg by removing choices for register allocation.

7 years agoPromote values accessed via NOP.
David Given [Tue, 18 Oct 2016 21:58:03 +0000 (23:58 +0200)]
Promote values accessed via NOP.

7 years ago'!' tracing is now always emitted; tracing goes to stderr.
David Given [Tue, 18 Oct 2016 20:32:09 +0000 (22:32 +0200)]
'!' tracing is now always emitted; tracing goes to stderr.

7 years agoAdd support for floating point constants.
David Given [Tue, 18 Oct 2016 20:29:42 +0000 (22:29 +0200)]
Add support for floating point constants.

7 years agoIn powerpc ncg, add a speed hack for sti 8.
George Koehler [Tue, 18 Oct 2016 00:31:59 +0000 (20:31 -0400)]
In powerpc ncg, add a speed hack for sti 8.

ncg is too slow with this many registers.  A stack pattern "with GPR
GPR GPR" or "with REG REG REG" takes too long to pick registers,
causing ncg 8 to take about 2 seconds on each sti 8.  I introduce
REG_PAIR and there are only 4 such pairs.

For programs that use sti 8 (including C programs that copy 8-byte
structs), this speed hack improves the ncg run from several seconds to
almost instantaneous.

Also add a few COMMENT(...) lines in stacking rules.

7 years agoLots more opcodes.
David Given [Mon, 17 Oct 2016 22:31:26 +0000 (00:31 +0200)]
Lots more opcodes.

7 years agoAdd li and mr pseudoinstructions.
David Given [Mon, 17 Oct 2016 22:21:32 +0000 (00:21 +0200)]
Add li and mr pseudoinstructions.

7 years agoAdd costs to powerpc instructions.
George Koehler [Mon, 17 Oct 2016 18:57:21 +0000 (14:57 -0400)]
Add costs to powerpc instructions.

Also show how andi., andis., or., set condition codes.

7 years agoRewrite .fif8 to avoid powerpc64 fctid
George Koehler [Mon, 17 Oct 2016 04:39:59 +0000 (00:39 -0400)]
Rewrite .fif8 to avoid powerpc64 fctid

This fixes the SIGILL (illegal instruction) in startrek when firing
phasers.  The 32-bit processors in my PowerPC Mac and in QEMU don't
have fctid, a 64-bit instruction.

I got the idea from mach/proto/fp/fif8.c to extract the exponent,
clear some bits to get an integer, then subtract the integer from
the original value to get the fraction.

7 years agoAdd "kills MEMORY" to powerpc sti rules.
George Koehler [Sun, 16 Oct 2016 22:13:39 +0000 (18:13 -0400)]
Add "kills MEMORY" to powerpc sti rules.

Adjust some of the loi rules (and associated moves) so we can identify
the tokens that must be in MEMORY.

With this commit, I can navigate the Enterprise even if I comment out
my work-around from e22c888.

7 years agoBolt mcg into the PowerPC backend. It doesn't build yet, but it is generating
David Given [Sun, 16 Oct 2016 22:06:06 +0000 (00:06 +0200)]
Bolt mcg into the PowerPC backend. It doesn't build yet, but it is generating
*some* code.

7 years agoMerge in the unfinished PowerPC branch.
David Given [Sun, 16 Oct 2016 20:38:27 +0000 (22:38 +0200)]
Merge in the unfinished PowerPC branch.

7 years agoImplement saving of dirty registers onto the stack.
David Given [Sun, 16 Oct 2016 20:37:42 +0000 (22:37 +0200)]
Implement saving of dirty registers onto the stack.

7 years agoRemove IND_LABEL_W and IND_LABEL_D
George Koehler [Sun, 16 Oct 2016 20:33:24 +0000 (16:33 -0400)]
Remove IND_LABEL_W and IND_LABEL_D

Because li32 always loads a label into a GPR, it is sufficient to
coerce LABEL to REG, then use IND_RC_W or IND_RC_D for indirection
through the label.

7 years agoSimplify moves to and from IND_RC_*
George Koehler [Sun, 16 Oct 2016 20:02:25 +0000 (16:02 -0400)]
Simplify moves to and from IND_RC_*

Now that SUM_RC always has a signed 16-bit constant, it happens that
the various IND_RC_* tokens also have a signed 16-bit constant, so
we no longer need to touch the scratch register.

7 years agoDon't need Lua any more.
David Given [Sun, 16 Oct 2016 18:10:24 +0000 (20:10 +0200)]
Don't need Lua any more.

7 years agoRemember to create the build directory when bootstrapping.
David Given [Sun, 16 Oct 2016 18:09:52 +0000 (20:09 +0200)]
Remember to create the build directory when bootstrapping.

7 years agoUse a self-hosted Lua instead of the system one.
David Given [Sun, 16 Oct 2016 18:07:54 +0000 (20:07 +0200)]
Use a self-hosted Lua instead of the system one.

7 years agoRefactor how powerpc ncg pushes constants.
George Koehler [Sun, 16 Oct 2016 17:58:54 +0000 (13:58 -0400)]
Refactor how powerpc ncg pushes constants.

When loc (load constant) pushes a constant, it now checks the value of
the constant and pushes any of 7 tokens.  These tokens allow stack
patterns to recognize 16-bit signed integers (CONST2), 16-bit unsigned
integers (UCONST2), multiples of 0x10000 (CONST_HZ), and other
interesting forms of constants.

Use the new constant tokens in the rules for adi, sbi, and, ior, xor.
Adjust a few other rules to understand the new tokens.

Require that SUM_RC has a signed 16-bit constant, and OR_RC and XOR_RC
each have an unsigned 16-bit constant.  The moves from SUM_RC, OR_RC,
XOR_RC to GPR no longer touch the scratch register, because the
constant is not too big.

7 years agoExperiments with declarative apt and OSX.
David Given [Sun, 16 Oct 2016 16:16:30 +0000 (18:16 +0200)]
Experiments with declarative apt and OSX.

7 years agoAdd missing header that was causing builds to fail on Travis.
David Given [Sun, 16 Oct 2016 15:58:01 +0000 (17:58 +0200)]
Add missing header that was causing builds to fail on Travis.

7 years agoRemove unused parts of mach/powerpc/ncg/table
George Koehler [Sun, 16 Oct 2016 00:00:48 +0000 (20:00 -0400)]
Remove unused parts of mach/powerpc/ncg/table

Remove unused tokens GPRINDIRECTLO, HILABEL, LOLABEL, LABELI.  Also
remove an #if 0 ... #endif group of patterns.

7 years agoMerge from trunk.
David Given [Sat, 15 Oct 2016 22:06:14 +0000 (00:06 +0200)]
Merge from trunk.

7 years agoVarious bits of cleanup; we should almost be ready to try sending this to the
David Given [Sat, 15 Oct 2016 21:39:38 +0000 (23:39 +0200)]
Various bits of cleanup; we should almost be ready to try sending this to the
assembler soon...

7 years agoOops, forgot to add the output option spec to the string!
David Given [Sat, 15 Oct 2016 21:34:54 +0000 (23:34 +0200)]
Oops, forgot to add the output option spec to the string!

7 years agoReferences to the stack frame are now rendered properly.
David Given [Sat, 15 Oct 2016 21:33:30 +0000 (23:33 +0200)]
References to the stack frame are now rendered properly.

7 years agoStop passing proc around, and use a global instead --- much cleaner.
David Given [Sat, 15 Oct 2016 21:19:44 +0000 (23:19 +0200)]
Stop passing proc around, and use a global instead --- much cleaner.