2 #define NODEPTR_TYPE Node
3 #define OP_LABEL(p) ((p)->op)
4 #define LEFT_CHILD(p) ((p)->kids[0])
5 #define RIGHT_CHILD(p) ((p)->kids[1])
6 #define STATE_LABEL(p) ((p)->x.state)
7 static void address
ARGS((Symbol
, Symbol
, int));
8 static void blkfetch
ARGS((int, int, int, int));
9 static void blkloop
ARGS((int, int, int, int, int, int[]));
10 static void blkstore
ARGS((int, int, int, int));
11 static void defaddress
ARGS((Symbol
));
12 static void defconst
ARGS((int, Value
));
13 static void defstring
ARGS((int, char *));
14 static void defsymbol
ARGS((Symbol
));
15 static void doarg
ARGS((Node
));
16 static void emit2
ARGS((Node
));
17 static void export
ARGS((Symbol
));
18 static void clobber
ARGS((Node
));
19 static void function
ARGS((Symbol
, Symbol
[], Symbol
[], int));
20 static void global
ARGS((Symbol
));
21 static void import
ARGS((Symbol
));
22 static void local
ARGS((Symbol
));
23 static void progbeg
ARGS((int, char **));
24 static void progend
ARGS((void));
25 static void segment
ARGS((int));
26 static void space
ARGS((int));
27 static void target
ARGS((Node
));
28 static int imm
ARGS((Node
));
29 static void rename
ARGS((void));
30 static void defsymbol2
ARGS((Symbol
));
31 static void global2
ARGS((Symbol
));
32 static void segment2
ARGS((int));
34 static Symbol greg
[32];
35 static Symbol
*oreg
= &greg
[8], *ireg
= &greg
[24];
36 static Symbol freg
[32], freg2
[32];
45 generated at Fri Dec 16 10:42:15 1994
46 by $Id: lburg.c,v 2.2 1994/12/08 16:10:01 cwf Exp $
48 static void _kids
ARGS((NODEPTR_TYPE
, int, NODEPTR_TYPE
[]));
49 static void _label
ARGS((NODEPTR_TYPE
));
50 static int _rule
ARGS((void*, int));
68 static char *_ntname
[] = {
94 unsigned int _stk13
:2;
96 unsigned int _con13
:3;
99 unsigned int _addrl
:1;
100 unsigned int _spill
:1;
103 unsigned int _addrg
:1;
104 unsigned int _call
:2;
109 static short _nts_0
[] = { 0 };
110 static short _nts_1
[] = { _reg_NT
, 0 };
111 static short _nts_2
[] = { _stk13_NT
, 0 };
112 static short _nts_3
[] = { _reg_NT
, _con13_NT
, 0 };
113 static short _nts_4
[] = { _con13_NT
, 0 };
114 static short _nts_5
[] = { _base_NT
, 0 };
115 static short _nts_6
[] = { _reg_NT
, _reg_NT
, 0 };
116 static short _nts_7
[] = { _stk_NT
, 0 };
117 static short _nts_8
[] = { _addr_NT
, 0 };
118 static short _nts_9
[] = { _addr_NT
, _reg_NT
, 0 };
119 static short _nts_10
[] = { _addrl_NT
, 0 };
120 static short _nts_11
[] = { _addrl_NT
, _reg_NT
, 0 };
121 static short _nts_12
[] = { _base_NT
, _reg_NT
, 0 };
122 static short _nts_13
[] = { _spill_NT
, _reg_NT
, 0 };
123 static short _nts_14
[] = { _con_NT
, 0 };
124 static short _nts_15
[] = { _reg_NT
, _rc_NT
, 0 };
125 static short _nts_16
[] = { _reg_NT
, _rc5_NT
, 0 };
126 static short _nts_17
[] = { _addrg_NT
, 0 };
127 static short _nts_18
[] = { _call_NT
, 0 };
128 static short _nts_19
[] = { _call_NT
, _reg_NT
, 0 };
129 static short _nts_20
[] = { _rel_NT
, 0 };
131 static short *_nts
[] = {
320 static char _arity
[] = {
939 static char *_opname
[] = {
1558 static char *_templates
[] = {
1560 /* 1 */ "# read register\n", /* reg: INDIRC(VREGP) */
1561 /* 2 */ "# read register\n", /* reg: INDIRD(VREGP) */
1562 /* 3 */ "# read register\n", /* reg: INDIRF(VREGP) */
1563 /* 4 */ "# read register\n", /* reg: INDIRI(VREGP) */
1564 /* 5 */ "# read register\n", /* reg: INDIRP(VREGP) */
1565 /* 6 */ "# read register\n", /* reg: INDIRS(VREGP) */
1566 /* 7 */ "# write register\n", /* stmt: ASGNC(VREGP,reg) */
1567 /* 8 */ "# write register\n", /* stmt: ASGND(VREGP,reg) */
1568 /* 9 */ "# write register\n", /* stmt: ASGNF(VREGP,reg) */
1569 /* 10 */ "# write register\n", /* stmt: ASGNI(VREGP,reg) */
1570 /* 11 */ "# write register\n", /* stmt: ASGNP(VREGP,reg) */
1571 /* 12 */ "# write register\n", /* stmt: ASGNS(VREGP,reg) */
1572 /* 13 */ "%a", /* con: CNSTC */
1573 /* 14 */ "%a", /* con: CNSTI */
1574 /* 15 */ "%a", /* con: CNSTP */
1575 /* 16 */ "%a", /* con: CNSTS */
1576 /* 17 */ "%a", /* con: CNSTU */
1577 /* 18 */ "", /* stmt: reg */
1578 /* 19 */ "%0", /* reg: CVIU(reg) */
1579 /* 20 */ "%0", /* reg: CVPU(reg) */
1580 /* 21 */ "%0", /* reg: CVUI(reg) */
1581 /* 22 */ "%0", /* reg: CVUP(reg) */
1582 /* 23 */ "set %a,%%%c\n", /* reg: ADDRGP */
1583 /* 24 */ "%a", /* stk13: ADDRFP */
1584 /* 25 */ "%a", /* stk13: ADDRLP */
1585 /* 26 */ "add %0,%%fp,%%%c\n", /* reg: stk13 */
1586 /* 27 */ "set %a,%%%c\n", /* stk: ADDRFP */
1587 /* 28 */ "set %a,%%%c\n", /* stk: ADDRLP */
1588 /* 29 */ "set %a,%%%c\nadd %%%c,%%fp,%%%c\n", /* reg: ADDRFP */
1589 /* 30 */ "set %a,%%%c\nadd %%%c,%%fp,%%%c\n", /* reg: ADDRLP */
1590 /* 31 */ "%a", /* con13: CNSTC */
1591 /* 32 */ "%a", /* con13: CNSTI */
1592 /* 33 */ "%a", /* con13: CNSTP */
1593 /* 34 */ "%a", /* con13: CNSTS */
1594 /* 35 */ "%a", /* con13: CNSTU */
1595 /* 36 */ "%%%0+%1", /* base: ADDI(reg,con13) */
1596 /* 37 */ "%%%0+%1", /* base: ADDP(reg,con13) */
1597 /* 38 */ "%%%0+%1", /* base: ADDU(reg,con13) */
1598 /* 39 */ "%%%0", /* base: reg */
1599 /* 40 */ "%0", /* base: con13 */
1600 /* 41 */ "%%fp+%0", /* base: stk13 */
1601 /* 42 */ "%0", /* addr: base */
1602 /* 43 */ "%%%0+%%%1", /* addr: ADDI(reg,reg) */
1603 /* 44 */ "%%%0+%%%1", /* addr: ADDP(reg,reg) */
1604 /* 45 */ "%%%0+%%%1", /* addr: ADDU(reg,reg) */
1605 /* 46 */ "%%fp+%%%0", /* addr: stk */
1606 /* 47 */ "ldsb [%0],%%%c\n", /* reg: INDIRC(addr) */
1607 /* 48 */ "ldsh [%0],%%%c\n", /* reg: INDIRS(addr) */
1608 /* 49 */ "ld [%0],%%%c\n", /* reg: INDIRI(addr) */
1609 /* 50 */ "ld [%0],%%%c\n", /* reg: INDIRP(addr) */
1610 /* 51 */ "ld [%0],%%f%c\n", /* reg: INDIRF(addr) */
1611 /* 52 */ "stb %%%1,[%0]\n", /* stmt: ASGNC(addr,reg) */
1612 /* 53 */ "sth %%%1,[%0]\n", /* stmt: ASGNS(addr,reg) */
1613 /* 54 */ "st %%%1,[%0]\n", /* stmt: ASGNI(addr,reg) */
1614 /* 55 */ "st %%%1,[%0]\n", /* stmt: ASGNP(addr,reg) */
1615 /* 56 */ "st %%f%1,[%0]\n", /* stmt: ASGNF(addr,reg) */
1616 /* 57 */ "%%%fp+%a", /* addrl: ADDRLP */
1617 /* 58 */ "ldd [%0],%%f%c\n", /* reg: INDIRD(addrl) */
1618 /* 59 */ "std %%f%1,[%0]\n", /* stmt: ASGND(addrl,reg) */
1619 /* 60 */ "ld2 [%0],%%f%c\n", /* reg: INDIRD(base) */
1620 /* 61 */ "st2 %%f%1,[%0]\n", /* stmt: ASGND(base,reg) */
1621 /* 62 */ "%a", /* spill: ADDRLP */
1622 /* 63 */ "set %0,%%g1\nstb %%%1,[%%fp+%%g1]\n", /* stmt: ASGNC(spill,reg) */
1623 /* 64 */ "set %0,%%g1\nsth %%%1,[%%fp+%%g1]\n", /* stmt: ASGNS(spill,reg) */
1624 /* 65 */ "set %0,%%g1\nst %%%1,[%%fp+%%g1]\n", /* stmt: ASGNI(spill,reg) */
1625 /* 66 */ "set %0,%%g1\nst %%%1,[%%fp+%%g1]\n", /* stmt: ASGNP(spill,reg) */
1626 /* 67 */ "set %0,%%g1\nst %%f%1,[%%fp+%%g1]\n", /* stmt: ASGNF(spill,reg) */
1627 /* 68 */ "set %0,%%g1\nstd %%f%1,[%%fp+%%g1]\n", /* stmt: ASGND(spill,reg) */
1628 /* 69 */ "ldsb [%0],%%%c\n", /* reg: CVCI(INDIRC(addr)) */
1629 /* 70 */ "ldsh [%0],%%%c\n", /* reg: CVSI(INDIRS(addr)) */
1630 /* 71 */ "ldub [%0],%%%c\n", /* reg: CVCU(INDIRC(addr)) */
1631 /* 72 */ "lduh [%0],%%%c\n", /* reg: CVSU(INDIRS(addr)) */
1632 /* 73 */ "mov %%%0,%%%c\n", /* reg: CVIC(reg) */
1633 /* 74 */ "mov %%%0,%%%c\n", /* reg: CVIS(reg) */
1634 /* 75 */ "mov %%%0,%%%c\n", /* reg: CVIU(reg) */
1635 /* 76 */ "mov %%%0,%%%c\n", /* reg: CVPU(reg) */
1636 /* 77 */ "mov %%%0,%%%c\n", /* reg: CVUC(reg) */
1637 /* 78 */ "mov %%%0,%%%c\n", /* reg: CVUI(reg) */
1638 /* 79 */ "mov %%%0,%%%c\n", /* reg: CVUP(reg) */
1639 /* 80 */ "mov %%%0,%%%c\n", /* reg: CVUS(reg) */
1640 /* 81 */ "%0", /* reg: CVIC(reg) */
1641 /* 82 */ "%0", /* reg: CVIS(reg) */
1642 /* 83 */ "%0", /* reg: CVUC(reg) */
1643 /* 84 */ "%0", /* reg: CVUS(reg) */
1644 /* 85 */ "mov %%%0,%%%c\n", /* reg: LOADC(reg) */
1645 /* 86 */ "mov %%%0,%%%c\n", /* reg: LOADI(reg) */
1646 /* 87 */ "mov %%%0,%%%c\n", /* reg: LOADP(reg) */
1647 /* 88 */ "mov %%%0,%%%c\n", /* reg: LOADS(reg) */
1648 /* 89 */ "mov %%%0,%%%c\n", /* reg: LOADU(reg) */
1649 /* 90 */ "# reg\n", /* reg: CNSTC */
1650 /* 91 */ "# reg\n", /* reg: CNSTI */
1651 /* 92 */ "# reg\n", /* reg: CNSTP */
1652 /* 93 */ "# reg\n", /* reg: CNSTS */
1653 /* 94 */ "# reg\n", /* reg: CNSTU */
1654 /* 95 */ "set %0,%%%c\n", /* reg: con */
1655 /* 96 */ "%0", /* rc: con13 */
1656 /* 97 */ "%%%0", /* rc: reg */
1657 /* 98 */ "add %%%0,%1,%%%c\n", /* reg: ADDI(reg,rc) */
1658 /* 99 */ "add %%%0,%1,%%%c\n", /* reg: ADDP(reg,rc) */
1659 /* 100 */ "add %%%0,%1,%%%c\n", /* reg: ADDU(reg,rc) */
1660 /* 101 */ "and %%%0,%1,%%%c\n", /* reg: BANDU(reg,rc) */
1661 /* 102 */ "or %%%0,%1,%%%c\n", /* reg: BORU(reg,rc) */
1662 /* 103 */ "xor %%%0,%1,%%%c\n", /* reg: BXORU(reg,rc) */
1663 /* 104 */ "sub %%%0,%1,%%%c\n", /* reg: SUBI(reg,rc) */
1664 /* 105 */ "sub %%%0,%1,%%%c\n", /* reg: SUBP(reg,rc) */
1665 /* 106 */ "sub %%%0,%1,%%%c\n", /* reg: SUBU(reg,rc) */
1666 /* 107 */ "%a", /* rc5: CNSTI */
1667 /* 108 */ "%%%0", /* rc5: reg */
1668 /* 109 */ "sll %%%0,%1,%%%c\n", /* reg: LSHI(reg,rc5) */
1669 /* 110 */ "sll %%%0,%1,%%%c\n", /* reg: LSHU(reg,rc5) */
1670 /* 111 */ "sra %%%0,%1,%%%c\n", /* reg: RSHI(reg,rc5) */
1671 /* 112 */ "srl %%%0,%1,%%%c\n", /* reg: RSHU(reg,rc5) */
1672 /* 113 */ "andn %%%0,%1,%%%c\n", /* reg: BANDU(reg,BCOMU(rc)) */
1673 /* 114 */ "orn %%%0,%1,%%%c\n", /* reg: BORU(reg,BCOMU(rc)) */
1674 /* 115 */ "xnor %%%0,%1,%%%c\n", /* reg: BXORU(reg,BCOMU(rc)) */
1675 /* 116 */ "neg %%%0,%%%c\n", /* reg: NEGI(reg) */
1676 /* 117 */ "not %%%0,%%%c\n", /* reg: BCOMU(reg) */
1677 /* 118 */ "sll %%%0,24,%%%c; sra %%%c,24,%%%c\n", /* reg: CVCI(reg) */
1678 /* 119 */ "sll %%%0,16,%%%c; sra %%%c,16,%%%c\n", /* reg: CVSI(reg) */
1679 /* 120 */ "and %%%0,0xff,%%%c\n", /* reg: CVCU(reg) */
1680 /* 121 */ "set 0xffff,%%g1; and %%%0,%%g1,%%%c\n", /* reg: CVSU(reg) */
1681 /* 122 */ "%a", /* addrg: ADDRGP */
1682 /* 123 */ "ba %0; nop\n", /* stmt: JUMPV(addrg) */
1683 /* 124 */ "jmp %0; nop\n", /* stmt: JUMPV(addr) */
1684 /* 125 */ "%a:\n", /* stmt: LABELV */
1685 /* 126 */ "cmp %%%0,%1; be %a; nop\n", /* stmt: EQI(reg,rc) */
1686 /* 127 */ "cmp %%%0,%1; bge %a; nop\n", /* stmt: GEI(reg,rc) */
1687 /* 128 */ "cmp %%%0,%1; bgeu %a; nop\n", /* stmt: GEU(reg,rc) */
1688 /* 129 */ "cmp %%%0,%1; bg %a; nop\n", /* stmt: GTI(reg,rc) */
1689 /* 130 */ "cmp %%%0,%1; bgu %a; nop\n", /* stmt: GTU(reg,rc) */
1690 /* 131 */ "cmp %%%0,%1; ble %a; nop\n", /* stmt: LEI(reg,rc) */
1691 /* 132 */ "cmp %%%0,%1; bleu %a; nop\n", /* stmt: LEU(reg,rc) */
1692 /* 133 */ "cmp %%%0,%1; bl %a; nop\n", /* stmt: LTI(reg,rc) */
1693 /* 134 */ "cmp %%%0,%1; blu %a; nop\n", /* stmt: LTU(reg,rc) */
1694 /* 135 */ "cmp %%%0,%1; bne %a; nop\n", /* stmt: NEI(reg,rc) */
1695 /* 136 */ "%a", /* call: ADDRGP */
1696 /* 137 */ "%0", /* call: addr */
1697 /* 138 */ "call %0; nop\n", /* reg: CALLD(call) */
1698 /* 139 */ "call %0; nop\n", /* reg: CALLF(call) */
1699 /* 140 */ "call %0; nop\n", /* reg: CALLI(call) */
1700 /* 141 */ "call %0; nop\n", /* stmt: CALLV(call) */
1701 /* 142 */ "call %0; st %%%1,[%%sp+64]\n", /* stmt: CALLB(call,reg) */
1702 /* 143 */ "# ret\n", /* stmt: RETD(reg) */
1703 /* 144 */ "# ret\n", /* stmt: RETF(reg) */
1704 /* 145 */ "# ret\n", /* stmt: RETI(reg) */
1705 /* 146 */ "st %%%0,[%%sp+4*%c+68]\n", /* stmt: ARGI(reg) */
1706 /* 147 */ "st %%%0,[%%sp+4*%c+68]\n", /* stmt: ARGP(reg) */
1707 /* 148 */ "# ARGD\n", /* stmt: ARGD(reg) */
1708 /* 149 */ "# ARGF\n", /* stmt: ARGF(reg) */
1709 /* 150 */ "call .div,2; nop\n", /* reg: DIVI(reg,reg) */
1710 /* 151 */ "call .udiv,2; nop\n", /* reg: DIVU(reg,reg) */
1711 /* 152 */ "call .rem,2; nop\n", /* reg: MODI(reg,reg) */
1712 /* 153 */ "call .urem,2; nop\n", /* reg: MODU(reg,reg) */
1713 /* 154 */ "call .mul,2; nop\n", /* reg: MULI(reg,reg) */
1714 /* 155 */ "call .umul,2; nop\n", /* reg: MULU(reg,reg) */
1715 /* 156 */ "faddd %%f%0,%%f%1,%%f%c\n", /* reg: ADDD(reg,reg) */
1716 /* 157 */ "fadds %%f%0,%%f%1,%%f%c\n", /* reg: ADDF(reg,reg) */
1717 /* 158 */ "fdivd %%f%0,%%f%1,%%f%c\n", /* reg: DIVD(reg,reg) */
1718 /* 159 */ "fdivs %%f%0,%%f%1,%%f%c\n", /* reg: DIVF(reg,reg) */
1719 /* 160 */ "fmuld %%f%0,%%f%1,%%f%c\n", /* reg: MULD(reg,reg) */
1720 /* 161 */ "fmuls %%f%0,%%f%1,%%f%c\n", /* reg: MULF(reg,reg) */
1721 /* 162 */ "fsubd %%f%0,%%f%1,%%f%c\n", /* reg: SUBD(reg,reg) */
1722 /* 163 */ "fsubs %%f%0,%%f%1,%%f%c\n", /* reg: SUBF(reg,reg) */
1723 /* 164 */ "fnegs %%f%0,%%f%c\n", /* reg: NEGF(reg) */
1724 /* 165 */ "fmovs %%f%0,%%f%c\n", /* reg: LOADF(reg) */
1725 /* 166 */ "fdtos %%f%0,%%f%c\n", /* reg: CVDF(reg) */
1726 /* 167 */ "fstod %%f%0,%%f%c\n", /* reg: CVFD(reg) */
1727 /* 168 */ "fdtoi %%f%0,%%f0; st %%f0,[%%sp+64]; ld [%%sp+64],%%%c\n", /* reg: CVDI(reg) */
1728 /* 169 */ "st %%%0,[%%sp+64]; ld [%%sp+64],%%f%c; fitod %%f%c,%%f%c\n", /* reg: CVID(reg) */
1729 /* 170 */ "fcmped %%f%0,%%f%1; nop; fbue", /* rel: EQD(reg,reg) */
1730 /* 171 */ "fcmpes %%f%0,%%f%1; nop; fbue", /* rel: EQF(reg,reg) */
1731 /* 172 */ "fcmped %%f%0,%%f%1; nop; fbuge", /* rel: GED(reg,reg) */
1732 /* 173 */ "fcmpes %%f%0,%%f%1; nop; fbuge", /* rel: GEF(reg,reg) */
1733 /* 174 */ "fcmped %%f%0,%%f%1; nop; fbug", /* rel: GTD(reg,reg) */
1734 /* 175 */ "fcmpes %%f%0,%%f%1; nop; fbug", /* rel: GTF(reg,reg) */
1735 /* 176 */ "fcmped %%f%0,%%f%1; nop; fbule", /* rel: LED(reg,reg) */
1736 /* 177 */ "fcmpes %%f%0,%%f%1; nop; fbule", /* rel: LEF(reg,reg) */
1737 /* 178 */ "fcmped %%f%0,%%f%1; nop; fbul", /* rel: LTD(reg,reg) */
1738 /* 179 */ "fcmpes %%f%0,%%f%1; nop; fbul", /* rel: LTF(reg,reg) */
1739 /* 180 */ "fcmped %%f%0,%%f%1; nop; fbne", /* rel: NED(reg,reg) */
1740 /* 181 */ "fcmpes %%f%0,%%f%1; nop; fbne", /* rel: NEF(reg,reg) */
1741 /* 182 */ "%0 %a; nop\n", /* stmt: rel */
1742 /* 183 */ "# LOADD\n", /* reg: LOADD(reg) */
1743 /* 184 */ "# NEGD\n", /* reg: NEGD(reg) */
1744 /* 185 */ "# ASGNB\n", /* stmt: ASGNB(reg,INDIRB(reg)) */
1747 static char _isinstruction
[] = {
1749 /* 1 */ 1, /* # read register\n */
1750 /* 2 */ 1, /* # read register\n */
1751 /* 3 */ 1, /* # read register\n */
1752 /* 4 */ 1, /* # read register\n */
1753 /* 5 */ 1, /* # read register\n */
1754 /* 6 */ 1, /* # read register\n */
1755 /* 7 */ 1, /* # write register\n */
1756 /* 8 */ 1, /* # write register\n */
1757 /* 9 */ 1, /* # write register\n */
1758 /* 10 */ 1, /* # write register\n */
1759 /* 11 */ 1, /* # write register\n */
1760 /* 12 */ 1, /* # write register\n */
1761 /* 13 */ 0, /* %a */
1762 /* 14 */ 0, /* %a */
1763 /* 15 */ 0, /* %a */
1764 /* 16 */ 0, /* %a */
1765 /* 17 */ 0, /* %a */
1767 /* 19 */ 0, /* %0 */
1768 /* 20 */ 0, /* %0 */
1769 /* 21 */ 0, /* %0 */
1770 /* 22 */ 0, /* %0 */
1771 /* 23 */ 1, /* set %a,%%%c\n */
1772 /* 24 */ 0, /* %a */
1773 /* 25 */ 0, /* %a */
1774 /* 26 */ 1, /* add %0,%%fp,%%%c\n */
1775 /* 27 */ 1, /* set %a,%%%c\n */
1776 /* 28 */ 1, /* set %a,%%%c\n */
1777 /* 29 */ 1, /* set %a,%%%c\nadd %%%c,%%fp,%%%c\n */
1778 /* 30 */ 1, /* set %a,%%%c\nadd %%%c,%%fp,%%%c\n */
1779 /* 31 */ 0, /* %a */
1780 /* 32 */ 0, /* %a */
1781 /* 33 */ 0, /* %a */
1782 /* 34 */ 0, /* %a */
1783 /* 35 */ 0, /* %a */
1784 /* 36 */ 0, /* %%%0+%1 */
1785 /* 37 */ 0, /* %%%0+%1 */
1786 /* 38 */ 0, /* %%%0+%1 */
1787 /* 39 */ 0, /* %%%0 */
1788 /* 40 */ 0, /* %0 */
1789 /* 41 */ 0, /* %%fp+%0 */
1790 /* 42 */ 0, /* %0 */
1791 /* 43 */ 0, /* %%%0+%%%1 */
1792 /* 44 */ 0, /* %%%0+%%%1 */
1793 /* 45 */ 0, /* %%%0+%%%1 */
1794 /* 46 */ 0, /* %%fp+%%%0 */
1795 /* 47 */ 1, /* ldsb [%0],%%%c\n */
1796 /* 48 */ 1, /* ldsh [%0],%%%c\n */
1797 /* 49 */ 1, /* ld [%0],%%%c\n */
1798 /* 50 */ 1, /* ld [%0],%%%c\n */
1799 /* 51 */ 1, /* ld [%0],%%f%c\n */
1800 /* 52 */ 1, /* stb %%%1,[%0]\n */
1801 /* 53 */ 1, /* sth %%%1,[%0]\n */
1802 /* 54 */ 1, /* st %%%1,[%0]\n */
1803 /* 55 */ 1, /* st %%%1,[%0]\n */
1804 /* 56 */ 1, /* st %%f%1,[%0]\n */
1805 /* 57 */ 0, /* %%%fp+%a */
1806 /* 58 */ 1, /* ldd [%0],%%f%c\n */
1807 /* 59 */ 1, /* std %%f%1,[%0]\n */
1808 /* 60 */ 1, /* ld2 [%0],%%f%c\n */
1809 /* 61 */ 1, /* st2 %%f%1,[%0]\n */
1810 /* 62 */ 0, /* %a */
1811 /* 63 */ 1, /* set %0,%%g1\nstb %%%1,[%%fp+%%g1]\n */
1812 /* 64 */ 1, /* set %0,%%g1\nsth %%%1,[%%fp+%%g1]\n */
1813 /* 65 */ 1, /* set %0,%%g1\nst %%%1,[%%fp+%%g1]\n */
1814 /* 66 */ 1, /* set %0,%%g1\nst %%%1,[%%fp+%%g1]\n */
1815 /* 67 */ 1, /* set %0,%%g1\nst %%f%1,[%%fp+%%g1]\n */
1816 /* 68 */ 1, /* set %0,%%g1\nstd %%f%1,[%%fp+%%g1]\n */
1817 /* 69 */ 1, /* ldsb [%0],%%%c\n */
1818 /* 70 */ 1, /* ldsh [%0],%%%c\n */
1819 /* 71 */ 1, /* ldub [%0],%%%c\n */
1820 /* 72 */ 1, /* lduh [%0],%%%c\n */
1821 /* 73 */ 1, /* mov %%%0,%%%c\n */
1822 /* 74 */ 1, /* mov %%%0,%%%c\n */
1823 /* 75 */ 1, /* mov %%%0,%%%c\n */
1824 /* 76 */ 1, /* mov %%%0,%%%c\n */
1825 /* 77 */ 1, /* mov %%%0,%%%c\n */
1826 /* 78 */ 1, /* mov %%%0,%%%c\n */
1827 /* 79 */ 1, /* mov %%%0,%%%c\n */
1828 /* 80 */ 1, /* mov %%%0,%%%c\n */
1829 /* 81 */ 0, /* %0 */
1830 /* 82 */ 0, /* %0 */
1831 /* 83 */ 0, /* %0 */
1832 /* 84 */ 0, /* %0 */
1833 /* 85 */ 1, /* mov %%%0,%%%c\n */
1834 /* 86 */ 1, /* mov %%%0,%%%c\n */
1835 /* 87 */ 1, /* mov %%%0,%%%c\n */
1836 /* 88 */ 1, /* mov %%%0,%%%c\n */
1837 /* 89 */ 1, /* mov %%%0,%%%c\n */
1838 /* 90 */ 1, /* # reg\n */
1839 /* 91 */ 1, /* # reg\n */
1840 /* 92 */ 1, /* # reg\n */
1841 /* 93 */ 1, /* # reg\n */
1842 /* 94 */ 1, /* # reg\n */
1843 /* 95 */ 1, /* set %0,%%%c\n */
1844 /* 96 */ 0, /* %0 */
1845 /* 97 */ 0, /* %%%0 */
1846 /* 98 */ 1, /* add %%%0,%1,%%%c\n */
1847 /* 99 */ 1, /* add %%%0,%1,%%%c\n */
1848 /* 100 */ 1, /* add %%%0,%1,%%%c\n */
1849 /* 101 */ 1, /* and %%%0,%1,%%%c\n */
1850 /* 102 */ 1, /* or %%%0,%1,%%%c\n */
1851 /* 103 */ 1, /* xor %%%0,%1,%%%c\n */
1852 /* 104 */ 1, /* sub %%%0,%1,%%%c\n */
1853 /* 105 */ 1, /* sub %%%0,%1,%%%c\n */
1854 /* 106 */ 1, /* sub %%%0,%1,%%%c\n */
1855 /* 107 */ 0, /* %a */
1856 /* 108 */ 0, /* %%%0 */
1857 /* 109 */ 1, /* sll %%%0,%1,%%%c\n */
1858 /* 110 */ 1, /* sll %%%0,%1,%%%c\n */
1859 /* 111 */ 1, /* sra %%%0,%1,%%%c\n */
1860 /* 112 */ 1, /* srl %%%0,%1,%%%c\n */
1861 /* 113 */ 1, /* andn %%%0,%1,%%%c\n */
1862 /* 114 */ 1, /* orn %%%0,%1,%%%c\n */
1863 /* 115 */ 1, /* xnor %%%0,%1,%%%c\n */
1864 /* 116 */ 1, /* neg %%%0,%%%c\n */
1865 /* 117 */ 1, /* not %%%0,%%%c\n */
1866 /* 118 */ 1, /* sll %%%0,24,%%%c; sra %%%c,24,%%%c\n */
1867 /* 119 */ 1, /* sll %%%0,16,%%%c; sra %%%c,16,%%%c\n */
1868 /* 120 */ 1, /* and %%%0,0xff,%%%c\n */
1869 /* 121 */ 1, /* set 0xffff,%%g1; and %%%0,%%g1,%%%c\n */
1870 /* 122 */ 0, /* %a */
1871 /* 123 */ 1, /* ba %0; nop\n */
1872 /* 124 */ 1, /* jmp %0; nop\n */
1873 /* 125 */ 1, /* %a:\n */
1874 /* 126 */ 1, /* cmp %%%0,%1; be %a; nop\n */
1875 /* 127 */ 1, /* cmp %%%0,%1; bge %a; nop\n */
1876 /* 128 */ 1, /* cmp %%%0,%1; bgeu %a; nop\n */
1877 /* 129 */ 1, /* cmp %%%0,%1; bg %a; nop\n */
1878 /* 130 */ 1, /* cmp %%%0,%1; bgu %a; nop\n */
1879 /* 131 */ 1, /* cmp %%%0,%1; ble %a; nop\n */
1880 /* 132 */ 1, /* cmp %%%0,%1; bleu %a; nop\n */
1881 /* 133 */ 1, /* cmp %%%0,%1; bl %a; nop\n */
1882 /* 134 */ 1, /* cmp %%%0,%1; blu %a; nop\n */
1883 /* 135 */ 1, /* cmp %%%0,%1; bne %a; nop\n */
1884 /* 136 */ 0, /* %a */
1885 /* 137 */ 0, /* %0 */
1886 /* 138 */ 1, /* call %0; nop\n */
1887 /* 139 */ 1, /* call %0; nop\n */
1888 /* 140 */ 1, /* call %0; nop\n */
1889 /* 141 */ 1, /* call %0; nop\n */
1890 /* 142 */ 1, /* call %0; st %%%1,[%%sp+64]\n */
1891 /* 143 */ 1, /* # ret\n */
1892 /* 144 */ 1, /* # ret\n */
1893 /* 145 */ 1, /* # ret\n */
1894 /* 146 */ 1, /* st %%%0,[%%sp+4*%c+68]\n */
1895 /* 147 */ 1, /* st %%%0,[%%sp+4*%c+68]\n */
1896 /* 148 */ 1, /* # ARGD\n */
1897 /* 149 */ 1, /* # ARGF\n */
1898 /* 150 */ 1, /* call .div,2; nop\n */
1899 /* 151 */ 1, /* call .udiv,2; nop\n */
1900 /* 152 */ 1, /* call .rem,2; nop\n */
1901 /* 153 */ 1, /* call .urem,2; nop\n */
1902 /* 154 */ 1, /* call .mul,2; nop\n */
1903 /* 155 */ 1, /* call .umul,2; nop\n */
1904 /* 156 */ 1, /* faddd %%f%0,%%f%1,%%f%c\n */
1905 /* 157 */ 1, /* fadds %%f%0,%%f%1,%%f%c\n */
1906 /* 158 */ 1, /* fdivd %%f%0,%%f%1,%%f%c\n */
1907 /* 159 */ 1, /* fdivs %%f%0,%%f%1,%%f%c\n */
1908 /* 160 */ 1, /* fmuld %%f%0,%%f%1,%%f%c\n */
1909 /* 161 */ 1, /* fmuls %%f%0,%%f%1,%%f%c\n */
1910 /* 162 */ 1, /* fsubd %%f%0,%%f%1,%%f%c\n */
1911 /* 163 */ 1, /* fsubs %%f%0,%%f%1,%%f%c\n */
1912 /* 164 */ 1, /* fnegs %%f%0,%%f%c\n */
1913 /* 165 */ 1, /* fmovs %%f%0,%%f%c\n */
1914 /* 166 */ 1, /* fdtos %%f%0,%%f%c\n */
1915 /* 167 */ 1, /* fstod %%f%0,%%f%c\n */
1916 /* 168 */ 1, /* fdtoi %%f%0,%%f0; st %%f0,[%%sp+64]; ld [%%sp+64],%%%c\n */
1917 /* 169 */ 1, /* st %%%0,[%%sp+64]; ld [%%sp+64],%%f%c; fitod %%f%c,%%f%c\n */
1918 /* 170 */ 0, /* fcmped %%f%0,%%f%1; nop; fbue */
1919 /* 171 */ 0, /* fcmpes %%f%0,%%f%1; nop; fbue */
1920 /* 172 */ 0, /* fcmped %%f%0,%%f%1; nop; fbuge */
1921 /* 173 */ 0, /* fcmpes %%f%0,%%f%1; nop; fbuge */
1922 /* 174 */ 0, /* fcmped %%f%0,%%f%1; nop; fbug */
1923 /* 175 */ 0, /* fcmpes %%f%0,%%f%1; nop; fbug */
1924 /* 176 */ 0, /* fcmped %%f%0,%%f%1; nop; fbule */
1925 /* 177 */ 0, /* fcmpes %%f%0,%%f%1; nop; fbule */
1926 /* 178 */ 0, /* fcmped %%f%0,%%f%1; nop; fbul */
1927 /* 179 */ 0, /* fcmpes %%f%0,%%f%1; nop; fbul */
1928 /* 180 */ 0, /* fcmped %%f%0,%%f%1; nop; fbne */
1929 /* 181 */ 0, /* fcmpes %%f%0,%%f%1; nop; fbne */
1930 /* 182 */ 1, /* %0 %a; nop\n */
1931 /* 183 */ 1, /* # LOADD\n */
1932 /* 184 */ 1, /* # NEGD\n */
1933 /* 185 */ 1, /* # ASGNB\n */
1936 static char *_string
[] = {
1938 /* 1 */ "reg: INDIRC(VREGP)",
1939 /* 2 */ "reg: INDIRD(VREGP)",
1940 /* 3 */ "reg: INDIRF(VREGP)",
1941 /* 4 */ "reg: INDIRI(VREGP)",
1942 /* 5 */ "reg: INDIRP(VREGP)",
1943 /* 6 */ "reg: INDIRS(VREGP)",
1944 /* 7 */ "stmt: ASGNC(VREGP,reg)",
1945 /* 8 */ "stmt: ASGND(VREGP,reg)",
1946 /* 9 */ "stmt: ASGNF(VREGP,reg)",
1947 /* 10 */ "stmt: ASGNI(VREGP,reg)",
1948 /* 11 */ "stmt: ASGNP(VREGP,reg)",
1949 /* 12 */ "stmt: ASGNS(VREGP,reg)",
1950 /* 13 */ "con: CNSTC",
1951 /* 14 */ "con: CNSTI",
1952 /* 15 */ "con: CNSTP",
1953 /* 16 */ "con: CNSTS",
1954 /* 17 */ "con: CNSTU",
1955 /* 18 */ "stmt: reg",
1956 /* 19 */ "reg: CVIU(reg)",
1957 /* 20 */ "reg: CVPU(reg)",
1958 /* 21 */ "reg: CVUI(reg)",
1959 /* 22 */ "reg: CVUP(reg)",
1960 /* 23 */ "reg: ADDRGP",
1961 /* 24 */ "stk13: ADDRFP",
1962 /* 25 */ "stk13: ADDRLP",
1963 /* 26 */ "reg: stk13",
1964 /* 27 */ "stk: ADDRFP",
1965 /* 28 */ "stk: ADDRLP",
1966 /* 29 */ "reg: ADDRFP",
1967 /* 30 */ "reg: ADDRLP",
1968 /* 31 */ "con13: CNSTC",
1969 /* 32 */ "con13: CNSTI",
1970 /* 33 */ "con13: CNSTP",
1971 /* 34 */ "con13: CNSTS",
1972 /* 35 */ "con13: CNSTU",
1973 /* 36 */ "base: ADDI(reg,con13)",
1974 /* 37 */ "base: ADDP(reg,con13)",
1975 /* 38 */ "base: ADDU(reg,con13)",
1976 /* 39 */ "base: reg",
1977 /* 40 */ "base: con13",
1978 /* 41 */ "base: stk13",
1979 /* 42 */ "addr: base",
1980 /* 43 */ "addr: ADDI(reg,reg)",
1981 /* 44 */ "addr: ADDP(reg,reg)",
1982 /* 45 */ "addr: ADDU(reg,reg)",
1983 /* 46 */ "addr: stk",
1984 /* 47 */ "reg: INDIRC(addr)",
1985 /* 48 */ "reg: INDIRS(addr)",
1986 /* 49 */ "reg: INDIRI(addr)",
1987 /* 50 */ "reg: INDIRP(addr)",
1988 /* 51 */ "reg: INDIRF(addr)",
1989 /* 52 */ "stmt: ASGNC(addr,reg)",
1990 /* 53 */ "stmt: ASGNS(addr,reg)",
1991 /* 54 */ "stmt: ASGNI(addr,reg)",
1992 /* 55 */ "stmt: ASGNP(addr,reg)",
1993 /* 56 */ "stmt: ASGNF(addr,reg)",
1994 /* 57 */ "addrl: ADDRLP",
1995 /* 58 */ "reg: INDIRD(addrl)",
1996 /* 59 */ "stmt: ASGND(addrl,reg)",
1997 /* 60 */ "reg: INDIRD(base)",
1998 /* 61 */ "stmt: ASGND(base,reg)",
1999 /* 62 */ "spill: ADDRLP",
2000 /* 63 */ "stmt: ASGNC(spill,reg)",
2001 /* 64 */ "stmt: ASGNS(spill,reg)",
2002 /* 65 */ "stmt: ASGNI(spill,reg)",
2003 /* 66 */ "stmt: ASGNP(spill,reg)",
2004 /* 67 */ "stmt: ASGNF(spill,reg)",
2005 /* 68 */ "stmt: ASGND(spill,reg)",
2006 /* 69 */ "reg: CVCI(INDIRC(addr))",
2007 /* 70 */ "reg: CVSI(INDIRS(addr))",
2008 /* 71 */ "reg: CVCU(INDIRC(addr))",
2009 /* 72 */ "reg: CVSU(INDIRS(addr))",
2010 /* 73 */ "reg: CVIC(reg)",
2011 /* 74 */ "reg: CVIS(reg)",
2012 /* 75 */ "reg: CVIU(reg)",
2013 /* 76 */ "reg: CVPU(reg)",
2014 /* 77 */ "reg: CVUC(reg)",
2015 /* 78 */ "reg: CVUI(reg)",
2016 /* 79 */ "reg: CVUP(reg)",
2017 /* 80 */ "reg: CVUS(reg)",
2018 /* 81 */ "reg: CVIC(reg)",
2019 /* 82 */ "reg: CVIS(reg)",
2020 /* 83 */ "reg: CVUC(reg)",
2021 /* 84 */ "reg: CVUS(reg)",
2022 /* 85 */ "reg: LOADC(reg)",
2023 /* 86 */ "reg: LOADI(reg)",
2024 /* 87 */ "reg: LOADP(reg)",
2025 /* 88 */ "reg: LOADS(reg)",
2026 /* 89 */ "reg: LOADU(reg)",
2027 /* 90 */ "reg: CNSTC",
2028 /* 91 */ "reg: CNSTI",
2029 /* 92 */ "reg: CNSTP",
2030 /* 93 */ "reg: CNSTS",
2031 /* 94 */ "reg: CNSTU",
2032 /* 95 */ "reg: con",
2033 /* 96 */ "rc: con13",
2035 /* 98 */ "reg: ADDI(reg,rc)",
2036 /* 99 */ "reg: ADDP(reg,rc)",
2037 /* 100 */ "reg: ADDU(reg,rc)",
2038 /* 101 */ "reg: BANDU(reg,rc)",
2039 /* 102 */ "reg: BORU(reg,rc)",
2040 /* 103 */ "reg: BXORU(reg,rc)",
2041 /* 104 */ "reg: SUBI(reg,rc)",
2042 /* 105 */ "reg: SUBP(reg,rc)",
2043 /* 106 */ "reg: SUBU(reg,rc)",
2044 /* 107 */ "rc5: CNSTI",
2045 /* 108 */ "rc5: reg",
2046 /* 109 */ "reg: LSHI(reg,rc5)",
2047 /* 110 */ "reg: LSHU(reg,rc5)",
2048 /* 111 */ "reg: RSHI(reg,rc5)",
2049 /* 112 */ "reg: RSHU(reg,rc5)",
2050 /* 113 */ "reg: BANDU(reg,BCOMU(rc))",
2051 /* 114 */ "reg: BORU(reg,BCOMU(rc))",
2052 /* 115 */ "reg: BXORU(reg,BCOMU(rc))",
2053 /* 116 */ "reg: NEGI(reg)",
2054 /* 117 */ "reg: BCOMU(reg)",
2055 /* 118 */ "reg: CVCI(reg)",
2056 /* 119 */ "reg: CVSI(reg)",
2057 /* 120 */ "reg: CVCU(reg)",
2058 /* 121 */ "reg: CVSU(reg)",
2059 /* 122 */ "addrg: ADDRGP",
2060 /* 123 */ "stmt: JUMPV(addrg)",
2061 /* 124 */ "stmt: JUMPV(addr)",
2062 /* 125 */ "stmt: LABELV",
2063 /* 126 */ "stmt: EQI(reg,rc)",
2064 /* 127 */ "stmt: GEI(reg,rc)",
2065 /* 128 */ "stmt: GEU(reg,rc)",
2066 /* 129 */ "stmt: GTI(reg,rc)",
2067 /* 130 */ "stmt: GTU(reg,rc)",
2068 /* 131 */ "stmt: LEI(reg,rc)",
2069 /* 132 */ "stmt: LEU(reg,rc)",
2070 /* 133 */ "stmt: LTI(reg,rc)",
2071 /* 134 */ "stmt: LTU(reg,rc)",
2072 /* 135 */ "stmt: NEI(reg,rc)",
2073 /* 136 */ "call: ADDRGP",
2074 /* 137 */ "call: addr",
2075 /* 138 */ "reg: CALLD(call)",
2076 /* 139 */ "reg: CALLF(call)",
2077 /* 140 */ "reg: CALLI(call)",
2078 /* 141 */ "stmt: CALLV(call)",
2079 /* 142 */ "stmt: CALLB(call,reg)",
2080 /* 143 */ "stmt: RETD(reg)",
2081 /* 144 */ "stmt: RETF(reg)",
2082 /* 145 */ "stmt: RETI(reg)",
2083 /* 146 */ "stmt: ARGI(reg)",
2084 /* 147 */ "stmt: ARGP(reg)",
2085 /* 148 */ "stmt: ARGD(reg)",
2086 /* 149 */ "stmt: ARGF(reg)",
2087 /* 150 */ "reg: DIVI(reg,reg)",
2088 /* 151 */ "reg: DIVU(reg,reg)",
2089 /* 152 */ "reg: MODI(reg,reg)",
2090 /* 153 */ "reg: MODU(reg,reg)",
2091 /* 154 */ "reg: MULI(reg,reg)",
2092 /* 155 */ "reg: MULU(reg,reg)",
2093 /* 156 */ "reg: ADDD(reg,reg)",
2094 /* 157 */ "reg: ADDF(reg,reg)",
2095 /* 158 */ "reg: DIVD(reg,reg)",
2096 /* 159 */ "reg: DIVF(reg,reg)",
2097 /* 160 */ "reg: MULD(reg,reg)",
2098 /* 161 */ "reg: MULF(reg,reg)",
2099 /* 162 */ "reg: SUBD(reg,reg)",
2100 /* 163 */ "reg: SUBF(reg,reg)",
2101 /* 164 */ "reg: NEGF(reg)",
2102 /* 165 */ "reg: LOADF(reg)",
2103 /* 166 */ "reg: CVDF(reg)",
2104 /* 167 */ "reg: CVFD(reg)",
2105 /* 168 */ "reg: CVDI(reg)",
2106 /* 169 */ "reg: CVID(reg)",
2107 /* 170 */ "rel: EQD(reg,reg)",
2108 /* 171 */ "rel: EQF(reg,reg)",
2109 /* 172 */ "rel: GED(reg,reg)",
2110 /* 173 */ "rel: GEF(reg,reg)",
2111 /* 174 */ "rel: GTD(reg,reg)",
2112 /* 175 */ "rel: GTF(reg,reg)",
2113 /* 176 */ "rel: LED(reg,reg)",
2114 /* 177 */ "rel: LEF(reg,reg)",
2115 /* 178 */ "rel: LTD(reg,reg)",
2116 /* 179 */ "rel: LTF(reg,reg)",
2117 /* 180 */ "rel: NED(reg,reg)",
2118 /* 181 */ "rel: NEF(reg,reg)",
2119 /* 182 */ "stmt: rel",
2120 /* 183 */ "reg: LOADD(reg)",
2121 /* 184 */ "reg: NEGD(reg)",
2122 /* 185 */ "stmt: ASGNB(reg,INDIRB(reg))",
2125 static short _decode_stmt
[] = {
2173 static short _decode_reg
[] = {
2272 static short _decode_con
[] = {
2281 static short _decode_stk13
[] = {
2287 static short _decode_stk
[] = {
2293 static short _decode_con13
[] = {
2302 static short _decode_base
[] = {
2312 static short _decode_addr
[] = {
2321 static short _decode_addrl
[] = {
2326 static short _decode_spill
[] = {
2331 static short _decode_rc
[] = {
2337 static short _decode_rc5
[] = {
2343 static short _decode_addrg
[] = {
2348 static short _decode_call
[] = {
2354 static short _decode_rel
[] = {
2370 static int _rule(state
, goalnt
) void *state
; int goalnt
; {
2371 if (goalnt
< 1 || goalnt
> 15)
2372 fatal("_rule", "Bad goal nonterminal %d\n", goalnt
);
2376 case _stmt_NT
: return _decode_stmt
[((struct _state
*)state
)->rule
._stmt
];
2377 case _reg_NT
: return _decode_reg
[((struct _state
*)state
)->rule
._reg
];
2378 case _con_NT
: return _decode_con
[((struct _state
*)state
)->rule
._con
];
2379 case _stk13_NT
: return _decode_stk13
[((struct _state
*)state
)->rule
._stk13
];
2380 case _stk_NT
: return _decode_stk
[((struct _state
*)state
)->rule
._stk
];
2381 case _con13_NT
: return _decode_con13
[((struct _state
*)state
)->rule
._con13
];
2382 case _base_NT
: return _decode_base
[((struct _state
*)state
)->rule
._base
];
2383 case _addr_NT
: return _decode_addr
[((struct _state
*)state
)->rule
._addr
];
2384 case _addrl_NT
: return _decode_addrl
[((struct _state
*)state
)->rule
._addrl
];
2385 case _spill_NT
: return _decode_spill
[((struct _state
*)state
)->rule
._spill
];
2386 case _rc_NT
: return _decode_rc
[((struct _state
*)state
)->rule
._rc
];
2387 case _rc5_NT
: return _decode_rc5
[((struct _state
*)state
)->rule
._rc5
];
2388 case _addrg_NT
: return _decode_addrg
[((struct _state
*)state
)->rule
._addrg
];
2389 case _call_NT
: return _decode_call
[((struct _state
*)state
)->rule
._call
];
2390 case _rel_NT
: return _decode_rel
[((struct _state
*)state
)->rule
._rel
];
2392 fatal("_rule", "Bad goal nonterminal %d\n", goalnt
);
2397 static void _closure_reg
ARGS((NODEPTR_TYPE
, int));
2398 static void _closure_con
ARGS((NODEPTR_TYPE
, int));
2399 static void _closure_stk13
ARGS((NODEPTR_TYPE
, int));
2400 static void _closure_stk
ARGS((NODEPTR_TYPE
, int));
2401 static void _closure_con13
ARGS((NODEPTR_TYPE
, int));
2402 static void _closure_base
ARGS((NODEPTR_TYPE
, int));
2403 static void _closure_addr
ARGS((NODEPTR_TYPE
, int));
2404 static void _closure_rel
ARGS((NODEPTR_TYPE
, int));
2406 static void _closure_reg(a
, c
) NODEPTR_TYPE a
; int c
; {
2407 struct _state
*p
= STATE_LABEL(a
);
2408 if (c
+ 0 < p
->cost
[_rc5_NT
]) {
2409 p
->cost
[_rc5_NT
] = c
+ 0;
2412 if (c
+ 0 < p
->cost
[_rc_NT
]) {
2413 p
->cost
[_rc_NT
] = c
+ 0;
2416 if (c
+ 0 < p
->cost
[_base_NT
]) {
2417 p
->cost
[_base_NT
] = c
+ 0;
2419 _closure_base(a
, c
+ 0);
2421 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2422 p
->cost
[_stmt_NT
] = c
+ 0;
2427 static void _closure_con(a
, c
) NODEPTR_TYPE a
; int c
; {
2428 struct _state
*p
= STATE_LABEL(a
);
2429 if (c
+ 1 < p
->cost
[_reg_NT
]) {
2430 p
->cost
[_reg_NT
] = c
+ 1;
2432 _closure_reg(a
, c
+ 1);
2436 static void _closure_stk13(a
, c
) NODEPTR_TYPE a
; int c
; {
2437 struct _state
*p
= STATE_LABEL(a
);
2438 if (c
+ 0 < p
->cost
[_base_NT
]) {
2439 p
->cost
[_base_NT
] = c
+ 0;
2441 _closure_base(a
, c
+ 0);
2443 if (c
+ 1 < p
->cost
[_reg_NT
]) {
2444 p
->cost
[_reg_NT
] = c
+ 1;
2446 _closure_reg(a
, c
+ 1);
2450 static void _closure_stk(a
, c
) NODEPTR_TYPE a
; int c
; {
2451 struct _state
*p
= STATE_LABEL(a
);
2452 if (c
+ 0 < p
->cost
[_addr_NT
]) {
2453 p
->cost
[_addr_NT
] = c
+ 0;
2455 _closure_addr(a
, c
+ 0);
2459 static void _closure_con13(a
, c
) NODEPTR_TYPE a
; int c
; {
2460 struct _state
*p
= STATE_LABEL(a
);
2461 if (c
+ 0 < p
->cost
[_rc_NT
]) {
2462 p
->cost
[_rc_NT
] = c
+ 0;
2465 if (c
+ 0 < p
->cost
[_base_NT
]) {
2466 p
->cost
[_base_NT
] = c
+ 0;
2468 _closure_base(a
, c
+ 0);
2472 static void _closure_base(a
, c
) NODEPTR_TYPE a
; int c
; {
2473 struct _state
*p
= STATE_LABEL(a
);
2474 if (c
+ 0 < p
->cost
[_addr_NT
]) {
2475 p
->cost
[_addr_NT
] = c
+ 0;
2477 _closure_addr(a
, c
+ 0);
2481 static void _closure_addr(a
, c
) NODEPTR_TYPE a
; int c
; {
2482 struct _state
*p
= STATE_LABEL(a
);
2483 if (c
+ 0 < p
->cost
[_call_NT
]) {
2484 p
->cost
[_call_NT
] = c
+ 0;
2489 static void _closure_rel(a
, c
) NODEPTR_TYPE a
; int c
; {
2490 struct _state
*p
= STATE_LABEL(a
);
2491 if (c
+ 4 < p
->cost
[_stmt_NT
]) {
2492 p
->cost
[_stmt_NT
] = c
+ 4;
2497 static void _label(a
) NODEPTR_TYPE a
; {
2502 fatal("_label", "Null tree\n", 0);
2503 STATE_LABEL(a
) = p
= allocate(sizeof *p
, FUNC
);
2521 switch (OP_LABEL(a
)) {
2522 case 17: /* CNSTF */
2524 case 18: /* CNSTD */
2526 case 19: /* CNSTC */
2529 if (c
+ 0 < p
->cost
[_con_NT
]) {
2530 p
->cost
[_con_NT
] = c
+ 0;
2532 _closure_con(a
, c
+ 0);
2536 if (c
+ 0 < p
->cost
[_con13_NT
]) {
2537 p
->cost
[_con13_NT
] = c
+ 0;
2539 _closure_con13(a
, c
+ 0);
2543 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2544 p
->cost
[_reg_NT
] = c
+ 0;
2546 _closure_reg(a
, c
+ 0);
2549 case 20: /* CNSTS */
2552 if (c
+ 0 < p
->cost
[_con_NT
]) {
2553 p
->cost
[_con_NT
] = c
+ 0;
2555 _closure_con(a
, c
+ 0);
2559 if (c
+ 0 < p
->cost
[_con13_NT
]) {
2560 p
->cost
[_con13_NT
] = c
+ 0;
2562 _closure_con13(a
, c
+ 0);
2566 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2567 p
->cost
[_reg_NT
] = c
+ 0;
2569 _closure_reg(a
, c
+ 0);
2572 case 21: /* CNSTI */
2575 if (c
+ 0 < p
->cost
[_con_NT
]) {
2576 p
->cost
[_con_NT
] = c
+ 0;
2578 _closure_con(a
, c
+ 0);
2582 if (c
+ 0 < p
->cost
[_con13_NT
]) {
2583 p
->cost
[_con13_NT
] = c
+ 0;
2585 _closure_con13(a
, c
+ 0);
2589 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2590 p
->cost
[_reg_NT
] = c
+ 0;
2592 _closure_reg(a
, c
+ 0);
2595 c
= range(a
, 0, 31);
2596 if (c
+ 0 < p
->cost
[_rc5_NT
]) {
2597 p
->cost
[_rc5_NT
] = c
+ 0;
2601 case 22: /* CNSTU */
2604 if (c
+ 0 < p
->cost
[_con_NT
]) {
2605 p
->cost
[_con_NT
] = c
+ 0;
2607 _closure_con(a
, c
+ 0);
2611 if (c
+ 0 < p
->cost
[_con13_NT
]) {
2612 p
->cost
[_con13_NT
] = c
+ 0;
2614 _closure_con13(a
, c
+ 0);
2618 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2619 p
->cost
[_reg_NT
] = c
+ 0;
2621 _closure_reg(a
, c
+ 0);
2624 case 23: /* CNSTP */
2627 if (c
+ 0 < p
->cost
[_con_NT
]) {
2628 p
->cost
[_con_NT
] = c
+ 0;
2630 _closure_con(a
, c
+ 0);
2634 if (c
+ 0 < p
->cost
[_con13_NT
]) {
2635 p
->cost
[_con13_NT
] = c
+ 0;
2637 _closure_con13(a
, c
+ 0);
2641 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2642 p
->cost
[_reg_NT
] = c
+ 0;
2644 _closure_reg(a
, c
+ 0);
2648 _label(LEFT_CHILD(a
));
2649 /* stmt: ARGF(reg) */
2650 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2651 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2652 p
->cost
[_stmt_NT
] = c
+ 0;
2657 _label(LEFT_CHILD(a
));
2658 /* stmt: ARGD(reg) */
2659 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2660 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2661 p
->cost
[_stmt_NT
] = c
+ 0;
2666 _label(LEFT_CHILD(a
));
2667 /* stmt: ARGI(reg) */
2668 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2669 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2670 p
->cost
[_stmt_NT
] = c
+ 0;
2675 _label(LEFT_CHILD(a
));
2676 /* stmt: ARGP(reg) */
2677 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2678 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2679 p
->cost
[_stmt_NT
] = c
+ 0;
2685 case 49: /* ASGNF */
2686 _label(LEFT_CHILD(a
));
2687 _label(RIGHT_CHILD(a
));
2688 if ( /* stmt: ASGNF(VREGP,reg) */
2689 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2691 c
= ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2692 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2693 p
->cost
[_stmt_NT
] = c
+ 0;
2697 /* stmt: ASGNF(addr,reg) */
2698 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2699 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2700 p
->cost
[_stmt_NT
] = c
+ 0;
2703 /* stmt: ASGNF(spill,reg) */
2704 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_spill_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2705 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2706 p
->cost
[_stmt_NT
] = c
+ 0;
2710 case 50: /* ASGND */
2711 _label(LEFT_CHILD(a
));
2712 _label(RIGHT_CHILD(a
));
2713 if ( /* stmt: ASGND(VREGP,reg) */
2714 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2716 c
= ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2717 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2718 p
->cost
[_stmt_NT
] = c
+ 0;
2722 /* stmt: ASGND(addrl,reg) */
2723 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addrl_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2724 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2725 p
->cost
[_stmt_NT
] = c
+ 0;
2728 /* stmt: ASGND(base,reg) */
2729 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_base_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
2730 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2731 p
->cost
[_stmt_NT
] = c
+ 0;
2734 /* stmt: ASGND(spill,reg) */
2735 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_spill_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2736 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2737 p
->cost
[_stmt_NT
] = c
+ 0;
2741 case 51: /* ASGNC */
2742 _label(LEFT_CHILD(a
));
2743 _label(RIGHT_CHILD(a
));
2744 if ( /* stmt: ASGNC(VREGP,reg) */
2745 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2747 c
= ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2748 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2749 p
->cost
[_stmt_NT
] = c
+ 0;
2753 /* stmt: ASGNC(addr,reg) */
2754 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2755 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2756 p
->cost
[_stmt_NT
] = c
+ 0;
2759 /* stmt: ASGNC(spill,reg) */
2760 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_spill_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2761 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2762 p
->cost
[_stmt_NT
] = c
+ 0;
2766 case 52: /* ASGNS */
2767 _label(LEFT_CHILD(a
));
2768 _label(RIGHT_CHILD(a
));
2769 if ( /* stmt: ASGNS(VREGP,reg) */
2770 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2772 c
= ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2773 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2774 p
->cost
[_stmt_NT
] = c
+ 0;
2778 /* stmt: ASGNS(addr,reg) */
2779 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2780 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2781 p
->cost
[_stmt_NT
] = c
+ 0;
2784 /* stmt: ASGNS(spill,reg) */
2785 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_spill_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2786 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2787 p
->cost
[_stmt_NT
] = c
+ 0;
2791 case 53: /* ASGNI */
2792 _label(LEFT_CHILD(a
));
2793 _label(RIGHT_CHILD(a
));
2794 if ( /* stmt: ASGNI(VREGP,reg) */
2795 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2797 c
= ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2798 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2799 p
->cost
[_stmt_NT
] = c
+ 0;
2803 /* stmt: ASGNI(addr,reg) */
2804 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2805 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2806 p
->cost
[_stmt_NT
] = c
+ 0;
2809 /* stmt: ASGNI(spill,reg) */
2810 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_spill_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2811 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2812 p
->cost
[_stmt_NT
] = c
+ 0;
2816 case 55: /* ASGNP */
2817 _label(LEFT_CHILD(a
));
2818 _label(RIGHT_CHILD(a
));
2819 if ( /* stmt: ASGNP(VREGP,reg) */
2820 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2822 c
= ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2823 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2824 p
->cost
[_stmt_NT
] = c
+ 0;
2828 /* stmt: ASGNP(addr,reg) */
2829 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
2830 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2831 p
->cost
[_stmt_NT
] = c
+ 0;
2834 /* stmt: ASGNP(spill,reg) */
2835 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_spill_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
2836 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2837 p
->cost
[_stmt_NT
] = c
+ 0;
2841 case 57: /* ASGNB */
2842 _label(LEFT_CHILD(a
));
2843 _label(RIGHT_CHILD(a
));
2844 if ( /* stmt: ASGNB(reg,INDIRB(reg)) */
2845 RIGHT_CHILD(a
)->op
== 73 /* INDIRB */
2847 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(LEFT_CHILD(RIGHT_CHILD(a
))->x
.state
))->cost
[_reg_NT
] + 0;
2848 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
2849 p
->cost
[_stmt_NT
] = c
+ 0;
2854 case 65: /* INDIRF */
2855 _label(LEFT_CHILD(a
));
2856 if ( /* reg: INDIRF(VREGP) */
2857 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2860 struct _state
*q
= a
->syms
[RX
]->u
.t
.cse
->x
.state
;
2861 if (q
->cost
[_stmt_NT
] == 0) {
2862 p
->cost
[_stmt_NT
] = 0;
2863 p
->rule
._stmt
= q
->rule
._stmt
;
2865 if (q
->cost
[_reg_NT
] == 0) {
2866 p
->cost
[_reg_NT
] = 0;
2867 p
->rule
._reg
= q
->rule
._reg
;
2869 if (q
->cost
[_con_NT
] == 0) {
2870 p
->cost
[_con_NT
] = 0;
2871 p
->rule
._con
= q
->rule
._con
;
2873 if (q
->cost
[_stk13_NT
] == 0) {
2874 p
->cost
[_stk13_NT
] = 0;
2875 p
->rule
._stk13
= q
->rule
._stk13
;
2877 if (q
->cost
[_stk_NT
] == 0) {
2878 p
->cost
[_stk_NT
] = 0;
2879 p
->rule
._stk
= q
->rule
._stk
;
2881 if (q
->cost
[_con13_NT
] == 0) {
2882 p
->cost
[_con13_NT
] = 0;
2883 p
->rule
._con13
= q
->rule
._con13
;
2885 if (q
->cost
[_base_NT
] == 0) {
2886 p
->cost
[_base_NT
] = 0;
2887 p
->rule
._base
= q
->rule
._base
;
2889 if (q
->cost
[_addr_NT
] == 0) {
2890 p
->cost
[_addr_NT
] = 0;
2891 p
->rule
._addr
= q
->rule
._addr
;
2893 if (q
->cost
[_addrl_NT
] == 0) {
2894 p
->cost
[_addrl_NT
] = 0;
2895 p
->rule
._addrl
= q
->rule
._addrl
;
2897 if (q
->cost
[_spill_NT
] == 0) {
2898 p
->cost
[_spill_NT
] = 0;
2899 p
->rule
._spill
= q
->rule
._spill
;
2901 if (q
->cost
[_rc_NT
] == 0) {
2902 p
->cost
[_rc_NT
] = 0;
2903 p
->rule
._rc
= q
->rule
._rc
;
2905 if (q
->cost
[_rc5_NT
] == 0) {
2906 p
->cost
[_rc5_NT
] = 0;
2907 p
->rule
._rc5
= q
->rule
._rc5
;
2909 if (q
->cost
[_addrg_NT
] == 0) {
2910 p
->cost
[_addrg_NT
] = 0;
2911 p
->rule
._addrg
= q
->rule
._addrg
;
2913 if (q
->cost
[_call_NT
] == 0) {
2914 p
->cost
[_call_NT
] = 0;
2915 p
->rule
._call
= q
->rule
._call
;
2917 if (q
->cost
[_rel_NT
] == 0) {
2918 p
->cost
[_rel_NT
] = 0;
2919 p
->rule
._rel
= q
->rule
._rel
;
2923 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2924 p
->cost
[_reg_NT
] = c
+ 0;
2926 _closure_reg(a
, c
+ 0);
2929 /* reg: INDIRF(addr) */
2930 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + 1;
2931 if (c
+ 0 < p
->cost
[_reg_NT
]) {
2932 p
->cost
[_reg_NT
] = c
+ 0;
2934 _closure_reg(a
, c
+ 0);
2937 case 66: /* INDIRD */
2938 _label(LEFT_CHILD(a
));
2939 if ( /* reg: INDIRD(VREGP) */
2940 LEFT_CHILD(a
)->op
== 615 /* VREGP */
2943 struct _state
*q
= a
->syms
[RX
]->u
.t
.cse
->x
.state
;
2944 if (q
->cost
[_stmt_NT
] == 0) {
2945 p
->cost
[_stmt_NT
] = 0;
2946 p
->rule
._stmt
= q
->rule
._stmt
;
2948 if (q
->cost
[_reg_NT
] == 0) {
2949 p
->cost
[_reg_NT
] = 0;
2950 p
->rule
._reg
= q
->rule
._reg
;
2952 if (q
->cost
[_con_NT
] == 0) {
2953 p
->cost
[_con_NT
] = 0;
2954 p
->rule
._con
= q
->rule
._con
;
2956 if (q
->cost
[_stk13_NT
] == 0) {
2957 p
->cost
[_stk13_NT
] = 0;
2958 p
->rule
._stk13
= q
->rule
._stk13
;
2960 if (q
->cost
[_stk_NT
] == 0) {
2961 p
->cost
[_stk_NT
] = 0;
2962 p
->rule
._stk
= q
->rule
._stk
;
2964 if (q
->cost
[_con13_NT
] == 0) {
2965 p
->cost
[_con13_NT
] = 0;
2966 p
->rule
._con13
= q
->rule
._con13
;
2968 if (q
->cost
[_base_NT
] == 0) {
2969 p
->cost
[_base_NT
] = 0;
2970 p
->rule
._base
= q
->rule
._base
;
2972 if (q
->cost
[_addr_NT
] == 0) {
2973 p
->cost
[_addr_NT
] = 0;
2974 p
->rule
._addr
= q
->rule
._addr
;
2976 if (q
->cost
[_addrl_NT
] == 0) {
2977 p
->cost
[_addrl_NT
] = 0;
2978 p
->rule
._addrl
= q
->rule
._addrl
;
2980 if (q
->cost
[_spill_NT
] == 0) {
2981 p
->cost
[_spill_NT
] = 0;
2982 p
->rule
._spill
= q
->rule
._spill
;
2984 if (q
->cost
[_rc_NT
] == 0) {
2985 p
->cost
[_rc_NT
] = 0;
2986 p
->rule
._rc
= q
->rule
._rc
;
2988 if (q
->cost
[_rc5_NT
] == 0) {
2989 p
->cost
[_rc5_NT
] = 0;
2990 p
->rule
._rc5
= q
->rule
._rc5
;
2992 if (q
->cost
[_addrg_NT
] == 0) {
2993 p
->cost
[_addrg_NT
] = 0;
2994 p
->rule
._addrg
= q
->rule
._addrg
;
2996 if (q
->cost
[_call_NT
] == 0) {
2997 p
->cost
[_call_NT
] = 0;
2998 p
->rule
._call
= q
->rule
._call
;
3000 if (q
->cost
[_rel_NT
] == 0) {
3001 p
->cost
[_rel_NT
] = 0;
3002 p
->rule
._rel
= q
->rule
._rel
;
3006 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3007 p
->cost
[_reg_NT
] = c
+ 0;
3009 _closure_reg(a
, c
+ 0);
3012 /* reg: INDIRD(addrl) */
3013 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addrl_NT
] + 1;
3014 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3015 p
->cost
[_reg_NT
] = c
+ 0;
3017 _closure_reg(a
, c
+ 0);
3019 /* reg: INDIRD(base) */
3020 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_base_NT
] + 2;
3021 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3022 p
->cost
[_reg_NT
] = c
+ 0;
3024 _closure_reg(a
, c
+ 0);
3027 case 67: /* INDIRC */
3028 _label(LEFT_CHILD(a
));
3029 if ( /* reg: INDIRC(VREGP) */
3030 LEFT_CHILD(a
)->op
== 615 /* VREGP */
3033 struct _state
*q
= a
->syms
[RX
]->u
.t
.cse
->x
.state
;
3034 if (q
->cost
[_stmt_NT
] == 0) {
3035 p
->cost
[_stmt_NT
] = 0;
3036 p
->rule
._stmt
= q
->rule
._stmt
;
3038 if (q
->cost
[_reg_NT
] == 0) {
3039 p
->cost
[_reg_NT
] = 0;
3040 p
->rule
._reg
= q
->rule
._reg
;
3042 if (q
->cost
[_con_NT
] == 0) {
3043 p
->cost
[_con_NT
] = 0;
3044 p
->rule
._con
= q
->rule
._con
;
3046 if (q
->cost
[_stk13_NT
] == 0) {
3047 p
->cost
[_stk13_NT
] = 0;
3048 p
->rule
._stk13
= q
->rule
._stk13
;
3050 if (q
->cost
[_stk_NT
] == 0) {
3051 p
->cost
[_stk_NT
] = 0;
3052 p
->rule
._stk
= q
->rule
._stk
;
3054 if (q
->cost
[_con13_NT
] == 0) {
3055 p
->cost
[_con13_NT
] = 0;
3056 p
->rule
._con13
= q
->rule
._con13
;
3058 if (q
->cost
[_base_NT
] == 0) {
3059 p
->cost
[_base_NT
] = 0;
3060 p
->rule
._base
= q
->rule
._base
;
3062 if (q
->cost
[_addr_NT
] == 0) {
3063 p
->cost
[_addr_NT
] = 0;
3064 p
->rule
._addr
= q
->rule
._addr
;
3066 if (q
->cost
[_addrl_NT
] == 0) {
3067 p
->cost
[_addrl_NT
] = 0;
3068 p
->rule
._addrl
= q
->rule
._addrl
;
3070 if (q
->cost
[_spill_NT
] == 0) {
3071 p
->cost
[_spill_NT
] = 0;
3072 p
->rule
._spill
= q
->rule
._spill
;
3074 if (q
->cost
[_rc_NT
] == 0) {
3075 p
->cost
[_rc_NT
] = 0;
3076 p
->rule
._rc
= q
->rule
._rc
;
3078 if (q
->cost
[_rc5_NT
] == 0) {
3079 p
->cost
[_rc5_NT
] = 0;
3080 p
->rule
._rc5
= q
->rule
._rc5
;
3082 if (q
->cost
[_addrg_NT
] == 0) {
3083 p
->cost
[_addrg_NT
] = 0;
3084 p
->rule
._addrg
= q
->rule
._addrg
;
3086 if (q
->cost
[_call_NT
] == 0) {
3087 p
->cost
[_call_NT
] = 0;
3088 p
->rule
._call
= q
->rule
._call
;
3090 if (q
->cost
[_rel_NT
] == 0) {
3091 p
->cost
[_rel_NT
] = 0;
3092 p
->rule
._rel
= q
->rule
._rel
;
3096 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3097 p
->cost
[_reg_NT
] = c
+ 0;
3099 _closure_reg(a
, c
+ 0);
3102 /* reg: INDIRC(addr) */
3103 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + 1;
3104 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3105 p
->cost
[_reg_NT
] = c
+ 0;
3107 _closure_reg(a
, c
+ 0);
3110 case 68: /* INDIRS */
3111 _label(LEFT_CHILD(a
));
3112 if ( /* reg: INDIRS(VREGP) */
3113 LEFT_CHILD(a
)->op
== 615 /* VREGP */
3116 struct _state
*q
= a
->syms
[RX
]->u
.t
.cse
->x
.state
;
3117 if (q
->cost
[_stmt_NT
] == 0) {
3118 p
->cost
[_stmt_NT
] = 0;
3119 p
->rule
._stmt
= q
->rule
._stmt
;
3121 if (q
->cost
[_reg_NT
] == 0) {
3122 p
->cost
[_reg_NT
] = 0;
3123 p
->rule
._reg
= q
->rule
._reg
;
3125 if (q
->cost
[_con_NT
] == 0) {
3126 p
->cost
[_con_NT
] = 0;
3127 p
->rule
._con
= q
->rule
._con
;
3129 if (q
->cost
[_stk13_NT
] == 0) {
3130 p
->cost
[_stk13_NT
] = 0;
3131 p
->rule
._stk13
= q
->rule
._stk13
;
3133 if (q
->cost
[_stk_NT
] == 0) {
3134 p
->cost
[_stk_NT
] = 0;
3135 p
->rule
._stk
= q
->rule
._stk
;
3137 if (q
->cost
[_con13_NT
] == 0) {
3138 p
->cost
[_con13_NT
] = 0;
3139 p
->rule
._con13
= q
->rule
._con13
;
3141 if (q
->cost
[_base_NT
] == 0) {
3142 p
->cost
[_base_NT
] = 0;
3143 p
->rule
._base
= q
->rule
._base
;
3145 if (q
->cost
[_addr_NT
] == 0) {
3146 p
->cost
[_addr_NT
] = 0;
3147 p
->rule
._addr
= q
->rule
._addr
;
3149 if (q
->cost
[_addrl_NT
] == 0) {
3150 p
->cost
[_addrl_NT
] = 0;
3151 p
->rule
._addrl
= q
->rule
._addrl
;
3153 if (q
->cost
[_spill_NT
] == 0) {
3154 p
->cost
[_spill_NT
] = 0;
3155 p
->rule
._spill
= q
->rule
._spill
;
3157 if (q
->cost
[_rc_NT
] == 0) {
3158 p
->cost
[_rc_NT
] = 0;
3159 p
->rule
._rc
= q
->rule
._rc
;
3161 if (q
->cost
[_rc5_NT
] == 0) {
3162 p
->cost
[_rc5_NT
] = 0;
3163 p
->rule
._rc5
= q
->rule
._rc5
;
3165 if (q
->cost
[_addrg_NT
] == 0) {
3166 p
->cost
[_addrg_NT
] = 0;
3167 p
->rule
._addrg
= q
->rule
._addrg
;
3169 if (q
->cost
[_call_NT
] == 0) {
3170 p
->cost
[_call_NT
] = 0;
3171 p
->rule
._call
= q
->rule
._call
;
3173 if (q
->cost
[_rel_NT
] == 0) {
3174 p
->cost
[_rel_NT
] = 0;
3175 p
->rule
._rel
= q
->rule
._rel
;
3179 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3180 p
->cost
[_reg_NT
] = c
+ 0;
3182 _closure_reg(a
, c
+ 0);
3185 /* reg: INDIRS(addr) */
3186 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + 1;
3187 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3188 p
->cost
[_reg_NT
] = c
+ 0;
3190 _closure_reg(a
, c
+ 0);
3193 case 69: /* INDIRI */
3194 _label(LEFT_CHILD(a
));
3195 if ( /* reg: INDIRI(VREGP) */
3196 LEFT_CHILD(a
)->op
== 615 /* VREGP */
3199 struct _state
*q
= a
->syms
[RX
]->u
.t
.cse
->x
.state
;
3200 if (q
->cost
[_stmt_NT
] == 0) {
3201 p
->cost
[_stmt_NT
] = 0;
3202 p
->rule
._stmt
= q
->rule
._stmt
;
3204 if (q
->cost
[_reg_NT
] == 0) {
3205 p
->cost
[_reg_NT
] = 0;
3206 p
->rule
._reg
= q
->rule
._reg
;
3208 if (q
->cost
[_con_NT
] == 0) {
3209 p
->cost
[_con_NT
] = 0;
3210 p
->rule
._con
= q
->rule
._con
;
3212 if (q
->cost
[_stk13_NT
] == 0) {
3213 p
->cost
[_stk13_NT
] = 0;
3214 p
->rule
._stk13
= q
->rule
._stk13
;
3216 if (q
->cost
[_stk_NT
] == 0) {
3217 p
->cost
[_stk_NT
] = 0;
3218 p
->rule
._stk
= q
->rule
._stk
;
3220 if (q
->cost
[_con13_NT
] == 0) {
3221 p
->cost
[_con13_NT
] = 0;
3222 p
->rule
._con13
= q
->rule
._con13
;
3224 if (q
->cost
[_base_NT
] == 0) {
3225 p
->cost
[_base_NT
] = 0;
3226 p
->rule
._base
= q
->rule
._base
;
3228 if (q
->cost
[_addr_NT
] == 0) {
3229 p
->cost
[_addr_NT
] = 0;
3230 p
->rule
._addr
= q
->rule
._addr
;
3232 if (q
->cost
[_addrl_NT
] == 0) {
3233 p
->cost
[_addrl_NT
] = 0;
3234 p
->rule
._addrl
= q
->rule
._addrl
;
3236 if (q
->cost
[_spill_NT
] == 0) {
3237 p
->cost
[_spill_NT
] = 0;
3238 p
->rule
._spill
= q
->rule
._spill
;
3240 if (q
->cost
[_rc_NT
] == 0) {
3241 p
->cost
[_rc_NT
] = 0;
3242 p
->rule
._rc
= q
->rule
._rc
;
3244 if (q
->cost
[_rc5_NT
] == 0) {
3245 p
->cost
[_rc5_NT
] = 0;
3246 p
->rule
._rc5
= q
->rule
._rc5
;
3248 if (q
->cost
[_addrg_NT
] == 0) {
3249 p
->cost
[_addrg_NT
] = 0;
3250 p
->rule
._addrg
= q
->rule
._addrg
;
3252 if (q
->cost
[_call_NT
] == 0) {
3253 p
->cost
[_call_NT
] = 0;
3254 p
->rule
._call
= q
->rule
._call
;
3256 if (q
->cost
[_rel_NT
] == 0) {
3257 p
->cost
[_rel_NT
] = 0;
3258 p
->rule
._rel
= q
->rule
._rel
;
3262 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3263 p
->cost
[_reg_NT
] = c
+ 0;
3265 _closure_reg(a
, c
+ 0);
3268 /* reg: INDIRI(addr) */
3269 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + 1;
3270 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3271 p
->cost
[_reg_NT
] = c
+ 0;
3273 _closure_reg(a
, c
+ 0);
3276 case 71: /* INDIRP */
3277 _label(LEFT_CHILD(a
));
3278 if ( /* reg: INDIRP(VREGP) */
3279 LEFT_CHILD(a
)->op
== 615 /* VREGP */
3282 struct _state
*q
= a
->syms
[RX
]->u
.t
.cse
->x
.state
;
3283 if (q
->cost
[_stmt_NT
] == 0) {
3284 p
->cost
[_stmt_NT
] = 0;
3285 p
->rule
._stmt
= q
->rule
._stmt
;
3287 if (q
->cost
[_reg_NT
] == 0) {
3288 p
->cost
[_reg_NT
] = 0;
3289 p
->rule
._reg
= q
->rule
._reg
;
3291 if (q
->cost
[_con_NT
] == 0) {
3292 p
->cost
[_con_NT
] = 0;
3293 p
->rule
._con
= q
->rule
._con
;
3295 if (q
->cost
[_stk13_NT
] == 0) {
3296 p
->cost
[_stk13_NT
] = 0;
3297 p
->rule
._stk13
= q
->rule
._stk13
;
3299 if (q
->cost
[_stk_NT
] == 0) {
3300 p
->cost
[_stk_NT
] = 0;
3301 p
->rule
._stk
= q
->rule
._stk
;
3303 if (q
->cost
[_con13_NT
] == 0) {
3304 p
->cost
[_con13_NT
] = 0;
3305 p
->rule
._con13
= q
->rule
._con13
;
3307 if (q
->cost
[_base_NT
] == 0) {
3308 p
->cost
[_base_NT
] = 0;
3309 p
->rule
._base
= q
->rule
._base
;
3311 if (q
->cost
[_addr_NT
] == 0) {
3312 p
->cost
[_addr_NT
] = 0;
3313 p
->rule
._addr
= q
->rule
._addr
;
3315 if (q
->cost
[_addrl_NT
] == 0) {
3316 p
->cost
[_addrl_NT
] = 0;
3317 p
->rule
._addrl
= q
->rule
._addrl
;
3319 if (q
->cost
[_spill_NT
] == 0) {
3320 p
->cost
[_spill_NT
] = 0;
3321 p
->rule
._spill
= q
->rule
._spill
;
3323 if (q
->cost
[_rc_NT
] == 0) {
3324 p
->cost
[_rc_NT
] = 0;
3325 p
->rule
._rc
= q
->rule
._rc
;
3327 if (q
->cost
[_rc5_NT
] == 0) {
3328 p
->cost
[_rc5_NT
] = 0;
3329 p
->rule
._rc5
= q
->rule
._rc5
;
3331 if (q
->cost
[_addrg_NT
] == 0) {
3332 p
->cost
[_addrg_NT
] = 0;
3333 p
->rule
._addrg
= q
->rule
._addrg
;
3335 if (q
->cost
[_call_NT
] == 0) {
3336 p
->cost
[_call_NT
] = 0;
3337 p
->rule
._call
= q
->rule
._call
;
3339 if (q
->cost
[_rel_NT
] == 0) {
3340 p
->cost
[_rel_NT
] = 0;
3341 p
->rule
._rel
= q
->rule
._rel
;
3345 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3346 p
->cost
[_reg_NT
] = c
+ 0;
3348 _closure_reg(a
, c
+ 0);
3351 /* reg: INDIRP(addr) */
3352 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + 1;
3353 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3354 p
->cost
[_reg_NT
] = c
+ 0;
3356 _closure_reg(a
, c
+ 0);
3359 case 73: /* INDIRB */
3360 _label(LEFT_CHILD(a
));
3363 _label(LEFT_CHILD(a
));
3364 if ( /* reg: CVCI(INDIRC(addr)) */
3365 LEFT_CHILD(a
)->op
== 67 /* INDIRC */
3367 c
= ((struct _state
*)(LEFT_CHILD(LEFT_CHILD(a
))->x
.state
))->cost
[_addr_NT
] + 1;
3368 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3369 p
->cost
[_reg_NT
] = c
+ 0;
3371 _closure_reg(a
, c
+ 0);
3374 /* reg: CVCI(reg) */
3375 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
3376 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3377 p
->cost
[_reg_NT
] = c
+ 0;
3379 _closure_reg(a
, c
+ 0);
3383 _label(LEFT_CHILD(a
));
3384 if ( /* reg: CVCU(INDIRC(addr)) */
3385 LEFT_CHILD(a
)->op
== 67 /* INDIRC */
3387 c
= ((struct _state
*)(LEFT_CHILD(LEFT_CHILD(a
))->x
.state
))->cost
[_addr_NT
] + 1;
3388 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3389 p
->cost
[_reg_NT
] = c
+ 0;
3391 _closure_reg(a
, c
+ 0);
3394 /* reg: CVCU(reg) */
3395 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3396 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3397 p
->cost
[_reg_NT
] = c
+ 0;
3399 _closure_reg(a
, c
+ 0);
3403 _label(LEFT_CHILD(a
));
3404 /* reg: CVDF(reg) */
3405 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3406 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3407 p
->cost
[_reg_NT
] = c
+ 0;
3409 _closure_reg(a
, c
+ 0);
3412 case 101: /* CVDI */
3413 _label(LEFT_CHILD(a
));
3414 /* reg: CVDI(reg) */
3415 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 3;
3416 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3417 p
->cost
[_reg_NT
] = c
+ 0;
3419 _closure_reg(a
, c
+ 0);
3422 case 114: /* CVFD */
3423 _label(LEFT_CHILD(a
));
3424 /* reg: CVFD(reg) */
3425 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3426 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3427 p
->cost
[_reg_NT
] = c
+ 0;
3429 _closure_reg(a
, c
+ 0);
3432 case 130: /* CVID */
3433 _label(LEFT_CHILD(a
));
3434 /* reg: CVID(reg) */
3435 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 3;
3436 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3437 p
->cost
[_reg_NT
] = c
+ 0;
3439 _closure_reg(a
, c
+ 0);
3442 case 131: /* CVIC */
3443 _label(LEFT_CHILD(a
));
3444 /* reg: CVIC(reg) */
3445 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3446 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3447 p
->cost
[_reg_NT
] = c
+ 0;
3449 _closure_reg(a
, c
+ 0);
3451 /* reg: CVIC(reg) */
3452 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3453 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3454 p
->cost
[_reg_NT
] = c
+ 0;
3456 _closure_reg(a
, c
+ 0);
3459 case 132: /* CVIS */
3460 _label(LEFT_CHILD(a
));
3461 /* reg: CVIS(reg) */
3462 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3463 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3464 p
->cost
[_reg_NT
] = c
+ 0;
3466 _closure_reg(a
, c
+ 0);
3468 /* reg: CVIS(reg) */
3469 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3470 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3471 p
->cost
[_reg_NT
] = c
+ 0;
3473 _closure_reg(a
, c
+ 0);
3476 case 134: /* CVIU */
3477 _label(LEFT_CHILD(a
));
3478 /* reg: CVIU(reg) */
3479 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3480 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3481 p
->cost
[_reg_NT
] = c
+ 0;
3483 _closure_reg(a
, c
+ 0);
3485 /* reg: CVIU(reg) */
3486 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3487 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3488 p
->cost
[_reg_NT
] = c
+ 0;
3490 _closure_reg(a
, c
+ 0);
3493 case 150: /* CVPU */
3494 _label(LEFT_CHILD(a
));
3495 /* reg: CVPU(reg) */
3496 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3497 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3498 p
->cost
[_reg_NT
] = c
+ 0;
3500 _closure_reg(a
, c
+ 0);
3502 /* reg: CVPU(reg) */
3503 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3504 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3505 p
->cost
[_reg_NT
] = c
+ 0;
3507 _closure_reg(a
, c
+ 0);
3510 case 165: /* CVSI */
3511 _label(LEFT_CHILD(a
));
3512 if ( /* reg: CVSI(INDIRS(addr)) */
3513 LEFT_CHILD(a
)->op
== 68 /* INDIRS */
3515 c
= ((struct _state
*)(LEFT_CHILD(LEFT_CHILD(a
))->x
.state
))->cost
[_addr_NT
] + 1;
3516 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3517 p
->cost
[_reg_NT
] = c
+ 0;
3519 _closure_reg(a
, c
+ 0);
3522 /* reg: CVSI(reg) */
3523 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
3524 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3525 p
->cost
[_reg_NT
] = c
+ 0;
3527 _closure_reg(a
, c
+ 0);
3530 case 166: /* CVSU */
3531 _label(LEFT_CHILD(a
));
3532 if ( /* reg: CVSU(INDIRS(addr)) */
3533 LEFT_CHILD(a
)->op
== 68 /* INDIRS */
3535 c
= ((struct _state
*)(LEFT_CHILD(LEFT_CHILD(a
))->x
.state
))->cost
[_addr_NT
] + 1;
3536 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3537 p
->cost
[_reg_NT
] = c
+ 0;
3539 _closure_reg(a
, c
+ 0);
3542 /* reg: CVSU(reg) */
3543 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
3544 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3545 p
->cost
[_reg_NT
] = c
+ 0;
3547 _closure_reg(a
, c
+ 0);
3550 case 179: /* CVUC */
3551 _label(LEFT_CHILD(a
));
3552 /* reg: CVUC(reg) */
3553 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3554 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3555 p
->cost
[_reg_NT
] = c
+ 0;
3557 _closure_reg(a
, c
+ 0);
3559 /* reg: CVUC(reg) */
3560 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3561 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3562 p
->cost
[_reg_NT
] = c
+ 0;
3564 _closure_reg(a
, c
+ 0);
3567 case 180: /* CVUS */
3568 _label(LEFT_CHILD(a
));
3569 /* reg: CVUS(reg) */
3570 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3571 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3572 p
->cost
[_reg_NT
] = c
+ 0;
3574 _closure_reg(a
, c
+ 0);
3576 /* reg: CVUS(reg) */
3577 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3578 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3579 p
->cost
[_reg_NT
] = c
+ 0;
3581 _closure_reg(a
, c
+ 0);
3584 case 181: /* CVUI */
3585 _label(LEFT_CHILD(a
));
3586 /* reg: CVUI(reg) */
3587 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3588 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3589 p
->cost
[_reg_NT
] = c
+ 0;
3591 _closure_reg(a
, c
+ 0);
3593 /* reg: CVUI(reg) */
3594 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3595 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3596 p
->cost
[_reg_NT
] = c
+ 0;
3598 _closure_reg(a
, c
+ 0);
3601 case 183: /* CVUP */
3602 _label(LEFT_CHILD(a
));
3603 /* reg: CVUP(reg) */
3604 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + notarget(a
);
3605 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3606 p
->cost
[_reg_NT
] = c
+ 0;
3608 _closure_reg(a
, c
+ 0);
3610 /* reg: CVUP(reg) */
3611 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3612 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3613 p
->cost
[_reg_NT
] = c
+ 0;
3615 _closure_reg(a
, c
+ 0);
3618 case 193: /* NEGF */
3619 _label(LEFT_CHILD(a
));
3620 /* reg: NEGF(reg) */
3621 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3622 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3623 p
->cost
[_reg_NT
] = c
+ 0;
3625 _closure_reg(a
, c
+ 0);
3628 case 194: /* NEGD */
3629 _label(LEFT_CHILD(a
));
3630 /* reg: NEGD(reg) */
3631 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
3632 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3633 p
->cost
[_reg_NT
] = c
+ 0;
3635 _closure_reg(a
, c
+ 0);
3638 case 197: /* NEGI */
3639 _label(LEFT_CHILD(a
));
3640 /* reg: NEGI(reg) */
3641 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3642 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3643 p
->cost
[_reg_NT
] = c
+ 0;
3645 _closure_reg(a
, c
+ 0);
3648 case 209: /* CALLF */
3649 _label(LEFT_CHILD(a
));
3650 /* reg: CALLF(call) */
3651 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_call_NT
] + 2;
3652 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3653 p
->cost
[_reg_NT
] = c
+ 0;
3655 _closure_reg(a
, c
+ 0);
3658 case 210: /* CALLD */
3659 _label(LEFT_CHILD(a
));
3660 /* reg: CALLD(call) */
3661 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_call_NT
] + 2;
3662 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3663 p
->cost
[_reg_NT
] = c
+ 0;
3665 _closure_reg(a
, c
+ 0);
3668 case 213: /* CALLI */
3669 _label(LEFT_CHILD(a
));
3670 /* reg: CALLI(call) */
3671 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_call_NT
] + 2;
3672 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3673 p
->cost
[_reg_NT
] = c
+ 0;
3675 _closure_reg(a
, c
+ 0);
3678 case 216: /* CALLV */
3679 _label(LEFT_CHILD(a
));
3680 /* stmt: CALLV(call) */
3681 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_call_NT
] + 2;
3682 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
3683 p
->cost
[_stmt_NT
] = c
+ 0;
3687 case 217: /* CALLB */
3688 _label(LEFT_CHILD(a
));
3689 _label(RIGHT_CHILD(a
));
3690 /* stmt: CALLB(call,reg) */
3691 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_call_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
3692 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
3693 p
->cost
[_stmt_NT
] = c
+ 0;
3697 case 225: /* LOADF */
3698 _label(LEFT_CHILD(a
));
3699 /* reg: LOADF(reg) */
3700 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3701 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3702 p
->cost
[_reg_NT
] = c
+ 0;
3704 _closure_reg(a
, c
+ 0);
3707 case 226: /* LOADD */
3708 _label(LEFT_CHILD(a
));
3709 /* reg: LOADD(reg) */
3710 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
3711 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3712 p
->cost
[_reg_NT
] = c
+ 0;
3714 _closure_reg(a
, c
+ 0);
3717 case 227: /* LOADC */
3718 _label(LEFT_CHILD(a
));
3719 /* reg: LOADC(reg) */
3720 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3721 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3722 p
->cost
[_reg_NT
] = c
+ 0;
3724 _closure_reg(a
, c
+ 0);
3727 case 228: /* LOADS */
3728 _label(LEFT_CHILD(a
));
3729 /* reg: LOADS(reg) */
3730 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3731 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3732 p
->cost
[_reg_NT
] = c
+ 0;
3734 _closure_reg(a
, c
+ 0);
3737 case 229: /* LOADI */
3738 _label(LEFT_CHILD(a
));
3739 /* reg: LOADI(reg) */
3740 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3741 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3742 p
->cost
[_reg_NT
] = c
+ 0;
3744 _closure_reg(a
, c
+ 0);
3747 case 230: /* LOADU */
3748 _label(LEFT_CHILD(a
));
3749 /* reg: LOADU(reg) */
3750 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3751 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3752 p
->cost
[_reg_NT
] = c
+ 0;
3754 _closure_reg(a
, c
+ 0);
3757 case 231: /* LOADP */
3758 _label(LEFT_CHILD(a
));
3759 /* reg: LOADP(reg) */
3760 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + move(a
);
3761 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3762 p
->cost
[_reg_NT
] = c
+ 0;
3764 _closure_reg(a
, c
+ 0);
3767 case 233: /* LOADB */
3769 case 241: /* RETF */
3770 _label(LEFT_CHILD(a
));
3771 /* stmt: RETF(reg) */
3772 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3773 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
3774 p
->cost
[_stmt_NT
] = c
+ 0;
3778 case 242: /* RETD */
3779 _label(LEFT_CHILD(a
));
3780 /* stmt: RETD(reg) */
3781 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3782 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
3783 p
->cost
[_stmt_NT
] = c
+ 0;
3787 case 245: /* RETI */
3788 _label(LEFT_CHILD(a
));
3789 /* stmt: RETI(reg) */
3790 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3791 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
3792 p
->cost
[_stmt_NT
] = c
+ 0;
3796 case 263: /* ADDRGP */
3799 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3800 p
->cost
[_reg_NT
] = c
+ 0;
3802 _closure_reg(a
, c
+ 0);
3806 if (c
+ 0 < p
->cost
[_addrg_NT
]) {
3807 p
->cost
[_addrg_NT
] = c
+ 0;
3812 if (c
+ 0 < p
->cost
[_call_NT
]) {
3813 p
->cost
[_call_NT
] = c
+ 0;
3817 case 279: /* ADDRFP */
3820 if (c
+ 0 < p
->cost
[_stk13_NT
]) {
3821 p
->cost
[_stk13_NT
] = c
+ 0;
3823 _closure_stk13(a
, c
+ 0);
3827 if (c
+ 0 < p
->cost
[_stk_NT
]) {
3828 p
->cost
[_stk_NT
] = c
+ 0;
3830 _closure_stk(a
, c
+ 0);
3834 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3835 p
->cost
[_reg_NT
] = c
+ 0;
3837 _closure_reg(a
, c
+ 0);
3840 case 295: /* ADDRLP */
3843 if (c
+ 0 < p
->cost
[_stk13_NT
]) {
3844 p
->cost
[_stk13_NT
] = c
+ 0;
3846 _closure_stk13(a
, c
+ 0);
3850 if (c
+ 0 < p
->cost
[_stk_NT
]) {
3851 p
->cost
[_stk_NT
] = c
+ 0;
3853 _closure_stk(a
, c
+ 0);
3857 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3858 p
->cost
[_reg_NT
] = c
+ 0;
3860 _closure_reg(a
, c
+ 0);
3864 if (c
+ 0 < p
->cost
[_addrl_NT
]) {
3865 p
->cost
[_addrl_NT
] = c
+ 0;
3870 if (c
+ 0 < p
->cost
[_spill_NT
]) {
3871 p
->cost
[_spill_NT
] = c
+ 0;
3875 case 305: /* ADDF */
3876 _label(LEFT_CHILD(a
));
3877 _label(RIGHT_CHILD(a
));
3878 /* reg: ADDF(reg,reg) */
3879 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3880 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3881 p
->cost
[_reg_NT
] = c
+ 0;
3883 _closure_reg(a
, c
+ 0);
3886 case 306: /* ADDD */
3887 _label(LEFT_CHILD(a
));
3888 _label(RIGHT_CHILD(a
));
3889 /* reg: ADDD(reg,reg) */
3890 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3891 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3892 p
->cost
[_reg_NT
] = c
+ 0;
3894 _closure_reg(a
, c
+ 0);
3897 case 309: /* ADDI */
3898 _label(LEFT_CHILD(a
));
3899 _label(RIGHT_CHILD(a
));
3900 /* base: ADDI(reg,con13) */
3901 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_con13_NT
] + 0;
3902 if (c
+ 0 < p
->cost
[_base_NT
]) {
3903 p
->cost
[_base_NT
] = c
+ 0;
3905 _closure_base(a
, c
+ 0);
3907 /* addr: ADDI(reg,reg) */
3908 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
3909 if (c
+ 0 < p
->cost
[_addr_NT
]) {
3910 p
->cost
[_addr_NT
] = c
+ 0;
3912 _closure_addr(a
, c
+ 0);
3914 /* reg: ADDI(reg,rc) */
3915 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
3916 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3917 p
->cost
[_reg_NT
] = c
+ 0;
3919 _closure_reg(a
, c
+ 0);
3922 case 310: /* ADDU */
3923 _label(LEFT_CHILD(a
));
3924 _label(RIGHT_CHILD(a
));
3925 /* base: ADDU(reg,con13) */
3926 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_con13_NT
] + 0;
3927 if (c
+ 0 < p
->cost
[_base_NT
]) {
3928 p
->cost
[_base_NT
] = c
+ 0;
3930 _closure_base(a
, c
+ 0);
3932 /* addr: ADDU(reg,reg) */
3933 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
3934 if (c
+ 0 < p
->cost
[_addr_NT
]) {
3935 p
->cost
[_addr_NT
] = c
+ 0;
3937 _closure_addr(a
, c
+ 0);
3939 /* reg: ADDU(reg,rc) */
3940 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
3941 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3942 p
->cost
[_reg_NT
] = c
+ 0;
3944 _closure_reg(a
, c
+ 0);
3947 case 311: /* ADDP */
3948 _label(LEFT_CHILD(a
));
3949 _label(RIGHT_CHILD(a
));
3950 /* base: ADDP(reg,con13) */
3951 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_con13_NT
] + 0;
3952 if (c
+ 0 < p
->cost
[_base_NT
]) {
3953 p
->cost
[_base_NT
] = c
+ 0;
3955 _closure_base(a
, c
+ 0);
3957 /* addr: ADDP(reg,reg) */
3958 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
3959 if (c
+ 0 < p
->cost
[_addr_NT
]) {
3960 p
->cost
[_addr_NT
] = c
+ 0;
3962 _closure_addr(a
, c
+ 0);
3964 /* reg: ADDP(reg,rc) */
3965 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
3966 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3967 p
->cost
[_reg_NT
] = c
+ 0;
3969 _closure_reg(a
, c
+ 0);
3972 case 321: /* SUBF */
3973 _label(LEFT_CHILD(a
));
3974 _label(RIGHT_CHILD(a
));
3975 /* reg: SUBF(reg,reg) */
3976 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3977 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3978 p
->cost
[_reg_NT
] = c
+ 0;
3980 _closure_reg(a
, c
+ 0);
3983 case 322: /* SUBD */
3984 _label(LEFT_CHILD(a
));
3985 _label(RIGHT_CHILD(a
));
3986 /* reg: SUBD(reg,reg) */
3987 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
3988 if (c
+ 0 < p
->cost
[_reg_NT
]) {
3989 p
->cost
[_reg_NT
] = c
+ 0;
3991 _closure_reg(a
, c
+ 0);
3994 case 325: /* SUBI */
3995 _label(LEFT_CHILD(a
));
3996 _label(RIGHT_CHILD(a
));
3997 /* reg: SUBI(reg,rc) */
3998 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
3999 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4000 p
->cost
[_reg_NT
] = c
+ 0;
4002 _closure_reg(a
, c
+ 0);
4005 case 326: /* SUBU */
4006 _label(LEFT_CHILD(a
));
4007 _label(RIGHT_CHILD(a
));
4008 /* reg: SUBU(reg,rc) */
4009 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
4010 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4011 p
->cost
[_reg_NT
] = c
+ 0;
4013 _closure_reg(a
, c
+ 0);
4016 case 327: /* SUBP */
4017 _label(LEFT_CHILD(a
));
4018 _label(RIGHT_CHILD(a
));
4019 /* reg: SUBP(reg,rc) */
4020 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
4021 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4022 p
->cost
[_reg_NT
] = c
+ 0;
4024 _closure_reg(a
, c
+ 0);
4027 case 341: /* LSHI */
4028 _label(LEFT_CHILD(a
));
4029 _label(RIGHT_CHILD(a
));
4030 /* reg: LSHI(reg,rc5) */
4031 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc5_NT
] + 1;
4032 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4033 p
->cost
[_reg_NT
] = c
+ 0;
4035 _closure_reg(a
, c
+ 0);
4038 case 342: /* LSHU */
4039 _label(LEFT_CHILD(a
));
4040 _label(RIGHT_CHILD(a
));
4041 /* reg: LSHU(reg,rc5) */
4042 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc5_NT
] + 1;
4043 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4044 p
->cost
[_reg_NT
] = c
+ 0;
4046 _closure_reg(a
, c
+ 0);
4049 case 357: /* MODI */
4050 _label(LEFT_CHILD(a
));
4051 _label(RIGHT_CHILD(a
));
4052 /* reg: MODI(reg,reg) */
4053 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
4054 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4055 p
->cost
[_reg_NT
] = c
+ 0;
4057 _closure_reg(a
, c
+ 0);
4060 case 358: /* MODU */
4061 _label(LEFT_CHILD(a
));
4062 _label(RIGHT_CHILD(a
));
4063 /* reg: MODU(reg,reg) */
4064 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
4065 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4066 p
->cost
[_reg_NT
] = c
+ 0;
4068 _closure_reg(a
, c
+ 0);
4071 case 373: /* RSHI */
4072 _label(LEFT_CHILD(a
));
4073 _label(RIGHT_CHILD(a
));
4074 /* reg: RSHI(reg,rc5) */
4075 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc5_NT
] + 1;
4076 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4077 p
->cost
[_reg_NT
] = c
+ 0;
4079 _closure_reg(a
, c
+ 0);
4082 case 374: /* RSHU */
4083 _label(LEFT_CHILD(a
));
4084 _label(RIGHT_CHILD(a
));
4085 /* reg: RSHU(reg,rc5) */
4086 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc5_NT
] + 1;
4087 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4088 p
->cost
[_reg_NT
] = c
+ 0;
4090 _closure_reg(a
, c
+ 0);
4093 case 390: /* BANDU */
4094 _label(LEFT_CHILD(a
));
4095 _label(RIGHT_CHILD(a
));
4096 /* reg: BANDU(reg,rc) */
4097 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
4098 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4099 p
->cost
[_reg_NT
] = c
+ 0;
4101 _closure_reg(a
, c
+ 0);
4103 if ( /* reg: BANDU(reg,BCOMU(rc)) */
4104 RIGHT_CHILD(a
)->op
== 406 /* BCOMU */
4106 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(LEFT_CHILD(RIGHT_CHILD(a
))->x
.state
))->cost
[_rc_NT
] + 1;
4107 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4108 p
->cost
[_reg_NT
] = c
+ 0;
4110 _closure_reg(a
, c
+ 0);
4114 case 406: /* BCOMU */
4115 _label(LEFT_CHILD(a
));
4116 /* reg: BCOMU(reg) */
4117 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
4118 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4119 p
->cost
[_reg_NT
] = c
+ 0;
4121 _closure_reg(a
, c
+ 0);
4124 case 422: /* BORU */
4125 _label(LEFT_CHILD(a
));
4126 _label(RIGHT_CHILD(a
));
4127 /* reg: BORU(reg,rc) */
4128 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
4129 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4130 p
->cost
[_reg_NT
] = c
+ 0;
4132 _closure_reg(a
, c
+ 0);
4134 if ( /* reg: BORU(reg,BCOMU(rc)) */
4135 RIGHT_CHILD(a
)->op
== 406 /* BCOMU */
4137 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(LEFT_CHILD(RIGHT_CHILD(a
))->x
.state
))->cost
[_rc_NT
] + 1;
4138 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4139 p
->cost
[_reg_NT
] = c
+ 0;
4141 _closure_reg(a
, c
+ 0);
4145 case 438: /* BXORU */
4146 _label(LEFT_CHILD(a
));
4147 _label(RIGHT_CHILD(a
));
4148 /* reg: BXORU(reg,rc) */
4149 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 1;
4150 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4151 p
->cost
[_reg_NT
] = c
+ 0;
4153 _closure_reg(a
, c
+ 0);
4155 if ( /* reg: BXORU(reg,BCOMU(rc)) */
4156 RIGHT_CHILD(a
)->op
== 406 /* BCOMU */
4158 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(LEFT_CHILD(RIGHT_CHILD(a
))->x
.state
))->cost
[_rc_NT
] + 1;
4159 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4160 p
->cost
[_reg_NT
] = c
+ 0;
4162 _closure_reg(a
, c
+ 0);
4166 case 449: /* DIVF */
4167 _label(LEFT_CHILD(a
));
4168 _label(RIGHT_CHILD(a
));
4169 /* reg: DIVF(reg,reg) */
4170 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
4171 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4172 p
->cost
[_reg_NT
] = c
+ 0;
4174 _closure_reg(a
, c
+ 0);
4177 case 450: /* DIVD */
4178 _label(LEFT_CHILD(a
));
4179 _label(RIGHT_CHILD(a
));
4180 /* reg: DIVD(reg,reg) */
4181 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
4182 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4183 p
->cost
[_reg_NT
] = c
+ 0;
4185 _closure_reg(a
, c
+ 0);
4188 case 453: /* DIVI */
4189 _label(LEFT_CHILD(a
));
4190 _label(RIGHT_CHILD(a
));
4191 /* reg: DIVI(reg,reg) */
4192 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
4193 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4194 p
->cost
[_reg_NT
] = c
+ 0;
4196 _closure_reg(a
, c
+ 0);
4199 case 454: /* DIVU */
4200 _label(LEFT_CHILD(a
));
4201 _label(RIGHT_CHILD(a
));
4202 /* reg: DIVU(reg,reg) */
4203 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
4204 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4205 p
->cost
[_reg_NT
] = c
+ 0;
4207 _closure_reg(a
, c
+ 0);
4210 case 465: /* MULF */
4211 _label(LEFT_CHILD(a
));
4212 _label(RIGHT_CHILD(a
));
4213 /* reg: MULF(reg,reg) */
4214 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
4215 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4216 p
->cost
[_reg_NT
] = c
+ 0;
4218 _closure_reg(a
, c
+ 0);
4221 case 466: /* MULD */
4222 _label(LEFT_CHILD(a
));
4223 _label(RIGHT_CHILD(a
));
4224 /* reg: MULD(reg,reg) */
4225 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 1;
4226 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4227 p
->cost
[_reg_NT
] = c
+ 0;
4229 _closure_reg(a
, c
+ 0);
4232 case 469: /* MULI */
4233 _label(LEFT_CHILD(a
));
4234 _label(RIGHT_CHILD(a
));
4235 /* reg: MULI(reg,reg) */
4236 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
4237 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4238 p
->cost
[_reg_NT
] = c
+ 0;
4240 _closure_reg(a
, c
+ 0);
4243 case 470: /* MULU */
4244 _label(LEFT_CHILD(a
));
4245 _label(RIGHT_CHILD(a
));
4246 /* reg: MULU(reg,reg) */
4247 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 2;
4248 if (c
+ 0 < p
->cost
[_reg_NT
]) {
4249 p
->cost
[_reg_NT
] = c
+ 0;
4251 _closure_reg(a
, c
+ 0);
4255 _label(LEFT_CHILD(a
));
4256 _label(RIGHT_CHILD(a
));
4257 /* rel: EQF(reg,reg) */
4258 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4259 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4260 p
->cost
[_rel_NT
] = c
+ 0;
4262 _closure_rel(a
, c
+ 0);
4266 _label(LEFT_CHILD(a
));
4267 _label(RIGHT_CHILD(a
));
4268 /* rel: EQD(reg,reg) */
4269 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4270 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4271 p
->cost
[_rel_NT
] = c
+ 0;
4273 _closure_rel(a
, c
+ 0);
4277 _label(LEFT_CHILD(a
));
4278 _label(RIGHT_CHILD(a
));
4279 /* stmt: EQI(reg,rc) */
4280 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4281 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4282 p
->cost
[_stmt_NT
] = c
+ 0;
4287 _label(LEFT_CHILD(a
));
4288 _label(RIGHT_CHILD(a
));
4289 /* rel: GEF(reg,reg) */
4290 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4291 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4292 p
->cost
[_rel_NT
] = c
+ 0;
4294 _closure_rel(a
, c
+ 0);
4298 _label(LEFT_CHILD(a
));
4299 _label(RIGHT_CHILD(a
));
4300 /* rel: GED(reg,reg) */
4301 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4302 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4303 p
->cost
[_rel_NT
] = c
+ 0;
4305 _closure_rel(a
, c
+ 0);
4309 _label(LEFT_CHILD(a
));
4310 _label(RIGHT_CHILD(a
));
4311 /* stmt: GEI(reg,rc) */
4312 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4313 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4314 p
->cost
[_stmt_NT
] = c
+ 0;
4319 _label(LEFT_CHILD(a
));
4320 _label(RIGHT_CHILD(a
));
4321 /* stmt: GEU(reg,rc) */
4322 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4323 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4324 p
->cost
[_stmt_NT
] = c
+ 0;
4329 _label(LEFT_CHILD(a
));
4330 _label(RIGHT_CHILD(a
));
4331 /* rel: GTF(reg,reg) */
4332 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4333 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4334 p
->cost
[_rel_NT
] = c
+ 0;
4336 _closure_rel(a
, c
+ 0);
4340 _label(LEFT_CHILD(a
));
4341 _label(RIGHT_CHILD(a
));
4342 /* rel: GTD(reg,reg) */
4343 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4344 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4345 p
->cost
[_rel_NT
] = c
+ 0;
4347 _closure_rel(a
, c
+ 0);
4351 _label(LEFT_CHILD(a
));
4352 _label(RIGHT_CHILD(a
));
4353 /* stmt: GTI(reg,rc) */
4354 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4355 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4356 p
->cost
[_stmt_NT
] = c
+ 0;
4361 _label(LEFT_CHILD(a
));
4362 _label(RIGHT_CHILD(a
));
4363 /* stmt: GTU(reg,rc) */
4364 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4365 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4366 p
->cost
[_stmt_NT
] = c
+ 0;
4371 _label(LEFT_CHILD(a
));
4372 _label(RIGHT_CHILD(a
));
4373 /* rel: LEF(reg,reg) */
4374 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4375 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4376 p
->cost
[_rel_NT
] = c
+ 0;
4378 _closure_rel(a
, c
+ 0);
4382 _label(LEFT_CHILD(a
));
4383 _label(RIGHT_CHILD(a
));
4384 /* rel: LED(reg,reg) */
4385 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4386 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4387 p
->cost
[_rel_NT
] = c
+ 0;
4389 _closure_rel(a
, c
+ 0);
4393 _label(LEFT_CHILD(a
));
4394 _label(RIGHT_CHILD(a
));
4395 /* stmt: LEI(reg,rc) */
4396 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4397 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4398 p
->cost
[_stmt_NT
] = c
+ 0;
4403 _label(LEFT_CHILD(a
));
4404 _label(RIGHT_CHILD(a
));
4405 /* stmt: LEU(reg,rc) */
4406 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4407 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4408 p
->cost
[_stmt_NT
] = c
+ 0;
4413 _label(LEFT_CHILD(a
));
4414 _label(RIGHT_CHILD(a
));
4415 /* rel: LTF(reg,reg) */
4416 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4417 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4418 p
->cost
[_rel_NT
] = c
+ 0;
4420 _closure_rel(a
, c
+ 0);
4424 _label(LEFT_CHILD(a
));
4425 _label(RIGHT_CHILD(a
));
4426 /* rel: LTD(reg,reg) */
4427 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4428 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4429 p
->cost
[_rel_NT
] = c
+ 0;
4431 _closure_rel(a
, c
+ 0);
4435 _label(LEFT_CHILD(a
));
4436 _label(RIGHT_CHILD(a
));
4437 /* stmt: LTI(reg,rc) */
4438 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4439 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4440 p
->cost
[_stmt_NT
] = c
+ 0;
4445 _label(LEFT_CHILD(a
));
4446 _label(RIGHT_CHILD(a
));
4447 /* stmt: LTU(reg,rc) */
4448 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4449 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4450 p
->cost
[_stmt_NT
] = c
+ 0;
4455 _label(LEFT_CHILD(a
));
4456 _label(RIGHT_CHILD(a
));
4457 /* rel: NEF(reg,reg) */
4458 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4459 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4460 p
->cost
[_rel_NT
] = c
+ 0;
4462 _closure_rel(a
, c
+ 0);
4466 _label(LEFT_CHILD(a
));
4467 _label(RIGHT_CHILD(a
));
4468 /* rel: NED(reg,reg) */
4469 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + 0;
4470 if (c
+ 0 < p
->cost
[_rel_NT
]) {
4471 p
->cost
[_rel_NT
] = c
+ 0;
4473 _closure_rel(a
, c
+ 0);
4477 _label(LEFT_CHILD(a
));
4478 _label(RIGHT_CHILD(a
));
4479 /* stmt: NEI(reg,rc) */
4480 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_reg_NT
] + ((struct _state
*)(RIGHT_CHILD(a
)->x
.state
))->cost
[_rc_NT
] + 3;
4481 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4482 p
->cost
[_stmt_NT
] = c
+ 0;
4486 case 584: /* JUMPV */
4487 _label(LEFT_CHILD(a
));
4488 /* stmt: JUMPV(addrg) */
4489 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addrg_NT
] + 2;
4490 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4491 p
->cost
[_stmt_NT
] = c
+ 0;
4494 /* stmt: JUMPV(addr) */
4495 c
= ((struct _state
*)(LEFT_CHILD(a
)->x
.state
))->cost
[_addr_NT
] + 2;
4496 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4497 p
->cost
[_stmt_NT
] = c
+ 0;
4501 case 600: /* LABELV */
4504 if (c
+ 0 < p
->cost
[_stmt_NT
]) {
4505 p
->cost
[_stmt_NT
] = c
+ 0;
4509 case 615: /* VREGP */
4512 fatal("_label", "Bad terminal %d\n", OP_LABEL(a
));
4516 static void _kids(p
, eruleno
, kids
) NODEPTR_TYPE p
, kids
[]; int eruleno
; {
4518 fatal("_kids", "Null tree\n", 0);
4520 fatal("_kids", "Null kids\n", 0);
4522 case 136: /* call: ADDRGP */
4523 case 125: /* stmt: LABELV */
4524 case 122: /* addrg: ADDRGP */
4525 case 107: /* rc5: CNSTI */
4526 case 94: /* reg: CNSTU */
4527 case 93: /* reg: CNSTS */
4528 case 92: /* reg: CNSTP */
4529 case 91: /* reg: CNSTI */
4530 case 90: /* reg: CNSTC */
4531 case 62: /* spill: ADDRLP */
4532 case 57: /* addrl: ADDRLP */
4533 case 35: /* con13: CNSTU */
4534 case 34: /* con13: CNSTS */
4535 case 33: /* con13: CNSTP */
4536 case 32: /* con13: CNSTI */
4537 case 31: /* con13: CNSTC */
4538 case 30: /* reg: ADDRLP */
4539 case 29: /* reg: ADDRFP */
4540 case 28: /* stk: ADDRLP */
4541 case 27: /* stk: ADDRFP */
4542 case 25: /* stk13: ADDRLP */
4543 case 24: /* stk13: ADDRFP */
4544 case 23: /* reg: ADDRGP */
4545 case 17: /* con: CNSTU */
4546 case 16: /* con: CNSTS */
4547 case 15: /* con: CNSTP */
4548 case 14: /* con: CNSTI */
4549 case 13: /* con: CNSTC */
4550 case 6: /* reg: INDIRS(VREGP) */
4551 case 5: /* reg: INDIRP(VREGP) */
4552 case 4: /* reg: INDIRI(VREGP) */
4553 case 3: /* reg: INDIRF(VREGP) */
4554 case 2: /* reg: INDIRD(VREGP) */
4555 case 1: /* reg: INDIRC(VREGP) */
4557 case 12: /* stmt: ASGNS(VREGP,reg) */
4558 case 11: /* stmt: ASGNP(VREGP,reg) */
4559 case 10: /* stmt: ASGNI(VREGP,reg) */
4560 case 9: /* stmt: ASGNF(VREGP,reg) */
4561 case 8: /* stmt: ASGND(VREGP,reg) */
4562 case 7: /* stmt: ASGNC(VREGP,reg) */
4563 kids
[0] = RIGHT_CHILD(p
);
4565 case 182: /* stmt: rel */
4566 case 137: /* call: addr */
4567 case 108: /* rc5: reg */
4568 case 97: /* rc: reg */
4569 case 96: /* rc: con13 */
4570 case 95: /* reg: con */
4571 case 46: /* addr: stk */
4572 case 42: /* addr: base */
4573 case 41: /* base: stk13 */
4574 case 40: /* base: con13 */
4575 case 39: /* base: reg */
4576 case 26: /* reg: stk13 */
4577 case 18: /* stmt: reg */
4580 case 184: /* reg: NEGD(reg) */
4581 case 183: /* reg: LOADD(reg) */
4582 case 169: /* reg: CVID(reg) */
4583 case 168: /* reg: CVDI(reg) */
4584 case 167: /* reg: CVFD(reg) */
4585 case 166: /* reg: CVDF(reg) */
4586 case 165: /* reg: LOADF(reg) */
4587 case 164: /* reg: NEGF(reg) */
4588 case 149: /* stmt: ARGF(reg) */
4589 case 148: /* stmt: ARGD(reg) */
4590 case 147: /* stmt: ARGP(reg) */
4591 case 146: /* stmt: ARGI(reg) */
4592 case 145: /* stmt: RETI(reg) */
4593 case 144: /* stmt: RETF(reg) */
4594 case 143: /* stmt: RETD(reg) */
4595 case 141: /* stmt: CALLV(call) */
4596 case 140: /* reg: CALLI(call) */
4597 case 139: /* reg: CALLF(call) */
4598 case 138: /* reg: CALLD(call) */
4599 case 124: /* stmt: JUMPV(addr) */
4600 case 123: /* stmt: JUMPV(addrg) */
4601 case 121: /* reg: CVSU(reg) */
4602 case 120: /* reg: CVCU(reg) */
4603 case 119: /* reg: CVSI(reg) */
4604 case 118: /* reg: CVCI(reg) */
4605 case 117: /* reg: BCOMU(reg) */
4606 case 116: /* reg: NEGI(reg) */
4607 case 89: /* reg: LOADU(reg) */
4608 case 88: /* reg: LOADS(reg) */
4609 case 87: /* reg: LOADP(reg) */
4610 case 86: /* reg: LOADI(reg) */
4611 case 85: /* reg: LOADC(reg) */
4612 case 84: /* reg: CVUS(reg) */
4613 case 83: /* reg: CVUC(reg) */
4614 case 82: /* reg: CVIS(reg) */
4615 case 81: /* reg: CVIC(reg) */
4616 case 80: /* reg: CVUS(reg) */
4617 case 79: /* reg: CVUP(reg) */
4618 case 78: /* reg: CVUI(reg) */
4619 case 77: /* reg: CVUC(reg) */
4620 case 76: /* reg: CVPU(reg) */
4621 case 75: /* reg: CVIU(reg) */
4622 case 74: /* reg: CVIS(reg) */
4623 case 73: /* reg: CVIC(reg) */
4624 case 60: /* reg: INDIRD(base) */
4625 case 58: /* reg: INDIRD(addrl) */
4626 case 51: /* reg: INDIRF(addr) */
4627 case 50: /* reg: INDIRP(addr) */
4628 case 49: /* reg: INDIRI(addr) */
4629 case 48: /* reg: INDIRS(addr) */
4630 case 47: /* reg: INDIRC(addr) */
4631 case 22: /* reg: CVUP(reg) */
4632 case 21: /* reg: CVUI(reg) */
4633 case 20: /* reg: CVPU(reg) */
4634 case 19: /* reg: CVIU(reg) */
4635 kids
[0] = LEFT_CHILD(p
);
4637 case 181: /* rel: NEF(reg,reg) */
4638 case 180: /* rel: NED(reg,reg) */
4639 case 179: /* rel: LTF(reg,reg) */
4640 case 178: /* rel: LTD(reg,reg) */
4641 case 177: /* rel: LEF(reg,reg) */
4642 case 176: /* rel: LED(reg,reg) */
4643 case 175: /* rel: GTF(reg,reg) */
4644 case 174: /* rel: GTD(reg,reg) */
4645 case 173: /* rel: GEF(reg,reg) */
4646 case 172: /* rel: GED(reg,reg) */
4647 case 171: /* rel: EQF(reg,reg) */
4648 case 170: /* rel: EQD(reg,reg) */
4649 case 163: /* reg: SUBF(reg,reg) */
4650 case 162: /* reg: SUBD(reg,reg) */
4651 case 161: /* reg: MULF(reg,reg) */
4652 case 160: /* reg: MULD(reg,reg) */
4653 case 159: /* reg: DIVF(reg,reg) */
4654 case 158: /* reg: DIVD(reg,reg) */
4655 case 157: /* reg: ADDF(reg,reg) */
4656 case 156: /* reg: ADDD(reg,reg) */
4657 case 155: /* reg: MULU(reg,reg) */
4658 case 154: /* reg: MULI(reg,reg) */
4659 case 153: /* reg: MODU(reg,reg) */
4660 case 152: /* reg: MODI(reg,reg) */
4661 case 151: /* reg: DIVU(reg,reg) */
4662 case 150: /* reg: DIVI(reg,reg) */
4663 case 142: /* stmt: CALLB(call,reg) */
4664 case 135: /* stmt: NEI(reg,rc) */
4665 case 134: /* stmt: LTU(reg,rc) */
4666 case 133: /* stmt: LTI(reg,rc) */
4667 case 132: /* stmt: LEU(reg,rc) */
4668 case 131: /* stmt: LEI(reg,rc) */
4669 case 130: /* stmt: GTU(reg,rc) */
4670 case 129: /* stmt: GTI(reg,rc) */
4671 case 128: /* stmt: GEU(reg,rc) */
4672 case 127: /* stmt: GEI(reg,rc) */
4673 case 126: /* stmt: EQI(reg,rc) */
4674 case 112: /* reg: RSHU(reg,rc5) */
4675 case 111: /* reg: RSHI(reg,rc5) */
4676 case 110: /* reg: LSHU(reg,rc5) */
4677 case 109: /* reg: LSHI(reg,rc5) */
4678 case 106: /* reg: SUBU(reg,rc) */
4679 case 105: /* reg: SUBP(reg,rc) */
4680 case 104: /* reg: SUBI(reg,rc) */
4681 case 103: /* reg: BXORU(reg,rc) */
4682 case 102: /* reg: BORU(reg,rc) */
4683 case 101: /* reg: BANDU(reg,rc) */
4684 case 100: /* reg: ADDU(reg,rc) */
4685 case 99: /* reg: ADDP(reg,rc) */
4686 case 98: /* reg: ADDI(reg,rc) */
4687 case 68: /* stmt: ASGND(spill,reg) */
4688 case 67: /* stmt: ASGNF(spill,reg) */
4689 case 66: /* stmt: ASGNP(spill,reg) */
4690 case 65: /* stmt: ASGNI(spill,reg) */
4691 case 64: /* stmt: ASGNS(spill,reg) */
4692 case 63: /* stmt: ASGNC(spill,reg) */
4693 case 61: /* stmt: ASGND(base,reg) */
4694 case 59: /* stmt: ASGND(addrl,reg) */
4695 case 56: /* stmt: ASGNF(addr,reg) */
4696 case 55: /* stmt: ASGNP(addr,reg) */
4697 case 54: /* stmt: ASGNI(addr,reg) */
4698 case 53: /* stmt: ASGNS(addr,reg) */
4699 case 52: /* stmt: ASGNC(addr,reg) */
4700 case 45: /* addr: ADDU(reg,reg) */
4701 case 44: /* addr: ADDP(reg,reg) */
4702 case 43: /* addr: ADDI(reg,reg) */
4703 case 38: /* base: ADDU(reg,con13) */
4704 case 37: /* base: ADDP(reg,con13) */
4705 case 36: /* base: ADDI(reg,con13) */
4706 kids
[0] = LEFT_CHILD(p
);
4707 kids
[1] = RIGHT_CHILD(p
);
4709 case 72: /* reg: CVSU(INDIRS(addr)) */
4710 case 71: /* reg: CVCU(INDIRC(addr)) */
4711 case 70: /* reg: CVSI(INDIRS(addr)) */
4712 case 69: /* reg: CVCI(INDIRC(addr)) */
4713 kids
[0] = LEFT_CHILD(LEFT_CHILD(p
));
4715 case 185: /* stmt: ASGNB(reg,INDIRB(reg)) */
4716 case 115: /* reg: BXORU(reg,BCOMU(rc)) */
4717 case 114: /* reg: BORU(reg,BCOMU(rc)) */
4718 case 113: /* reg: BANDU(reg,BCOMU(rc)) */
4719 kids
[0] = LEFT_CHILD(p
);
4720 kids
[1] = LEFT_CHILD(RIGHT_CHILD(p
));
4723 fatal("_kids", "Bad rule number %d\n", eruleno
);
4727 static void progend(){}
4728 static void progbeg(argc
, argv
) int argc
; char *argv
[]; {
4738 swap
= (u
.i
== 1) != IR
->little_endian
;
4740 parseflags(argc
, argv
);
4741 for (i
= 0; i
< argc
; i
++)
4742 if (strcmp(argv
[i
], "-p") == 0 || strcmp(argv
[i
], "-pg") == 0)
4744 for (i
= 0; i
< 8; i
++) {
4745 greg
[i
+ 0] = mkreg(stringf("g%d", i
), i
+ 0, 1, IREG
);
4746 greg
[i
+ 8] = mkreg(stringf("o%d", i
), i
+ 8, 1, IREG
);
4747 greg
[i
+ 16] = mkreg(stringf("l%d", i
), i
+ 16, 1, IREG
);
4748 greg
[i
+ 24] = mkreg(stringf("i%d", i
), i
+ 24, 1, IREG
);
4750 for (i
= 0; i
< 32; i
++)
4751 freg
[i
] = mkreg("%d", i
, 1, FREG
);
4752 for (i
= 0; i
< 31; i
+= 2)
4753 freg2
[i
] = mkreg("%d", i
, 3, FREG
);
4754 rmap
[C
] = rmap
[S
] = rmap
[P
] = rmap
[B
] = rmap
[U
] = rmap
[I
] =
4756 rmap
[F
] = mkwildcard(freg
);
4757 rmap
[D
] = mkwildcard(freg2
);
4758 tmask
[IREG
] = 0x3fff3e00;
4759 vmask
[IREG
] = 0x3ff00000;
4760 tmask
[FREG
] = ~(unsigned)0;
4763 static void target(p
) Node p
; {
4766 case CNSTC
: case CNSTI
: case CNSTS
: case CNSTU
: case CNSTP
:
4767 if (range(p
, 0, 0) == 0) {
4769 p
->x
.registered
= 1;
4772 case CALLD
: setreg(p
, freg2
[0]); break;
4773 case CALLF
: setreg(p
, freg
[0]); break;
4775 case CALLV
: setreg(p
, oreg
[0]); break;
4776 case RETD
: rtarget(p
, 0, freg2
[0]); break;
4777 case RETF
: rtarget(p
, 0, freg
[0]); break;
4779 rtarget(p
, 0, ireg
[0]);
4780 p
->kids
[0]->x
.registered
= 1;
4782 case ARGI
: case ARGP
:
4783 if (p
->syms
[RX
]->u
.c
.v
.i
< 6) {
4784 rtarget(p
, 0, oreg
[p
->syms
[RX
]->u
.c
.v
.i
]);
4785 p
->op
= LOAD
+optype(p
->op
);
4786 setreg(p
, oreg
[p
->syms
[RX
]->u
.c
.v
.i
]);
4789 case DIVI
: case MODI
: case MULI
:
4790 case DIVU
: case MODU
: case MULU
:
4792 rtarget(p
, 0, oreg
[0]);
4793 rtarget(p
, 1, oreg
[1]);
4797 static void clobber(p
) Node p
; {
4800 case CALLB
: case CALLD
: case CALLF
: case CALLI
:
4801 spill(~(unsigned)3, FREG
, p
);
4804 spill(oreg
[0]->x
.regnode
->mask
, IREG
, p
);
4805 spill(~(unsigned)3, FREG
, p
);
4808 if (p
->syms
[2]->u
.c
.v
.i
<= 6)
4809 spill((1<<(p
->syms
[2]->u
.c
.v
.i
+ 8)), IREG
, p
);
4812 if (p
->syms
[2]->u
.c
.v
.i
<= 5)
4813 spill((3<<(p
->syms
[2]->u
.c
.v
.i
+ 8))&0xff00, IREG
, p
);
4815 case DIVI
: case MODI
: case MULI
:
4816 case DIVU
: case MODU
: case MULU
:
4817 spill(0x00003e00, IREG
, p
); break;
4820 static int imm(p
) Node p
; {
4821 return range(p
, -4096, 4095);
4823 static void doarg(p
) Node p
; {
4824 assert(p
&& p
->syms
[0] && p
->op
!= ARG
+B
);
4825 p
->syms
[RX
] = intconst(mkactual(4,
4826 p
->syms
[0]->u
.c
.v
.i
)/4);
4828 static void emit2(p
) Node p
; {
4831 int n
= p
->syms
[RX
]->u
.c
.v
.i
;
4832 print("st %%f%d,[%%sp+4*%d+68]\n",
4833 getregnum(p
->x
.kids
[0]), n
);
4835 print("ld [%%sp+4*%d+68],%%o%d\n", n
, n
);
4839 int n
= p
->syms
[RX
]->u
.c
.v
.i
;
4840 int src
= getregnum(p
->x
.kids
[0]);
4841 print("st %%f%d,[%%sp+4*%d+68]\n", src
, n
);
4842 print("st %%f%d,[%%sp+4*%d+68]\n", src
+1, n
+1);
4844 print("ld [%%sp+4*%d+68],%%o%d\n", n
, n
);
4846 print("ld [%%sp+4*%d+68],%%o%d\n", n
+1, n
+1);
4850 int dst
= getregnum(p
);
4851 int src
= getregnum(p
->x
.kids
[0]);
4852 print("fmovs %%f%d,%%f%d; ", src
, dst
);
4853 print("fmovs %%f%d,%%f%d\n", src
+1, dst
+1);
4857 int dst
= getregnum(p
);
4858 int src
= getregnum(p
->x
.kids
[0]);
4859 print("fnegs %%f%d,%%f%d; ", src
, dst
);
4860 print("fmovs %%f%d,%%f%d\n", src
+1, dst
+1);
4864 static int tmpregs
[] = { 1, 2, 3 };
4865 dalign
= salign
= p
->syms
[1]->u
.c
.v
.i
;
4866 blkcopy(getregnum(p
->x
.kids
[0]), 0,
4867 getregnum(p
->x
.kids
[1]), 0,
4868 p
->syms
[0]->u
.c
.v
.i
, tmpregs
);
4873 static void local(p
) Symbol p
; {
4875 p
->x
.name
= stringd(4*16);
4880 if (isscalar(p
->type
) && !p
->addressed
&& !isfloat(p
->type
))
4881 p
->sclass
= REGISTER
;
4882 if (glevel
&& glevel
!= 3) p
->sclass
= AUTO
; /* glevel!=3 is for Norman's debugger */
4883 if (askregvar(p
, rmap
[ttob(p
->type
)]) == 0)
4886 static void function(f
, caller
, callee
, ncalls
)
4887 Symbol f
, callee
[], caller
[]; int ncalls
; {
4888 int autos
= 0, i
, leaf
, reg
, varargs
;
4890 for (i
= 0; callee
[i
]; i
++)
4892 varargs
= variadic(f
->type
)
4893 || i
> 0 && strcmp(callee
[i
-1]->name
,
4894 "__builtin_va_alist") == 0;
4895 usedmask
[0] = usedmask
[1] = 0;
4896 freemask
[0] = freemask
[1] = ~(unsigned)0;
4897 for (i
= 0; i
< 8; i
++)
4898 ireg
[i
]->x
.regnode
->vbl
= NULL
;
4902 for (i
= 0; callee
[i
]; i
++) {
4903 Symbol p
= callee
[i
], q
= caller
[i
];
4904 int size
= roundup(q
->type
->size
, 4);
4906 if (isfloat(p
->type
) || reg
>= 6) {
4907 p
->x
.offset
= q
->x
.offset
= offset
;
4908 p
->x
.name
= q
->x
.name
= stringd(offset
);
4909 p
->sclass
= q
->sclass
= AUTO
;
4912 else if (p
->addressed
|| varargs
)
4914 p
->x
.offset
= offset
;
4915 p
->x
.name
= stringd(p
->x
.offset
);
4917 q
->sclass
= REGISTER
;
4918 askregvar(q
, ireg
[reg
]);
4919 assert(q
->x
.regnode
);
4922 else if (glevel
&& glevel
!= 3) {
4923 p
->x
.offset
= offset
;
4924 p
->x
.name
= stringd(p
->x
.offset
);
4926 q
->sclass
= REGISTER
;
4927 askregvar(q
, ireg
[reg
]);
4928 assert(q
->x
.regnode
);
4933 p
->sclass
= q
->sclass
= REGISTER
;
4934 askregvar(p
, ireg
[reg
]);
4935 assert(p
->x
.regnode
);
4936 q
->x
.name
= p
->x
.name
;
4939 reg
+= isstruct(p
->type
) ? 1 : size
/4;
4941 assert(caller
[i
] == 0);
4942 offset
= maxoffset
= 0;
4943 retstruct
= isstruct(freturn(f
->type
));
4944 gencode(caller
, callee
);
4945 maxargoffset
= roundup(maxargoffset
, 4);
4946 framesize
= roundup(maxoffset
+ maxargoffset
+ 4*(16+1), 8);
4947 assert(!varargs
|| autos
);
4949 && !maxoffset
&& !autos
4950 && !isstruct(freturn(f
->type
))
4951 && !(usedmask
[IREG
]&0x00ffff01)
4952 && !(usedmask
[FREG
]&~(unsigned)3)
4953 && !pflag
&& !glevel
);
4954 print(".align 4\n.proc 4\n%s:\n", f
->x
.name
);
4956 for (i
= 0; caller
[i
] && callee
[i
]; i
++) {
4957 Symbol p
= caller
[i
], q
= callee
[i
];
4958 if (p
->sclass
== REGISTER
&& q
->sclass
== REGISTER
)
4959 assert(q
->x
.regnode
),
4960 assert(q
->x
.regnode
->set
== IREG
),
4961 assert(q
->x
.regnode
->number
>= 24),
4962 assert(q
->x
.regnode
->number
<= 31),
4963 p
->x
.name
= greg
[q
->x
.regnode
->number
- 16]->x
.name
;
4966 } else if (framesize
<= 4095)
4967 print("save %%sp,%d,%%sp\n", -framesize
);
4969 print("set %d,%%g1; save %%sp,%%g1,%%sp\n", -framesize
);
4971 for (; reg
< 6; reg
++)
4972 print("st %%i%d,[%%fp+%d]\n", reg
, 4*reg
+ 68);
4974 offset
= 4*(16 + 1);
4976 for (i
= 0; caller
[i
]; i
++) {
4977 Symbol p
= caller
[i
];
4978 if (isdouble(p
->type
) && reg
<= 4) {
4979 print("st %%r%d,[%%fp+%d]\n",
4980 ireg
[reg
++]->x
.regnode
->number
, offset
);
4981 print("st %%r%d,[%%fp+%d]\n",
4982 ireg
[reg
++]->x
.regnode
->number
, offset
+ 4);
4983 } else if (isfloat(p
->type
) && reg
<= 5)
4984 print("st %%r%d,[%%fp+%d]\n",
4985 ireg
[reg
++]->x
.regnode
->number
, offset
);
4988 offset
+= roundup(p
->type
->size
, 4);
4991 int lab
= genlabel(1);
4992 print("set L%d,%%o0; call mcount; nop\n", lab
);
4993 print(".seg \"data\"\n.align 4; L%d:.word 0\n.seg \"text\"\n", lab
);
4997 print("ret; restore\n");
5000 print("retl; nop\n");
5003 #define exch(x, y, t) (((t) = x), ((x) = (y)), ((y) = (t)))
5005 static void rename() {
5008 for (i
= 0; i
< 8; i
++) {
5011 if (ireg
[i
]->x
.regnode
->vbl
)
5012 ireg
[i
]->x
.regnode
->vbl
->x
.name
= oreg
[i
]->x
.name
;
5013 exch(ireg
[i
]->x
.name
, oreg
[i
]->x
.name
, ptmp
);
5014 exch(ireg
[i
]->x
.regnode
->number
,
5015 oreg
[i
]->x
.regnode
->number
, itmp
);
5018 static void defconst(ty
, v
) int ty
; Value v
; {
5020 case C
: print(".byte %d\n", v
.uc
); return;
5021 case S
: print(".half %d\n", v
.ss
); return;
5022 case I
: print(".word %d\n", v
.i
); return;
5023 case U
: print(".word 0x%x\n", v
.u
); return;
5024 case P
: print(".word 0x%x\n", v
.p
); return;
5026 print(".word 0x%x\n", *(unsigned *)&v
.f
);
5029 unsigned *p
= (unsigned *)&v
.d
;
5030 print(".word 0x%x\n.word 0x%x\n", p
[swap
], p
[!swap
]);
5037 static void defaddress(p
) Symbol p
; {
5038 print(".word %s\n", p
->x
.name
);
5041 static void defstring(n
, str
) int n
; char *str
; {
5044 for (s
= str
; s
< str
+ n
; s
++)
5045 print(".byte %d\n", (*s
)&0377);
5048 static void address(q
, p
, n
) Symbol q
, p
; int n
; {
5049 q
->x
.offset
= p
->x
.offset
+ n
;
5050 if (p
->scope
== GLOBAL
|| p
->sclass
== STATIC
|| p
->sclass
== EXTERN
)
5051 q
->x
.name
= stringf("%s%s%d", p
->x
.name
, n
>= 0 ? "+" : "", n
);
5053 q
->x
.name
= stringd(q
->x
.offset
);
5055 static void export(p
) Symbol p
; {
5056 print(".global %s\n", p
->x
.name
);
5058 static void import(p
) Symbol p
; {}
5059 static void defsymbol(p
) Symbol p
; {
5060 if (p
->scope
>= LOCAL
&& p
->sclass
== STATIC
)
5061 p
->x
.name
= stringf("%d", genlabel(1));
5063 assert(p
->scope
!= CONSTANTS
|| isint(p
->type
) || isptr(p
->type
)),
5064 p
->x
.name
= p
->name
;
5065 if (p
->scope
>= LABELS
)
5066 p
->x
.name
= stringf(p
->generated
? "L%s" : "_%s",
5069 static void segment(n
) int n
; {
5072 case CODE
: print(".seg \"text\"\n"); break;
5073 case BSS
: print(".seg \"bss\"\n"); break;
5074 case DATA
: print(".seg \"data\"\n"); break;
5075 case LIT
: print(".seg \"text\"\n"); break;
5078 static void space(n
) int n
; {
5080 print(".skip %d\n", n
);
5082 static void global(p
) Symbol p
; {
5083 print(".align %d\n", p
->type
->align
);
5086 && (p
->sclass
== STATIC
|| Aflag
>= 2))
5087 print(".reserve %s,%d\n", p
->x
.name
, p
->type
->size
);
5088 else if (p
->u
.seg
== BSS
)
5089 print(".common %s,%d\n", p
->x
.name
, p
->type
->size
);
5091 print("%s:\n", p
->x
.name
);
5093 static void blkfetch(k
, off
, reg
, tmp
)
5094 int k
, off
, reg
, tmp
; {
5095 assert(k
== 1 || k
== 2 || k
== 4);
5096 assert(salign
>= k
);
5098 print("ldub [%%r%d+%d],%%r%d\n", reg
, off
, tmp
);
5100 print("lduh [%%r%d+%d],%%r%d\n", reg
, off
, tmp
);
5102 print("ld [%%r%d+%d],%%r%d\n", reg
, off
, tmp
);
5104 static void blkstore(k
, off
, reg
, tmp
)
5105 int k
, off
, reg
, tmp
; {
5106 assert(k
== 1 || k
== 2 || k
== 4);
5107 assert(dalign
>= k
);
5109 print("stb %%r%d,[%%r%d+%d]\n", tmp
, reg
, off
);
5111 print("sth %%r%d,[%%r%d+%d]\n", tmp
, reg
, off
);
5113 print("st %%r%d,[%%r%d+%d]\n", tmp
, reg
, off
);
5115 static void blkloop(dreg
, doff
, sreg
, soff
, size
, tmps
)
5116 int dreg
, doff
, sreg
, soff
, size
, tmps
[]; {
5117 if ((size
&~7) < 4096) {
5118 print("add %%r%d,%d,%%r%d\n", sreg
, size
&~7, sreg
);
5119 print("add %%r%d,%d,%%r%d\n", dreg
, size
&~7, tmps
[2]);
5121 print("set %d,%%r%d\n", size
&~7, tmps
[2]);
5122 print("add %%r%d,%%r%d,%%r%d\n", sreg
, tmps
[2], sreg
);
5123 print("add %%r%d,%%r%d,%%r%d\n", dreg
, tmps
[2], tmps
[2]);
5125 blkcopy(tmps
[2], doff
, sreg
, soff
, size
&7, tmps
);
5126 print("1: dec 8,%%r%d\n", tmps
[2]);
5127 blkcopy(tmps
[2], doff
, sreg
, soff
- 8, 8, tmps
);
5128 print("cmp %%r%d,%%r%d; ", tmps
[2], dreg
);
5130 print("dec 8,%%r%d\n", sreg
);
5132 static void defsymbol2(p
) Symbol p
; {
5133 if (p
->scope
>= LOCAL
&& p
->sclass
== STATIC
)
5134 p
->x
.name
= stringf(".%d", genlabel(1));
5136 assert(p
->scope
!= CONSTANTS
|| isint(p
->type
) || isptr(p
->type
)),
5137 p
->x
.name
= p
->name
;
5138 if (p
->scope
>= LABELS
)
5139 p
->x
.name
= stringf(p
->generated
? ".L%s" : "%s",
5143 static void global2(p
) Symbol p
; {
5145 if (p
->sclass
!= STATIC
&& !p
->generated
)
5146 print(".type %s,#%s\n", p
->x
.name
,
5147 isfunc(p
->type
) ? "function" : "object");
5148 if (p
->u
.seg
== BSS
&& p
->sclass
== STATIC
)
5149 print(".local %s\n.common %s,%d,%d\n", p
->x
.name
, p
->x
.name
,
5150 p
->type
->size
, p
->type
->align
);
5151 else if (p
->u
.seg
== BSS
&& Aflag
>= 2)
5152 print(".align %d\n%s:.skip %d\n", p
->type
->align
, p
->x
.name
,
5154 else if (p
->u
.seg
== BSS
)
5155 print(".common %s,%d,%d\n", p
->x
.name
, p
->type
->size
, p
->type
->align
);
5157 print(".align %d\n%s:\n", p
->type
->align
, p
->x
.name
);
5160 static void segment2(n
) int n
; {
5163 case CODE
: print(".section \".text\"\n"); break;
5164 case BSS
: print(".section \".bss\"\n"); break;
5165 case DATA
: print(".section \".data\"\n"); break;
5166 case LIT
: print(".section \".rodata\"\n"); break;
5171 static char *currentfile
; /* current file name */
5174 static void stabblock
ARGS((int, int, Symbol
*));
5175 static void stabfend
ARGS((Symbol
, int));
5176 static void stabinit
ARGS((char *, int, char *[]));
5177 static void stabline
ARGS((Coordinate
*));
5178 static void stabsym
ARGS((Symbol
));
5179 static void stabtype
ARGS((Symbol
));
5181 static void asgncode
ARGS((Type
, int));
5182 static void dbxout
ARGS((Type
));
5183 static int dbxtype
ARGS((Type
));
5184 static int emittype
ARGS((Type
, int, int));
5186 /* asgncode - assign type code to ty */
5187 static void asgncode(ty
, lev
) Type ty
; int lev
; {
5188 if (ty
->x
.marked
|| ty
->x
.typeno
)
5192 case VOLATILE
: case CONST
: case VOLATILE
+CONST
:
5193 asgncode(ty
->type
, lev
);
5194 ty
->x
.typeno
= ty
->type
->x
.typeno
;
5196 case POINTER
: case FUNCTION
: case ARRAY
:
5197 asgncode(ty
->type
, lev
+ 1);
5199 case VOID
: case CHAR
: case SHORT
: case INT
: case UNSIGNED
:
5200 case FLOAT
: case DOUBLE
:
5202 case STRUCT
: case UNION
: {
5204 for (p
= fieldlist(ty
); p
; p
= p
->link
)
5205 asgncode(p
->type
, lev
+ 1);
5208 if (ty
->x
.typeno
== 0)
5209 ty
->x
.typeno
= ++ntypes
;
5210 if (lev
> 0 && (*ty
->u
.sym
->name
< '0' || *ty
->u
.sym
->name
> '9'))
5219 /* dbxout - output .stabs entry for type ty */
5220 static void dbxout(ty
) Type ty
; {
5222 if (!ty
->x
.printed
) {
5224 print(".stabs \""), col
+= 8;
5225 if (ty
->u
.sym
&& !(isfunc(ty
) || isarray(ty
) || isptr(ty
)))
5226 print("%s", ty
->u
.sym
->name
), col
+= strlen(ty
->u
.sym
->name
);
5227 print(":%c", isstruct(ty
) || isenum(ty
) ? 'T' : 't'), col
+= 2;
5228 emittype(ty
, 0, col
);
5229 print("\",%d,0,0,0\n", N_LSYM
);
5233 /* dbxtype - emit a stabs entry for type ty, return type code */
5234 static int dbxtype(ty
) Type ty
; {
5237 return ty
->x
.typeno
;
5241 * emittype - emit ty's type number, emitting its definition if necessary.
5242 * Returns the output column number after emission; col is the approximate
5243 * output column before emission and is used to emit continuation lines for long
5244 * struct, union, and enum types. Continuations are not emitted for other types,
5245 * even if the definition is long. lev is the depth of calls to emittype.
5247 static int emittype(ty
, lev
, col
) Type ty
; int lev
, col
; {
5248 int tc
= ty
->x
.typeno
;
5250 if (isconst(ty
) || isvolatile(ty
)) {
5251 col
= emittype(ty
->type
, lev
, col
);
5252 ty
->x
.typeno
= ty
->type
->x
.typeno
;
5257 ty
->x
.typeno
= tc
= ++ntypes
;
5258 /* fprint(2,"`%t'=%d\n", ty, tc); */
5260 print("%d", tc
), col
+= 3;
5265 case VOID
: /* void is defined as itself */
5266 print("=%d", tc
), col
+= 1+3;
5268 case CHAR
: /* unsigned char is a subrange of int */
5269 if (ty
== unsignedchar
)
5270 print("=r1;0;255;"), col
+= 10;
5271 else /* following pcc, char is a subrange of itself */
5272 print("=r%d;-128;127;", tc
), col
+= 2+3+10;
5274 case SHORT
: /* short is a subrange of int */
5275 if (ty
== unsignedshort
)
5276 print("=r1;0;65535;"), col
+= 12;
5278 print("=r1;-32768;32767;"), col
+= 17;
5280 case INT
: /* int is a subrange of itself */
5281 print("=r1;%d;%d;", INT_MIN
, INT_MAX
), col
+= 4+11+1+10+1;
5283 case UNSIGNED
: /* unsigned is a subrange of int */
5284 print("=r1;0;-1;"), col
+= 9;
5286 case FLOAT
: case DOUBLE
: /* float, double get sizes instead of ranges */
5287 print("=r1;%d;0;", ty
->size
), col
+= 4+1+3;
5290 print("=*"), col
+= 2;
5291 col
= emittype(ty
->type
, lev
+ 1, col
);
5294 print("=f"), col
+= 2;
5295 col
= emittype(ty
->type
, lev
+ 1, col
);
5297 case ARRAY
: /* array includes subscript as an int range */
5298 if (ty
->size
&& ty
->type
->size
)
5299 print("=ar1;0;%d;", ty
->size
/ty
->type
->size
- 1), col
+= 7+3+1;
5301 print("=ar1;0;-1;"), col
+= 10;
5302 col
= emittype(ty
->type
, lev
+ 1, col
);
5304 case STRUCT
: case UNION
: {
5306 if (!ty
->u
.sym
->defined
) {
5307 print("=x%c%s:", ty
->op
== STRUCT
? 's' : 'u', ty
->u
.sym
->name
);
5308 col
+= 2+1+strlen(ty
->u
.sym
->name
)+1;
5311 if (lev
> 0 && (*ty
->u
.sym
->name
< '0' || *ty
->u
.sym
->name
> '9')) {
5315 print("=%c%d", ty
->op
== STRUCT
? 's' : 'u', ty
->size
), col
+= 1+1+3;
5316 for (p
= fieldlist(ty
); p
; p
= p
->link
) {
5318 print("%s:", p
->name
), col
+= strlen(p
->name
)+1;
5320 print(":"), col
+= 1;
5321 col
= emittype(p
->type
, lev
+ 1, col
);
5323 print(",%d,%d;", 8*p
->offset
+
5324 (IR
->little_endian
? fieldright(p
) : fieldleft(p
)),
5327 print(",%d,%d;", 8*p
->offset
, 8*p
->type
->size
);
5328 col
+= 1+3+1+3+1; /* accounts for ,%d,%d; */
5329 if (col
>= 80 && p
->link
) {
5330 print("\\\\\",%d,0,0,0\n.stabs \"", N_LSYM
);
5334 print(";"), col
+= 1;
5339 if (lev
> 0 && (*ty
->u
.sym
->name
< '0' || *ty
->u
.sym
->name
> '9')) {
5343 print("=e"), col
+= 2;
5344 for (p
= ty
->u
.sym
->u
.idlist
; *p
; p
++) {
5345 print("%s:%d,", (*p
)->name
, (*p
)->u
.value
), col
+= strlen((*p
)->name
)+3;
5346 if (col
>= 80 && p
[1]) {
5347 print("\\\\\",%d,0,0,0\n.stabs \"", N_LSYM
);
5351 print(";"), col
+= 1;
5360 /* stabblock - output a stab entry for '{' or '}' at level lev */
5361 static void stabblock(brace
, lev
, p
) int brace
, lev
; Symbol
*p
; {
5365 print(".stabd 0x%x,0,%d\n", brace
== '{' ? N_LBRAC
: N_RBRAC
, lev
);
5368 /* stabfend - end of function p */
5369 static void stabfend(p
, line
) Symbol p
; int line
; {}
5371 /* stabinit - initialize stab output */
5372 static void stabinit(file
, argc
, argv
) int argc
; char *file
, *argv
[]; {
5373 typedef void (*Closure
) ARGS((Symbol
, void *));
5375 if (file
&& *file
) {
5376 (*IR
->segment
)(CODE
);
5377 print("Ltext:.stabs \"%s\",0x%x,0,0,Ltext\n", file
, N_SO
);
5382 dbxtype(doubletype
);
5384 dbxtype(longdouble
);
5387 dbxtype(signedchar
);
5388 dbxtype(unsignedchar
);
5389 dbxtype(unsignedlong
);
5390 dbxtype(unsignedshort
);
5391 dbxtype(unsignedtype
);
5393 foreach(types
, GLOBAL
, (Closure
)stabtype
, NULL
);
5396 /* stabline - emit stab entry for source coordinate *cp */
5397 static void stabline(cp
) Coordinate
*cp
; {
5398 if (cp
->file
&& cp
->file
!= currentfile
) {
5399 int lab
= genlabel(1);
5400 print("L%d: .stabs \"%s\",0x%x,0,0,L%d\n", lab
,
5401 cp
->file
, N_SOL
, lab
);
5402 currentfile
= cp
->file
;
5404 print(".stabd 0x%x,0,%d\n", N_SLINE
, cp
->y
);
5407 /* stabsym - output a stab entry for symbol p */
5408 static void stabsym(p
) Symbol p
; {
5409 int code
, tc
, sz
= p
->type
->size
;
5411 if (p
->generated
|| p
->computed
)
5413 if (isfunc(p
->type
)) {
5414 print(".stabs \"%s:%c%d\",%d,0,0,%s\n", p
->name
,
5415 p
->sclass
== STATIC
? 'f' : 'F', dbxtype(freturn(p
->type
)),
5419 if (!IR
->wants_argb
&& p
->scope
== PARAM
&& p
->structarg
) {
5420 assert(isptr(p
->type
) && isstruct(p
->type
->type
));
5421 tc
= dbxtype(p
->type
->type
);
5422 sz
= p
->type
->type
->size
;
5424 tc
= dbxtype(p
->type
);
5425 if (p
->sclass
== AUTO
&& p
->scope
== GLOBAL
|| p
->sclass
== EXTERN
) {
5426 print(".stabs \"%s:G", p
->name
);
5428 } else if (p
->sclass
== STATIC
) {
5429 print(".stabs \"%s:%c%d\",%d,0,0,%s\n", p
->name
, p
->scope
== GLOBAL
? 'S' : 'V',
5430 tc
, p
->u
.seg
== BSS
? N_LCSYM
: N_STSYM
, p
->x
.name
);
5432 } else if (p
->sclass
== REGISTER
) {
5433 if (p
->scope
> PARAM
) {
5434 int r
= p
->x
.regnode
->number
;
5435 if (p
->x
.regnode
->set
== FREG
)
5436 r
+= 32; /* floating point */
5437 print(".stabs \"%s:r%d\",%d,0,", p
->name
, tc
, N_RSYM
);
5438 print("%d,%d\n", sz
, r
);
5441 } else if (p
->scope
== PARAM
) {
5442 print(".stabs \"%s:p", p
->name
);
5444 } else if (p
->scope
>= LOCAL
) {
5445 print(".stabs \"%s:", p
->name
);
5449 print("%d\",%d,0,0,%s\n", tc
, code
,
5450 p
->scope
>= PARAM
&& p
->sclass
!= EXTERN
? p
->x
.name
: "0");
5453 /* stabtype - output a stab entry for type *p */
5454 static void stabtype(p
) Symbol p
; {
5458 else if (p
->sclass
== TYPEDEF
)
5459 print(".stabs \"%s:t%d\",%d,0,0,0\n", p
->name
, dbxtype(p
->type
), N_LSYM
);
5469 Interface sparcIR
= {
5471 2, 2, 0, /* short */
5473 4, 4, 1, /* float */
5474 8, 8, 1, /* double */
5476 0, 1, 0, /* struct */
5477 0, /* little_endian */
5478 1, /* mulops_calls */
5479 1, /* wants_callb */
5481 1, /* left_to_right */
5501 stabblock
, 0, 0, stabinit
, stabline
, stabsym
, stabtype
,
5503 1, /* max_unaligned_load */
5504 blkfetch
, blkstore
, blkloop
,
5523 Interface solarisIR
= {
5525 2, 2, 0, /* short */
5527 4, 4, 1, /* float */
5528 8, 8, 1, /* double */
5530 0, 1, 0, /* struct */
5531 0, /* little_endian */
5532 1, /* mulops_calls */
5533 1, /* wants_callb */
5535 1, /* left_to_right */
5555 stabblock
, 0, 0, stabinit
, stabline
, stabsym
, stabtype
,
5557 1, /* max_unaligned_load */
5558 blkfetch
, blkstore
, blkloop
,