Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.15
 
1.16
 
MAIN:ragge:20110728110414
 
code.c
_>332332         }
 333333         return p;
 334334 }
<_ 335+
  336+/*
  337+ * Generate the builtin code for FFS.
  338+ */
  339+NODE *
  340+builtin_ffs(NODE *f, NODE *a, TWORD t)
  341+{
  342+        NODE *p, *q, *r;
  343+
  344+        nfree(f);
  345+        p = tempnode(0, t, 0, 0);
  346+        r = block(XARG, ccopy(p), NIL, INT, 0, 0);
  347+        r->n_name = "=&r";
  348+        q = block(XARG, a, NIL, INT, 0, 0);
  349+        q->n_name = "g";
  350+        q = block(CM, r, q, INT, 0, 0);
  351+        q = block(XASM, q, block(ICON, 0, 0, STRTY, 0, 0), INT, 0, 0);
  352+        q->n_name = "ffs $0,$32,%1,%0;bneq 1f;mnegl $1,%0;1:;incl %0";
  353+        p = block(COMOP, q, p, t, 0, 0);
  354+        return p;
  355+}
  356+
  357+NODE *
  358+vax_builtin_return_address(NODE *f, NODE *a, TWORD t)
  359+{
  360+
  361+        if (a == NULL || a->n_op != ICON)
  362+                goto bad;
  363+
  364+        if (a->n_lval != 0)
  365+                werror("unsupported argument");
  366+
  367+        tfree(f);
  368+        tfree(a);
  369+
  370+        f = block(REG, NIL, NIL, INCREF(PTR+CHAR), 0, 0);
  371+        regno(f) = FPREG;
  372+        f = block(UMUL,
  373+                block(PLUS, f,
  374+                    bcon(16), INCREF(PTR+CHAR), 0, 0), NIL, PTR+CHAR, 0, 0);
  375+        f = makety(f, PTR+VOID, 0, 0, 0);
  376+
  377+        return f;
  378+bad:
  379+        uerror("bad argument to __builtin_return_address");
  380+        return bcon(0);
  381+}
  382+
  383+NODE *
  384+vax_builtin_frame_address(NODE *f, NODE *a, TWORD t)
  385+{
  386+        int nframes;
  387+
  388+        if (a == NULL || a->n_op != ICON)
  389+                goto bad;
  390+
  391+        nframes = a->n_lval;
  392+
  393+        tfree(f);
  394+        tfree(a);
  395+
  396+        f = block(REG, NIL, NIL, INCREF(PTR+CHAR), 0, 0);
  397+        regno(f) = FPREG;
  398+        f = block(UMUL,
  399+                block(PLUS, f,
  400+                    bcon(12), INCREF(PTR+CHAR), 0, 0), NIL, PTR+CHAR, 0, 0);
  401+        f = makety(f, PTR+CHAR, 0, 0, 0);
  402+
  403+
  404+        while (nframes--) {
  405+                f = block(UMUL,
  406+                        block(PLUS, f,
  407+                            bcon(12), INCREF(PTR+CHAR), 0, 0),
  408+                                NIL, PTR+CHAR, 0, 0);
  409+                f = makety(f, PTR+CHAR, 0, 0, 0);
  410+        }
  411+
  412+        return f;
  413+bad:
  414+        uerror("bad argument to __builtin_frame_address");
  415+        return bcon(0);
  416+}
  417+
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-21 05:06 +0100