Quick Search:

Mode

Context

Displaying the whole file. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.17
 
1.18
 
MAIN:ragge:20110705200419
 
local2.c
_>11 /*      $Id$    */
 22 /*
 33  * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
 44  *
 55  * Redistribution and use in source and binary forms, with or without
 66  * modification, are permitted provided that the following conditions
 77  * are met:
 88  *
 99  * Redistributions of source code and documentation must retain the above
 1010  * copyright notice, this list of conditions and the following disclaimer.
 1111  * Redistributions in binary form must reproduce the above copyright
 1212  * notice, this list of conditionsand the following disclaimer in the
 1313  * documentation and/or other materials provided with the distribution.
 1414  * All advertising materials mentioning features or use of this software
 1515  * must display the following acknowledgement:
 1616  *      This product includes software developed or owned by Caldera
 1717  *      International, Inc.
 1818  * Neither the name of Caldera International, Inc. nor the names of other
 1919  * contributors may be used to endorse or promote products derived from
 2020  * this software without specific prior written permission.
 2121  *
 2222  * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
 2323  * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
 2424  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 2525  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 2626  * DISCLAIMED.  IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
 2727  * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 2828  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 2929  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 3030  * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT,
 3131  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 3232  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 3333  * POSSIBILITY OF SUCH DAMAGE.
 3434  */
 3535 
 3636 # include "pass2.h"
 3737 # include "ctype.h"
 3838 /* a lot of the machine dependent parts of the second pass */
 3939 
 4040 static void prtype(NODE *n);
 4141 static void acon(NODE *p);
 4242 
 4343 /*
 4444  * Print out the prolog assembler.
 4545  * addto and regoff are already calculated.
 4646  */
 4747 void
 4848 prologue(struct interpass_prolog *ipp)
 4949 {
 5050         printf("        .word 0x%llx\n", (unsigned long long)ipp->ipp_regs[0]);
 5151         if (p2maxautooff)
 5252                 printf("        subl2 $%d,%%sp\n", p2maxautooff);
 5353 }
 5454 
 5555 /*
 5656  * Called after all instructions in a function are emitted.
 5757  * Generates code for epilog here.
 5858  */
 5959 void
 6060 eoftn(struct interpass_prolog *ipp)
 6161 {
 6262         if (ipp->ipp_ip.ip_lbl == 0)
 6363                 return; /* no code needs to be generated */
 6464         printf("        ret\n");
 6565 }
 6666 
 6767 struct hoptab { int opmask; char * opstring; } ioptab[] = {
 6868 
 6969         { PLUS"add", },
 7070         { MINUS,        "sub", },
 7171         { MUL,  "mul", },
 7272         { DIV,  "div", },
 7373         { OR,   "bis", },
 7474         { ER,   "xor", },
 7575         { AND,  "bic", },
 7676         { -1, ""     },
 7777 };
 7878 
 7979 void
 8080 hopcode( f, o ){
 8181         /* output the appropriate string from the above table */
 8282 
 8383         register struct hoptab *q;
 8484 
 8585         for( q = ioptabq->opmask>=0; ++q ){
 8686                 if( q->opmask == o ){
 8787                         printf( "%s", q->opstring );
 8888 /* tbl
 8989                         if( f == 'F' ) printf( "e" );
 9090                         else if( f == 'D' ) printf( "d" );
 9191    tbl */
 9292 /* tbl */
 9393                         switch( f ) {
 9494                                 case 'L':
 9595                                 case 'W':
 9696                                 case 'B':
 9797                                 case 'D':
 9898                                 case 'F':
 9999                                         printf("%c", tolower(f));
 100100                                         break;
 101101 
 102102                                 }
 103103 /* tbl */
 104104                         return;
 105105                         }
 106106                 }
 107107         cerror( "no hoptab for %s", opst[o] );
 108108         }
 109109 
 110110 char *
 111111 rnames[] = {  /* keyed to register number tokens */
 112112 
 113113         "%r0", "%r1", "%r2", "%r3", "%r4", "%r5",
 114114         "%r6", "%r7", "%r8", "%r9", "%r10", "%r11",
 115115         "%ap", "%fp", "%sp", "%pc",
 116116         /* The concatenated regs has the name of the lowest */
 117117         "%r0", "%r1", "%r2", "%r3", "%r4", "%r5",
 118118         "%r6", "%r7", "%r8", "%r9", "%r10"
 119119         };
 120120 
 121121 int
 122122 tlen(NODE *p)
 123123 {
 124124         switch(p->n_type) {
 125125         case CHAR:
 126126         case UCHAR:
 127127                 return(1);
 128128 
 129129         case SHORT:
 130130         case USHORT:
 131131                 return(2);
 132132 
 133133         case DOUBLE:
 134134         case LONGLONG:
 135135         case ULONGLONG:
 136136                 return(8);
 137137 
 138138         default:
 139139                 return(4);
 140140         }
 141141 }
 142142 
<>143 -static int
 144 -mixtypes(NODE *p, NODE *q)
 145 -{
 146 -        TWORD tp, tq;
 147 -
 148 -        tp = p->n_type;
 149 -        tq = q->n_type;
 150 -
 151 -        return( (tp==FLOAT || tp==DOUBLE) !=
 152 -                (tq==FLOAT || tq==DOUBLE) );
 153 -}
 154 -
155143 void
 156144 prtype(NODE *n)
 157145 {
 158146         static char pt[] = { 0, 0, 'b', 'b', 'w', 'w', 'l', 'l', 0, 0,
 159147             'q', 'q', 'f', 'd' };
 160148         TWORD t = n->n_type;
 161149 
 162150         if (ISPTR(t))
 163151                 t = UNSIGNED;
 164152 
 165153         if (t > DOUBLE || pt[t] == 0)
 166154                 comperr("prtype: bad type");
 167155         putchar(pt[t]);
 168156 }
 169157 
 170158 /*
 171159  * Emit conversions as given by the following table. Dest is always reg,
 172160  *   if it should be something else let peephole optimizer deal with it.
 173161  *   This code ensures type correctness in 32-bit registers.
 174162  *   XXX is that necessary?
 175163  *
 176164  * From                         To
 177165  *       char   uchar  short  ushort int    uint   ll    ull   float double
 178166  * char  movb   movb   cvtbw  cvtbw  cvtbl  cvtbl  A     A     cvtbf cvtbd
 179167  * uchar movb   movb   movzbw movzbw movzbl movzbl B     B     G     G
 180168  * short movb   movb   movw   movw   cvtwl  cvtwl  C(A)  C(A)  cvtwf cvtwd
 181169  * ushrt movb   movb   movw   movw   movzwl movzwl D(B)  D(B)  H     H
 182170  * int   movb   movb   movw   movw   movl   movl   E     E     cvtlf cvtld
 183171  * uint  movb   movb   movw   movw   movl   movl   F     F     I     I
 184172  * ll    movb   movb   movw   movw   movl   movl   movq  movq  J     K
 185173  * ull   movb   movb   movw   movw   movl   movl   movq  movq  L     M
 186174  * float cvtfb  cvtfb  cvtfw  cvtfw  cvtfl  cvtfl  N     O     movf  cvtfd
 187175  * doubl cvtdb  cvtdb  cvtdw  cvtdw  cvtdl  cvtdl  P     Q     cvtdf movd
 188176  *
 189177  *  A: cvtbl + sign extend
 190178  *  B: movzbl + zero extend
 191179  *  G: movzbw + cvtwX
 192180  *  H: movzwl + cvtwX
 193181  *  I: cvtld + addX
 194182  *  J: call __floatdisf
 195183  *  K: call __floatdidf
 196184  *  L: xxx + call __floatdisf
 197185  *  M: xxx + call __floatdidf
 198186  *  N: call __fixsfdi
 199187  *  O: call __fixunssfdi
 200188  *  P: call __fixdfdi
 201189  *  Q: call __fixunsdfdi
 202190  */
 203191 
 204192 #define MVD     1 /* mov + dest type */
 205193 #define CVT     2 /* cvt + src type + dst type */
 206194 #define MVZ     3 /* movz + src type + dst type */
 207195 #define CSE     4 /* cvt + src type + l + sign extend upper */
 208196 #define MZE     5 /* movz + src type + l + zero extend upper */
 209197 #define MLE     6 /* movl + sign extend upper */
 210198 #define MLZ     7 /* movl + zero extend upper */
 211199 #define MZC     8 /* movz + cvt */
 212200 
 213201 static char scary[][10] = {
 214202         { MVD, MVD, CVT, CVT, CVT, CVT, CSE, CSE, CVT, CVT },
 215203         { MVD, MVD, MVZ, MVZ, MVZ, MVZ, MZE, MZE, MZC, MZC },
 216204         { MVD, MVD, MVD, MVD, CVT, CVT, CSE, CSE, CVT, CVT },
 217205         { MVD, MVD, MVD, MVD, MVZ, MVZ, MZE, MZE, MZC, MZC },
 218206         { MVD, MVD, MVD, MVD, MVD, MVD, MLE, MLE, CVT, CVT },
 219207         { MVD, MVD, MVD, MVD, MVZ, MVZ, MLZ, MLZ, 'I', 'I' },
 220208         { MVD, MVD, MVD, MVD, MVD, MVD, MVD, MVD, 'J', 'K' },
 221209         { MVD, MVD, MVD, MVD, MVD, MVD, MVD, MVD, 'L', 'M' },
 222210         { CVT, CVT, CVT, CVT, CVT, CVT, 'N', 'O', MVD, CVT },
 223211         { CVT, CVT, CVT, CVT, CVT, CVT, 'P', 'Q', CVT, MVD },
 224212 };
 225213 
 226214 static void
 227215 sconv(NODE *p)
 228216 {
 229217         NODE *l = p->n_left;
 230218         TWORD ts, td;
 231219         int o;
 232220 
 233221         /*
 234222          * Source node may be in register or memory.
 235223          * Result is always in register.
 236224          */
 237225         ts = l->n_type;
 238226         if (ISPTR(ts))
 239227                 ts = UNSIGNED;
 240228         td = p->n_type;
 241229         ts = ts < LONG ? ts-2 : ts-4;
 242230         td = td < LONG ? td-2 : td-4;
 243231 
 244232         o = scary[ts][td];
 245233         switch (o) {
 246234         case MLE:
 247235         case MLZ:
 248236         case MVD:
 249237                 expand(p, INAREG|INBREG, "\tmovZL AL,A1\n");
 250238                 break;
 251239 
 252240         case CSE:
 253241                 expand(p, INAREG|INBREG, "\tcvtZLl AL,A1\n");
 254242                 break;
 255243 
 256244         case CVT:
 257245                 expand(p, INAREG|INBREG, "\tcvtZLZR AL,A1\n");
 258246                 break;
 259247 
 260248         case MZE:
 261249                 expand(p, INAREG|INBREG, "\tmovzZLl AL,A1\n");
 262250                 break;
 263251 
 264252         case MVZ:
 265253                 expand(p, INAREG|INBREG, "\tmovzZLZR AL,A1\n");
 266254                 break;
 267255 
 268256         case MZC:
 269257                 expand(p, INAREG|INBREG, "\tmovzZLl AL,A1\n");
 270258                 expand(p, INAREG|INBREG, "\tcvtlZR A1,A1\n");
 271259                 break;
 272260 
 273261         default:
 274262                 comperr("unsupported conversion %d", o);
 275263         }
 276264         switch (o) {
 277265         case MLE:
 278266         case CSE:
 279267                 expand(p, INBREG, "\tashl $-31,A1,U1\n");
 280268                 break;
 281269         case MLZ:
 282270         case MZE:
 283271                 expand(p, INAREG|INBREG, "\tclrl U1\n");
 284272                 break;
 285273         }
 286274 }
 287275 
 288276 /*
<> 277+ * Assign a constant from p to q.  Both are expected to be leaves by now.
  278+ * This is for 64-bit integers.
  279+ */
  280+static void
  281+casg64(NODE *p)
  282+{
  283+        NODE *l, *r;
  284+        char *str;
  285+        int mneg = 1;
  286+        
  287+        l = p->n_left;
  288+        r = p->n_right;
  289+
  290+#ifdef PCC_DEBUG
  291+        if (r->n_op != ICON)
  292+                comperr("casg");
  293+#endif
  294+        if (r->n_name[0] != '\0') {
  295+                /* named constant, nothing to do */
  296+                str = "movq\tAR,AL";
  297+                mneg = 0;
  298+        } else if (r->n_lval == 0) {
  299+                str = "clrq\tAL";
  300+                mneg = 0;
  301+        } else if (r->n_lval < 0) {
  302+                if (r->n_lval >= -63) {
  303+                        r->n_lval = -r->n_lval;
  304+                        str = "mnegl\tAR,AL";
  305+                } else if (r->n_lval >= -128) {
  306+                        str = "cvtbl\tAR,AL";
  307+                } else if (r->n_lval >= -32768) {
  308+                        str = "cvtwl\tAR,AL";
  309+                } else if (r->n_lval >= -4294967296LL) {
  310+                        str = "movl\tAR,AL";
  311+                } else {
  312+                        str = "movq\tAR,AL";
  313+                        mneg = 0;
  314+                }
  315+        } else {
  316+                mneg = 0;
  317+                if (r->n_lval <= 63 || r->n_lval > 4294967295) {
  318+                        str = "movq\tAR,AL";
  319+                } else if (r->n_lval <= 255) {
  320+                        str = "movzbl\tAR,AL\n\tclrl\tUL";
  321+                } else if (r->n_lval <= 65535) {
  322+                        str = "movzwl\tAR,AL\n\tclrl\tUL";
  323+                } else /* if (r->n_lval <= 4294967295) */ {
  324+                        str = "movl\tAR,AL\n\tclrl\tUL";
  325+                }
  326+        }
  327+        expand(p, FOREFF, str);
  328+        if (mneg)
  329+                expand(p, FOREFF, "\tmnegl $-1,UL\n");
  330+}
  331+
  332+/*
  333+ * Assign a constant from p to q.  Both are expected to be leaves by now.
  334+ * This is only for 32-bit integer types.
  335+ */
  336+static void
  337+casg(NODE *p)
  338+{
  339+        NODE *l, *r;
  340+        char *str;
  341+        
  342+        l = p->n_left;
  343+        r = p->n_right;
  344+
  345+#ifdef PCC_DEBUG
  346+        if (r->n_op != ICON)
  347+                comperr("casg");
  348+#endif
  349+        if (r->n_name[0] != '\0') {
  350+                /* named constant, nothing to do */
  351+                str = "movZL\tAR,AL";
  352+        } else if (r->n_lval == 0) {
  353+                str = "clrZL\tAL";
  354+        } else if (r->n_lval < 0) {
  355+                if (r->n_lval >= -63) {
  356+                        r->n_lval = -r->n_lval;
  357+                        str = "mnegZL\tAR,AL";
  358+                } else if (r->n_lval >= -128) {
  359+                        str = "cvtbZL\tAR,AL";
  360+                } else if (r->n_lval >= -32768) {
  361+                        str = "cvtwZL\tAR,AL";
  362+                } else
  363+                        str = "movZL\tAR,AL";
  364+        } else {
  365+                if (r->n_lval <= 63 || r->n_lval > 65535) {
  366+                        str = "movZL\tAR,AL";
  367+                } else if (r->n_lval <= 255) {
  368+                        str = "movzbZL\tAR,AL";
  369+                } else /* if (r->n_lval <= 65535) */ {
  370+                        str = "movzwZL\tAR,AL";
  371+                }
  372+        }
  373+        expand(p, FOREFF, str);
  374+}
  375+
  376+/*
289377  * Emit code to compare two longlong numbers.
 290378  */
 291379 static void
 292380 twollcomp(NODE *p)
 293381 {
 294382         int u;
 295383         int s = getlab2();
 296384         int e = p->n_label;
 297385         int cb1, cb2;
 298386 
 299387         u = p->n_op;
 300388         switch (p->n_op) {
 301389         case NE:
 302390                 cb1 = 0;
 303391                 cb2 = NE;
 304392                 break;
 305393         case EQ:
 306394                 cb1 = NE;
 307395                 cb2 = 0;
 308396                 break;
 309397         case LE:
 310398         case LT:
 311399                 u += (ULE-LE);
 312400                 /* FALLTHROUGH */
 313401         case ULE:
 314402         case ULT:
 315403                 cb1 = GT;
 316404                 cb2 = LT;
 317405                 break;
 318406         case GE:
 319407         case GT:
 320408                 u += (ULE-LE);
 321409                 /* FALLTHROUGH */
 322410         case UGE:
 323411         case UGT:
 324412                 cb1 = LT;
 325413                 cb2 = GT;
 326414                 break;
 327415         
 328416         default:
 329417                 cb1 = cb2 = 0; /* XXX gcc */
 330418         }
 331419         if (p->n_op >= ULE)
 332420                 cb1 += 4, cb2 += 4;
 333421         expand(p, 0, "  cmpl UR,UL\n");
 334422         if (cb1) cbgen(cb1, s);
 335423         if (cb2) cbgen(cb2, e);
 336424         expand(p, 0, "  cmpl AL,AR\n");
 337425         cbgen(u, e);
 338426         deflab(s);
 339427 }
 340428 
 341429 
 342430 void
<>343 -zzzcode( p, c ) register NODE *p; {
  431+zzzcode(NODE *p, int c)
  432+{
  433+        NODE *l, *r;
344434         int m;
<>345 -        int val;
346435         char *ch;
<>347 -        switch( c ){
348436 
<> 437+        switch (c) {
349438         case 'N'/* logical ops, turned into 0-1 */
 350439                 /* use register given by register 1 */
 351440                 cbgen( 0, m=getlab2());
 352441                 deflab( p->n_label );
 353442                 printf( "       clrl    %s\n", rnames[getlr( p, '1' )->n_rval] );
 354443                 deflab( m );
 355444                 return;
 356445 
<>357 -        case 'A':
 358 -                {
 359 -                register NODE *l, *r;
 360 -
 361 -                if (xdebug) e2print(p, 0, &val, &val);
 362 -                r = getlr(p, 'R');
 363 -                if (optype(p->n_op) == LTYPE || p->n_op == UMUL) {
 364 -                        l = resc;
 365 -                        l->n_type = (r->n_type==FLOAT || r->n_type==DOUBLE ? DOUBLE : INT);
 366 -                } else
 367 -                        l = getlr(p, 'L');
 368 -                if (r->n_op == ICON  && r->n_name[0] == '\0') {
 369 -                        if (r->n_lval == 0) {
 370 -                                printf("clr");
 371 -                                prtype(l);
 372 -                                printf("        ");
 373 -                                adrput(stdout, l);
 374 -                                return;
 375 -                        }
 376 -                        if (r->n_lval < 0 && r->n_lval >= -63) {
 377 -                                printf("mneg");
 378 -                                prtype(l);
 379 -                                r->n_lval = -r->n_lval;
 380 -                                goto ops;
 381 -                        }
 382 -                        r->n_type = (r->n_lval < 0 ?
 383 -                                        (r->n_lval >= -128 ? CHAR
 384 -                                        : (r->n_lval >= -32768 ? SHORT
 385 -                                        : INT )) : r->n_type);
 386 -                        r->n_type = (r->n_lval >= 0 ?
 387 -                                        (r->n_lval <= 63 ? INT
 388 -                                        : ( r->n_lval <= 127 ? CHAR
 389 -                                        : (r->n_lval <= 255 ? UCHAR
 390 -                                        : (r->n_lval <= 32767 ? SHORT
 391 -                                        : (r->n_lval <= 65535 ? USHORT
 392 -                                        : INT ))))) : r->n_type );
 393 -                        }
 394 -                if (l->n_op == REG && l->n_type != FLOAT && l->n_type != DOUBLE)
 395 -                        l->n_type = INT;
 396 -                if (!mixtypes(l,r))
 397 -                        {
 398 -                        if (tlen(l) == tlen(r))
 399 -                                {
 400 -                                printf("mov");
 401 -                                prtype(l);
 402 -                                goto ops;
 403 -                                }
 404 -                        else if (tlen(l) > tlen(r) && ISUNSIGNED(r->n_type))
 405 -                                {
 406 -                                printf("movz");
 407 -                                }
 408 -                        else
 409 -                                {
 410 -                                printf("cvt");
 411 -                                }
 412 -                        }
  446+        case 'A': /* Assign a constant directly to a memory position */
  447+                printf("\t");
  448+                if (p->n_type < LONG || ISPTR(p->n_type))
  449+                        casg(p);
413450                 else
<>414 -                        {
 415 -                        printf("cvt");
 416 -                        }
 417 -                prtype(r);
 418 -                prtype(l);
 419 -        ops:
 420 -                printf("        ");
 421 -                adrput(stdout, r);
 422 -                printf(",");
 423 -                adrput(stdout, l);
 424 -                return;
 425 -                }
  451+                        casg64(p);
  452+                printf("\n");
  453+                break;
426454 
 427455         case 'B': /* long long compare */
 428456                 twollcomp(p);
 429457                 break;
 430458 
 431459         case 'C':       /* num words pushed on arg stack */
 432460                 printf("$%d", p->n_qual);
 433461                 break;
 434462 
 435463         case 'D':       /* INCR and DECR */
 436464                 zzzcode(p->n_left, 'A');
 437465                 printf("\n      ");
 438466 
 439467 #if 0
 440468         case 'E':       /* INCR and DECR, FOREFF */
 441469                 if (p->n_right->n_lval == 1)
 442470                         {
 443471                         printf("%s", (p->n_op == INCR ? "inc" : "dec") );
 444472                         prtype(p->n_left);
 445473                         printf("        ");
 446474                         adrput(stdout, p->n_left);
 447475                         return;
 448476                         }
 449477                 printf("%s", (p->n_op == INCR ? "add" : "sub") );
 450478                 prtype(p->n_left);
 451479                 printf("2       ");
 452480                 adrput(stdout, p->n_right);
 453481                 printf(",");
 454482                 adrput(p->n_left);
 455483                 return;
 456484 #endif
 457485 
 458486         case 'F':       /* register type of right operand */
 459487                 {
 460488                 register NODE *n;
 461489                 extern int xdebug;
 462490                 register int ty;
 463491 
 464492                 n = getlr( p, 'R' );
 465493                 ty = n->n_type;
 466494 
 467495                 if (xdebug) printf("->%d<-", ty);
 468496 
 469497                 if ( ty==DOUBLE) printf("d");
 470498                 else if ( ty==FLOAT ) printf("f");
 471499                 else printf("l");
 472500                 return;
 473501                 }
 474502 
 475503         case 'G': /* emit conversion instructions */
 476504                 sconv(p);
 477505                 break;
 478506 
 479507         case 'J': /* jump or ret? */
 480508                 {
 481509                         struct interpass *ip =
 482510                             DLIST_PREV((struct interpass *)p2env.epp, qelem);
 483511                         if (ip->type != IP_DEFLAB ||
 484512                             ip->ip_lbl != getlr(p, 'L')->n_lval)
 485513                                 expand(p, FOREFF, "jbr  LL");
 486514                         else
 487515                                 printf("ret");
 488516                 }
 489517                 break;
 490518 
 491519         case 'L':       /* type of left operand */
 492520         case 'R':       /* type of right operand */
 493521                 {
 494522                 register NODE *n;
 495523                 extern int xdebug;
 496524 
 497525                 n = getlr ( p, c);
 498526                 if (xdebug) printf("->%d<-", n->n_type);
 499527 
 500528                 prtype(n);
 501529                 return;
 502530                 }
 503531 
 504532         case 'O': /* print out emulated ops */
 505533                 expand(p, FOREFF, "\tmovq       AR,-(%sp)\n");
 506534                 expand(p, FOREFF, "\tmovq       AL,-(%sp)\n");
 507535                 if (p->n_op == DIV && p->n_type == ULONGLONG) ch = "udiv";
 508536                 else if (p->n_op == DIV) ch = "div";
 509537                 else if (p->n_op == MOD && p->n_type == ULONGLONG) ch = "umod";
 510538                 else if (p->n_op == MOD) ch = "mod";
 511539                 else ch = 0, comperr("ZO");
 512540                 printf("\tcalls $4,__%sdi3\n", ch);
 513541                 break;
 514542 
 515543 
 516544         case 'Z':       /* complement mask for bit instr */
 517545                 printf("$%Ld", ~p->n_right->n_lval);
 518546                 return;
 519547 
 520548         case 'U':       /* 32 - n, for unsigned right shifts */
 521549                 printf("$" CONFMT, 32 - p->n_right->n_lval );
 522550                 return;
 523551 
 524552         case 'T':       /* rounded structure length for arguments */
 525553                 {
 526554                 int size;
 527555 
 528556                 size = p->n_stsize;
 529557                 SETOFF( size, 4);
 530558                 printf("$%d", size);
 531559                 return;
 532560                 }
 533561 
 534562         case 'S'/* structure assignment */
 535563                 {
<>536 -                        register NODE *l, *r;
537564                         register int size;
 538565 
 539566                         size = p->n_stsize;
 540567                         l = r = NULL; /* XXX gcc */
 541568                         if( p->n_op == STASG ){
 542569                                 l = p->n_left;
 543570                                 r = p->n_right;
 544571 
 545572                                 }
 546573                         else if( p->n_op == STARG ){
 547574                                 /* store an arg into a temporary */
 548575                                 printf("\tsubl2 $%d,%%sp\n",
 549576                                     size < 4 ? 4 : size);
 550577                                 l = mklnode(OREG, 0, SP, INT);
 551578                                 r = p->n_left;
 552579                                 }
 553580                         else cerror( "STASG bad" );
 554581 
 555582                         if( r->n_op == ICON ) r->n_op = NAME;
 556583                         else if( r->n_op == REG ) r->n_op = OREG;
 557584                         else if( r->n_op != OREG ) cerror( "STASG-r" );
 558585 
 559586                         if( size <= 0 || size > 65535 )
 560587                                 cerror("structure size <0=0 or >65535");
 561588 
 562589                         switch(size) {
 563590                                 case 1:
 564591                                         printf("        movb    ");
 565592                                         break;
 566593                                 case 2:
 567594                                         printf("        movw    ");
 568595                                         break;
 569596                                 case 4:
 570597                                         printf("        movl    ");
 571598                                         break;
 572599                                 case 8:
 573600                                         printf("        movq    ");
 574601                                         break;
 575602                                 default:
 576603                                         printf("        movc3   $%d,", size);
 577604                                         break;
 578605                         }
 579606                         adrput(stdout, r);
 580607                         printf(",");
 581608                         adrput(stdout, l);
 582609                         printf("\n");
 583610 
 584611                         if( r->n_op == NAME ) r->n_op = ICON;
 585612                         else if( r->n_op == OREG ) r->n_op = REG;
 586613                         if (p->n_op == STARG)
 587614                                 tfree(l);
 588615 
 589616                         }
 590617                 break;
 591618 
 592619         default:
 593620                 comperr("illegal zzzcode '%c'", c);
<>594 -                }
595621         }
<> 622+}
<_596623 
 597624 void
 598625 rmove( int rt,int  rs, TWORD t ){
 599626         printf( "       %s      %s,%s\n",
 600627                 (t==FLOAT ? "movf" : (t==DOUBLE ? "movd" : "movl")),
 601628                 rnames[rs], rnames[rt] );
 602629         }
 603630 
 604631 #if 0
 605632 setregs(){ /* set up temporary registers */
 606633         fregs = 6;      /* tbl- 6 free regs on VAX (0-5) */
 607634         ;
 608635         }
 609636 
 610637 szty(t){ /* size, in registers, needed to hold thing of type t */
 611638         return( (t==DOUBLE||t==FLOAT) ? 2 : 1 );
 612639         }
 613640 #endif
 614641 
 615642 int
 616643 rewfld( p ) NODE *p; {
 617644         return(1);
 618645         }
 619646 
 620647 #if 0
 621648 callreg(p) NODE *p; {
 622649         return( R0 );
 623650         }
 624651 
 625652 base( p ) register NODE *p; {
 626653         register int o = p->op;
 627654 
 628655         if( (o==ICON && p->name[0] != '\0')) return( 100 ); /* ie no base reg */
 629656         if( o==REG ) return( p->rval );
 630657     if( (o==PLUS || o==MINUS) && p->left->op == REG && p->right->op==ICON)
 631658                 return( p->left->rval );
 632659     if( o==OREG && !R2TEST(p->rval) && (p->type==INT || p->type==UNSIGNED || ISPTR(p->type)) )
 633660                 return( p->rval + 0200*1 );
 634661         if( o==INCR && p->left->op==REG ) return( p->left->rval + 0200*2 );
 635662         if( o==ASG MINUS && p->left->op==REG) return( p->left->rval + 0200*4 );
 636663         if( o==UNARY MUL && p->left->op==INCR && p->left->left->op==REG
 637664           && (p->type==INT || p->type==UNSIGNED || ISPTR(p->type)) )
 638665                 return( p->left->left->rval + 0200*(1+2) );
 639666         return( -1 );
 640667         }
 641668 
 642669 offset( p, tyl ) register NODE *p; int tyl; {
 643670 
 644671         if( tyl==1 && p->op==REG && (p->type==INT || p->type==UNSIGNED) ) return( p->rval );
 645672         if( (p->op==LS && p->left->op==REG && (p->left->type==INT || p->left->type==UNSIGNED) &&
 646673               (p->right->op==ICON && p->right->name[0]=='\0')
 647674               && (1<<p->right->lval)==tyl))
 648675                 return( p->left->rval );
 649676         return( -1 );
 650677         }
 651678 #endif
 652679 
 653680 #if 0
 654681 void
 655682 makeor2( p, q, b, o) register NODE *p, *q; register int b, o; {
 656683         register NODE *t;
 657684         NODE *f;
 658685 
 659686         p->n_op = OREG;
 660687         f = p->n_left;  /* have to free this subtree later */
 661688 
 662689         /* init base */
 663690         switch (q->n_op) {
 664691                 case ICON:
 665692                 case REG:
 666693                 case OREG:
 667694                         t = q;
 668695                         break;
 669696 
 670697                 case MINUS:
 671698                         q->n_right->n_lval = -q->n_right->n_lval;
 672699                 case PLUS:
 673700                         t = q->n_right;
 674701                         break;
 675702 
 676703                 case UMUL:
 677704                         t = q->n_left->n_left;
 678705                         break;
 679706 
 680707                 default:
 681708                         cerror("illegal makeor2");
 682709                         t = NULL; /* XXX gcc */
 683710         }
 684711 
 685712         p->n_lval = t->n_lval;
 686713         p->n_name = t->n_name;
 687714 
 688715         /* init offset */
 689716         p->n_rval = R2PACK( (b & 0177), o, (b>>7) );
 690717 
 691718         tfree(f);
 692719         return;
 693720         }
 694721 
 695722 int
 696723 canaddr( p ) NODE *p; {
 697724         register int o = p->n_op;
 698725 
 699726         if( o==NAME || o==REG || o==ICON || o==OREG || (o==UMUL && shumul(p->n_left, STARNM|SOREG)) ) return(1);
 700727         return(0);
 701728         }
 702729 
 703730 shltype( o, p ) register NODE *p; {
 704731         return( o== REG || o == NAME || o == ICON || o == OREG || ( o==UMUL && shumul(p->n_left, STARNM|SOREG)) );
 705732         }
 706733 #endif
 707734 
 708735 int
 709736 fldexpand(NODE *p, int cookie, char **cp)
 710737 {
 711738         return 0;
 712739 }
 713740 
 714741 int
 715742 flshape( p ) register NODE *p; {
 716743         return( p->n_op == REG || p->n_op == NAME || p->n_op == ICON ||
 717744                 (p->n_op == OREG && (!R2TEST(p->n_rval) || tlen(p) == 1)) );
 718745         }
 719746 
 720747 int
 721748 shtemp( p ) register NODE *p; {
 722749         if( p->n_op == STARG ) p = p->n_left;
 723750         return( p->n_op==NAME || p->n_op ==ICON || p->n_op == OREG || (p->n_op==UMUL && shumul(p->n_left, STARNM|SOREG)) );
 724751         }
 725752 
 726753 /*
 727754  * Shape matches for UMUL.  Cooperates with offstar().
 728755  */
 729756 int
 730757 shumul(NODE *p, int shape)
 731758 {
 732759 
 733760         if (x2debug)
 734761                 printf("shumul(%p)\n", p);
 735762 
 736763         /* Turns currently anything into OREG on vax */
 737764         if (shape & SOREG)
 738765                 return SROREG;
 739766         return SRNOPE;
 740767 }
 741768 
 742769 
 743770 #ifdef notdef
 744771 int
 745772 shumul( p, shape ) register NODE *p; int shape; {
 746773         register int o;
 747774         extern int xdebug;
 748775 
 749776         if (xdebug) {
 750777                  printf("\nshumul:op=%d,lop=%d,rop=%d", p->n_op, p->n_left->n_op, p->n_right->n_op);
 751778                 printf(" prname=%s,plty=%d, prlval=%lld\n", p->n_right->n_name, p->n_left->n_type, p->n_right->n_lval);
 752779                 }
 753780 
 754781 
 755782         o = p->n_op;
 756783         if( o == NAME || (o == OREG && !R2TEST(p->n_rval)) || o == ICON )
 757784                 if (shape & STARNM)
 758785                         return SRDIR;
 759786 
 760787         if( ( o == INCR || o == ASG MINUS ) &&
 761788             ( p->n_left->n_op == REG && p->n_right->n_op == ICON ) &&
 762789             p->n_right->n_name[0] == '\0' )
 763790                 {
 764791                 switch (p->n_left->n_type)
 765792                         {
 766793                         case CHAR|PTR:
 767794                         case UCHAR|PTR:
 768795                                 o = 1;
 769796                                 break;
 770797 
 771798                         case SHORT|PTR:
 772799                         case USHORT|PTR:
 773800                                 o = 2;
 774801                                 break;
 775802 
 776803                         case INT|PTR:
 777804                         case UNSIGNED|PTR:
 778805                         case LONG|PTR:
 779806                         case ULONG|PTR:
 780807                         case FLOAT|PTR:
 781808                                 o = 4;
 782809                                 break;
 783810 
 784811                         case DOUBLE|PTR:
 785812                                 o = 8;
 786813                                 break;
 787814 
 788815                         default:
 789816                                 if ( ISPTR(p->n_left->n_type) ) {
 790817                                         o = 4;
 791818                                         break;
 792819                                         }
 793820                                 else return(0);
 794821                         }
 795822                 return( p->n_right->n_lval == o ? STARREG : 0);
 796823                 }
 797824 
 798825         return( SRNOPE );
 799826         }
 800827 #endif
 801828 
 802829 void
 803830 adrcon( val ) CONSZ val; {
 804831         printf( "$" );
 805832         printf( CONFMT, val );
 806833         }
 807834 
 808835 void
 809836 conput(FILE *fp, NODE *p)
 810837 {
 811838         switch( p->n_op ){
 812839 
 813840         case ICON:
 814841                 acon( p );
 815842                 return;
 816843 
 817844         case REG:
 818845                 printf( "%s", rnames[p->n_rval] );
 819846                 return;
 820847 
 821848         default:
 822849                 cerror( "illegal conput" );
 823850                 }
 824851         }
 825852 
 826853 void
 827854 insput( p ) register NODE *p; {
 828855         cerror( "insput" );
 829856         }
 830857 
 831858 /*
 832859  * Write out the upper address, like the upper register of a 2-register
 833860  * reference, or the next memory location.
 834861  */
 835862 void
 836863 upput(NODE *p, int size)
 837864 {
 838865 
 839866         size /= SZCHAR;
 840867         switch (p->n_op) {
 841868         case REG:
 842869                 fprintf(stdout, "%s", rnames[regno(p)-16+1]);
 843870                 break;
 844871 
 845872         case NAME:
 846873         case OREG:
 847874                 p->n_lval += size;
 848875                 adrput(stdout, p);
 849876                 p->n_lval -= size;
 850877                 break;
 851878         case ICON:
 852879                 fprintf(stdout, "$" CONFMT, p->n_lval >> 32);
 853880                 break;
 854881         default:
 855882                 comperr("upput bad op %d size %d", p->n_op, size);
 856883         }
 857884 }
 858885 
 859886 void
 860887 adrput(FILE *fp, NODE *p)
 861888 {
 862889         register int r;
 863890         /* output an address, with offsets, from p */
 864891 
 865892         if( p->n_op == FLD ){
 866893                 p = p->n_left;
 867894                 }
 868895         switch( p->n_op ){
 869896 
 870897         case NAME:
 871898                 acon( p );
 872899                 return;
 873900 
 874901         case ICON:
 875902                 /* addressable value of the constant */
 876903                 if (p->n_name[0] == '\0') /* uses xxxab */
 877904                         printf("$");
 878905                 acon(p);
 879906                 return;
 880907 
 881908         case REG:
 882909                 printf( "%s", rnames[p->n_rval] );
 883910                 return;
 884911 
 885912         case OREG:
 886913                 r = p->n_rval;
 887914                 if( R2TEST(r) ){ /* double indexing */
 888915                         register int flags;
 889916 
 890917                         flags = R2UPK3(r);
 891918                         if( flags & 1 ) printf("*");
 892919                         if( flags & 4 ) printf("-");
 893920                         if( p->n_lval != 0 || p->n_name[0] != '\0' ) acon(p);
 894921                         if( R2UPK1(r) != 100) printf( "(%s)", rnames[R2UPK1(r)] );
 895922                         if( flags & 2 ) printf("+");
 896923                         printf( "[%s]", rnames[R2UPK2(r)] );
 897924                         return;
 898925                         }
 899926                 if( r == AP ){  /* in the argument region */
 900927                         if( p->n_lval <= 0 || p->n_name[0] != '\0' ) werror( "bad arg temp" );
 901928                         printf( CONFMT, p->n_lval );
 902929                         printf( "(%%ap)" );
 903930                         return;
 904931                         }
 905932                 if( p->n_lval != 0 || p->n_name[0] != '\0') acon( p );
 906933                 printf( "(%s)", rnames[p->n_rval] );
 907934                 return;
 908935 
 909936         case UMUL:
 910937                 /* STARNM or STARREG found */
 911938                 if( tshape(p, STARNM) ) {
 912939                         printf( "*" );
 913940                         adrput(0p->n_left);
 914941                         }
 915942                 else {  /* STARREG - really auto inc or dec */
 916943                         register NODE *q;
 917944 
 918945 /* tbl
 919946                         p = p->n_left;
 920947                         p->n_left->n_op = OREG;
 921948                         if( p->n_op == INCR ) {
 922949                                 adrput( p->n_left );
 923950                                 printf( "+" );
 924951                                 }
 925952                         else {
 926953                                 printf( "-" );
 927954                                 adrput( p->n_left );
 928955                                 }
 929956    tbl */
 930957 #ifdef notyet
 931958                         printf("%c(%s)%c", (p->n_left->n_op==INCR ? '\0' : '-'),
 932959                                 rnames[p->n_left->n_left->n_rval],
 933960                                 (p->n_left->n_op==INCR ? '+' : '\0') );
 934961 #else
 935962                         printf("%c(%s)%c", '-',
 936963                                 rnames[p->n_left->n_left->n_rval],
 937964                                 '\0' );
 938965 #endif
 939966                         p->n_op = OREG;
 940967                         p->n_rval = p->n_left->n_left->n_rval;
 941968                         q = p->n_left;
 942969 #ifdef notyet
 943970 
 944971                         p->n_lval = (p->n_left->n_op == INCR ? -p->n_left->n_right->n_lval : 0);
 945972 #else
 946973                         p->n_lval = 0;
 947974 #endif
 948975                         p->n_name[0] = '\0';
 949976                         tfree(q);
 950977                 }
 951978                 return;
 952979 
 953980         default:
 954981                 cerror( "illegal address" );
 955982                 return;
 956983         }
 957984 
 958985 }
 959986 
 960987 /*
 961988  * print out a constant
 962989  */
 963990 void
 964991 acon(NODE *p)
 965992 {
 966993 
 967994         if (p->n_name[0] == '\0') {
 968995                 printf(CONFMT, p->n_lval);
 969996         } else if( p->n_lval == 0 ) {
 970997                 printf("%s", p->n_name);
 971998         } else {
 972999                 printf("%s+", p->n_name);
 9731000                 printf(CONFMT, p->n_lval);
 9741001         }
 9751002 }
 9761003 
 9771004 #if 0
 9781005 genscall( p, cookie ) register NODE *p; {
 9791006         /* structure valued call */
 9801007         return( gencall( p, cookie ) );
 9811008         }
 9821009 
 9831010 /* tbl */
 9841011 int gc_numbytes;
 9851012 /* tbl */
 9861013 
 9871014 gencall( p, cookie ) register NODE *p; {
 9881015         /* generate the call given by p */
 9891016         register NODE *p1, *ptemp;
 9901017         register temp, temp1;
 9911018         register m;
 9921019 
 9931020         if( p->right ) temp = argsize( p->right );
 9941021         else temp = 0;
 9951022 
 9961023         if( p->op == STCALL || p->op == UNARY STCALL ){
 9971024                 /* set aside room for structure return */
 9981025 
 9991026                 if( p->stsize > temp ) temp1 = p->stsize;
 10001027                 else temp1 = temp;
 10011028                 }
 10021029 
 10031030         if( temp > maxargs ) maxargs = temp;
 10041031         SETOFF(temp1,4);
 10051032 
 10061033         if( p->right ){ /* make temp node, put offset in, and generate args */
 10071034                 ptemp = talloc();
 10081035                 ptemp->op = OREG;
 10091036                 ptemp->lval = -1;
 10101037                 ptemp->rval = SP;
 10111038                 ptemp->name[0] = '\0';
 10121039                 ptemp->rall = NOPREF;
 10131040                 ptemp->su = 0;
 10141041                 genargs( p->right, ptemp );
 10151042                 nfree(ptemp);
 10161043                 }
 10171044 
 10181045         p1 = p->left;
 10191046         if( p1->op != ICON ){
 10201047                 if( p1->op != REG ){
 10211048                         if( p1->op != OREG || R2TEST(p1->rval) ){
 10221049                                 if( p1->op != NAME ){
 10231050                                         order( p1, INAREG );
 10241051                                         }
 10251052                                 }
 10261053                         }
 10271054                 }
 10281055 
 10291056 /*
 10301057         if( p1->op == REG && p->rval == R5 ){
 10311058                 cerror( "call register overwrite" );
 10321059                 }
 10331060  */
 10341061 /* tbl
 10351062         setup gc_numbytes so reference to ZC works */
 10361063 
 10371064         gc_numbytes = temp;
 10381065 /* tbl */
 10391066 
 10401067         p->op = UNARY CALL;
 10411068         m = match( p, INTAREG|INTBREG );
 10421069 /* tbl
 10431070         switch( temp ) {
 10441071         case 0:
 10451072                 break;
 10461073         case 2:
 10471074                 printf( "       tst     (sp)+\n" );
 10481075                 break;
 10491076         case 4:
 10501077                 printf( "       cmp     (sp)+,(sp)+\n" );
 10511078                 break;
 10521079         default:
 10531080                 printf( "       add     $%d,sp\n", temp);
 10541081                 }
 10551082    tbl */
 10561083         return(m != MDONE);
 10571084         }
 10581085 #endif
 10591086 
 10601087 static char *
 10611088 ccbranches[] = {
 10621089         "jeql",
 10631090         "jneq",
 10641091         "jleq",
 10651092         "jlss",
 10661093         "jgeq",
 10671094         "jgtr",
 10681095         "jlequ",
 10691096         "jlssu",
 10701097         "jgequ",
 10711098         "jgtru",
 10721099 };
 10731100 
 10741101 /*
 10751102  * printf conditional and unconditional branches
 10761103  */
 10771104 void
 10781105 cbgen(int o, int lab)
 10791106 {
 10801107 
 10811108         if (o == 0) {
 10821109                 printf("        jbr     " LABFMT "\n", lab);
 10831110         } else {
 10841111                 if (o > UGT)
 10851112                         comperr("bad conditional branch: %s", opst[o]);
 10861113                 printf("\t%s\t" LABFMT "\n", ccbranches[o-EQ], lab);
 10871114         }
 10881115 }
 10891116 
 10901117 static void
 10911118 optim2(NODE *p, void *arg)
 10921119 {
 10931120         /* do local tree transformations and optimizations */
 10941121 
 10951122         register NODE *r;
 10961123 
 10971124         switch( p->n_op ) {
 10981125 
 10991126         case AND:
 11001127                 /* commute L and R to eliminate compliments and constants */
 11011128                 if( (p->n_left->n_op==ICON&&p->n_left->n_name[0]==0) || p->n_left->n_op==COMPL ) {
 11021129                         r = p->n_left;
 11031130                         p->n_left = p->n_right;
 11041131                         p->n_right = r;
 11051132                         }
 11061133 #if 0
 11071134         case ASG AND:
 11081135                 /* change meaning of AND to ~R&L - bic on pdp11 */
 11091136                 r = p->n_right;
 11101137                 if( r->op==ICON && r->name[0]==0 ) { /* compliment constant */
 11111138                         r->lval = ~r->lval;
 11121139                         }
 11131140                 else if( r->op==COMPL ) { /* ~~A => A */
 11141141                         r->op = FREE;
 11151142                         p->right = r->left;
 11161143                         }
 11171144                 else { /* insert complement node */
 11181145                         p->right = talloc();
 11191146                         p->right->op = COMPL;
 11201147                         p->right->rall = NOPREF;
 11211148                         p->right->type = r->type;
 11221149                         p->right->left = r;
 11231150                         p->right->right = NULL;
 11241151                         }
 11251152                 break;
 11261153 #endif
 11271154                 }
 11281155         }
 11291156 
 11301157 void
 11311158 myreader(struct interpass *ipole)
 11321159 {
 11331160         struct interpass *ip;
 11341161 
 11351162         DLIST_FOREACH(ip, ipole, qelem) {
 11361163                 if (ip->type != IP_NODE)
 11371164                         continue;
 11381165                 walkf(ip->ip_node, optim2, 0);
 11391166         }
 11401167 }
 11411168 
 11421169 void
 11431170 mycanon(NODE *p)
 11441171 {
 11451172 }
 11461173 
 11471174 void
 11481175 myoptim(struct interpass *ip)
 11491176 {
 11501177 }
 11511178 
 11521179 /*
 11531180  * Return argument size in regs.
 11541181  */
 11551182 static int
 11561183 argsiz(NODE *p)
 11571184 {
 11581185         TWORD t = p->n_type;
 11591186 
 11601187         if (t == STRTY || t == UNIONTY)
 11611188                 return p->n_stsize/(SZINT/SZCHAR);
 11621189         return szty(t);
 11631190 }
 11641191 
 11651192 /*
 11661193  * Last chance to do something before calling a function.
 11671194  */
 11681195 void
 11691196 lastcall(NODE *p)
 11701197 {
 11711198         NODE *op = p;
 11721199         int size = 0;
 11731200 
 11741201         /* Calculate argument sizes */
 11751202         p->n_qual = 0;
 11761203         if (p->n_op != CALL && p->n_op != FORTCALL && p->n_op != STCALL)
 11771204                 return;
 11781205         for (p = p->n_right; p->n_op == CM; p = p->n_left)
 11791206                 size += argsiz(p->n_right);
 11801207         if (p->n_op != ASSIGN)
 11811208                 size += argsiz(p);
 11821209         op->n_qual = size; /* XXX */
 11831210 }
 11841211 
 11851212 /*
 11861213  * Return a class suitable for a specific type.
 11871214  */
 11881215 int
 11891216 gclass(TWORD t)
 11901217 {
 11911218         return (szty(t) == 2 ? CLASSB : CLASSA);
 11921219 }
 11931220 
 11941221 /*
 11951222  * For class c, find worst-case displacement of the number of
 11961223  * registers in the array r[] indexed by class.
 11971224  */
 11981225 int
 11991226 COLORMAP(int c, int *r)
 12001227 {
 12011228         int num;
 12021229 
 12031230         switch (c) {
 12041231         case CLASSA:
 12051232                 /* there are 12 classa, so min 6 classb are needed to block */
 12061233                 num = r[CLASSB] * 2;
 12071234                 num += r[CLASSA];
 12081235                 return num < 12;
 12091236         case CLASSB:
 12101237                 /* 6 classa may block all classb */
 12111238                 num = r[CLASSB] + r[CLASSA];
 12121239                 return num < 6;
 12131240         }
 12141241         comperr("COLORMAP");
 12151242         return 0; /* XXX gcc */
 12161243 }
 12171244 
 12181245 /*
 12191246  * Special shapes.
 12201247  */
 12211248 int
 12221249 special(NODE *p, int shape)
 12231250 {
 12241251         return SRNOPE;
 12251252 }
 12261253 
 12271254 /*
 12281255  * Target-dependent command-line options.
 12291256  */
 12301257 void
 12311258 mflags(char *str)
 12321259 {
 12331260 }
 12341261 /*
 12351262  * Do something target-dependent for xasm arguments.
 12361263  * Supposed to find target-specific constraints and rewrite them.
 12371264  */
 12381265 int
 12391266 myxasm(struct interpass *ip, NODE *p)
 12401267 {
 12411268         return 0;
 12421269 }
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-09-23 20:25 +0200