Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.220
 
1.221
 
MAIN:ragge:20080420094138
 
reader.c
_>486486 
 487487         case XARG:
 488488                 /* generate code for correct class here */
<>489 -                geninsn(p->n_left, 1 << p->n_label);
  489+//              geninsn(p->n_left, 1 << p->n_label);
490490                 break;
 491491 
 492492         default:
     
 !
614614         putchar('\t');
 615615         while (*w != 0) {
 616616                 if (*w == '%') {
<>617 -                        if (w[1] < '1' || w[1] > (n + '0'))
  617+                        if (w[1] < '0' || w[1] > (n + '0'))
618618                                 uerror("bad xasm arg number");
 619619                         else
<>620 -                                adrput(stdout, nary[(int)w[1]-'1']->n_left);
  620+                                adrput(stdout, nary[(int)w[1]-'0']->n_left);
621621                         w++;
 622622                 } else
 623623                         putchar(*w);
     
 !
11921192 }
 11931193 
 11941194 /*
<> 1195+ * change numeric argument redirections to the correct node type after
  1196+ * cleaning up the other nodes.
  1197+ */
  1198+static void
  1199+delnums(NODE *p, void *arg)
  1200+{
  1201+        NODE *r = arg;
  1202+        NODE *q;
  1203+        char *c;
  1204+        int cnt;
  1205+
  1206+        if (p->n_name[0] < '0' || p->n_name[0] > '9')
  1207+                return; /* not numeric */
  1208+        if ((q = listarg(r, p->n_name[0] - '0', &cnt)) == NIL)
  1209+                comperr("bad delnums");
  1210+        tfree(p->n_left);
  1211+        p->n_left = tcopy(q->n_left);
  1212+        c = q->n_name;
  1213+        if (*c == '=')
  1214+                c++;
  1215+        p->n_name = c; /* Replace node type */
  1216+}
  1217+
  1218+/*
11951219  * Ensure that a node is correct for the destination.
 11961220  */
 11971221 static void
<>1198 -ltypify(struct interpass *ip, NODE *p)
  1222+ltypify(NODE *p, void *arg)
11991223 {
<> 1224+        struct interpass *ip = arg;
12001225         struct interpass *ip2;
 12011226         TWORD t = p->n_left->n_type;
 12021227         NODE *q, *r;
 12031228         char *w;
<>1204 -//      int asg = 0, and = 0;
  1229+        int asg = 0;
12051230 
 12061231 #ifdef notyet
 12071232         if (myxasm(ip, p))
 12081233                 return/* handled by target-specific code */
 12091234 #endif
<> 1235+
12101236         w = p->n_name;
<>1211 -//      if (*w == '=')
 1212 -//              w++, asg = 1;
  1237+        if (*w == '=')
  1238+                w++, asg++;
12131239         switch (*w) {
 12141240         case 'r': /* general reg */
 12151241                 /* set register class */
 12161242                 p->n_label = gclass(p->n_left->n_type);
<>1217 -                if (optype(p->n_left->n_op) == LTYPE)
  1243+                if (p->n_left->n_op == REG || p->n_left->n_op == TEMP)
12181244                         break;
 12191245                 q = mklnode(TEMP, 0, epp->ip_tmpnum++, t);
 12201246                 r = tcopy(q);
<>1221 -                ip2 = ipnode(mkbinode(ASSIGN, q, p->n_left, t));
 1222 -                DLIST_INSERT_BEFORE(ip, ip2, qelem);
  1247+                if (asg) {
  1248+                        ip2 = ipnode(mkbinode(ASSIGN, p->n_left, q, t));
  1249+                        DLIST_INSERT_AFTER(ip, ip2, qelem);
  1250+                } else {
  1251+                        ip2 = ipnode(mkbinode(ASSIGN, q, p->n_left, t));
  1252+                        DLIST_INSERT_BEFORE(ip, ip2, qelem);
  1253+                }
12231254                 p->n_left = r;
 12241255                 break;
<> 1256+
  1257+        case '0': case '1': case '2': case '3': case '4':
  1258+        case '5': case '6': case '7': case '8': case '9':
  1259+                break;
  1260+
12251261         default:
 12261262                 uerror("unsupported xasm option string '%s'", p->n_name);
 12271263         }
<>1228 -                        
 1229 -
 1230 -//      fwalk(p, e2print, 0);
12311264 }
 12321265 
 12331266 /* Extended assembler hacks */
     
 !
12401273         DLIST_FOREACH(ip, ipole, qelem) {
 12411274                 if (ip->type != IP_NODE || ip->ip_node->n_op != XASM)
 12421275                         continue;
<>1243 -                /* Got an assembler node */
12441276                 p = ip->ip_node->n_left;
 12451277 
<> 1278+                /* replace numeric redirections with its underlying type */
  1279+                flist(p, delnums, p);
12461280                 /*
 12471281                  * Ensure that the arg nodes can be directly addressable
 12481282                  * We decide that everything shall be LTYPE here.
 12491283                  */
<>1250 -                for (; p->n_op == CM; p = p->n_left)
 1251 -                        ltypify(ip, p->n_right);
 1252 -                ltypify(ip, p);
  1284+                flist(p, ltypify, ip);
  1285+
  1286+
<_12531287                 p = ip->ip_node->n_right;
 12541288                 if (p->n_op != ICON || p->n_type != STRTY)
 12551289                         uerror("xasm constraints not supported");
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-29 07:16 +0200