Enable the Hall check again, and get powerpc to pass it.
authorGeorge Koehler <xkernigh@netscape.net>
Sun, 18 Sep 2016 19:08:55 +0000 (15:08 -0400)
committerGeorge Koehler <xkernigh@netscape.net>
Sun, 18 Sep 2016 19:08:55 +0000 (15:08 -0400)
commit9db305b3385456b9189b845da79c8f390a0ab57c
treede7befa130db3adf537c1469b7b35a6d7831450b
parent9ec2918e146ccb260b5195838fe1f34d56340b3b
Enable the Hall check again, and get powerpc to pass it.

Upon enabling the check, mach/powerpc/ncg/table fails to build as ncgg
gives many errors of "Previous rule impossible on empty stack".  David
Given reported this problem in 2013:
  https://sourceforge.net/p/tack/mailman/message/30814694/

Commit c93cb69 commented out the error in util/ncgg/cgg.y to disable
the Hall check.  This commit enables it again.  In ncgg, the Hall
check is checking that a rule is possible with an empty fake stack.
It would be possible if ncg can coerce the values from the real stack
to the fake stack.  The powerpc table defined coercions from STACK to
{FS, %a} and {FD, %a}, but the Hall check didn't understand the
coercions and rejected each rule "with FS" or "with FD".

This commit removes the FS and FD tokens and adds a new group of FSREG
registers for single-precision floats, while keeping FREG registers
for double precision.  The registers overlap, with each FSREG
containing one FREG, because it is the same register in PowerPC
hardware.  FS tokens become FSREG registers and FD tokens become FREG
registers.  The Hall check understands the coercions from STACK to
FSREG and FREG.  The idea to define separate but overlapping registers
comes from the PDP-11 table (mach/pdp/ncg/table).

This commit also removes F0 from the FREG group.  This is my attempt
to keep F0 off the fake stack, because one of the stacking rules uses
F0 as a scratch register (FSCRATCH).
mach/powerpc/ncg/table
util/ncgg/cgg.y