Annotation of researchv8dc/cmd/ccom/vax/gencode.h, revision 1.1.1.1

1.1       root        1: #include "mfile2.h"
                      2: #include "setjmp.h"
                      3: extern jmp_buf back;
                      4: extern char *regnames[], *frameptr, *argptr;
                      5: #ifdef M32
                      6: #define REGMASK 0x3
                      7: #define REGVAR 3
                      8: #define UP ('A' - 'a')
                      9: #define VAX 0
                     10: #else if VAX
                     11: #define REGMASK 0x3f
                     12: #define REGVAR 6
                     13: #define M32 0
                     14: #endif
                     15: /* these would be 3 and 3 respectively on the mac32, 3f and 6 on the vax */
                     16: /* registers 0..REGVAR-1 are scratch */
                     17: typedef struct {
                     18:        unsigned char ans;
                     19:        unsigned char regmask;
                     20:        unsigned short flag;
                     21: } ret;
                     22: #define CC     1
                     23: #define VALUE  2
                     24: #define TOSTACK        4
                     25: #define ASADDR 8
                     26: #define SCRATCH        16
                     27: #define ICON0  (VAX? 32: 0)
                     28: #define ICON1  (VAX? 64: 0)
                     29: #define ISREG  128
                     30: #define DESTISLEFT     256
                     31: #define CANINDIR       512
                     32: #define FAILX  1024
                     33: #define INDEX  (VAX? 2048: 0)
                     34: #define FAIL0  4096
                     35: #define FAIL (FAILX|FAIL0)
                     36: #define USED   (VAX?8192:0)
                     37: #define NOGOOD (FAIL|USED)
                     38: #define AUTO   (16384) /* ans is auto incr/decr */
                     39: /* as param; as return
                     40:  * CC just need the condition codes; condition codes are valid
                     41:  * VALUE need the value (for incr/decr.  as opposed to just the side effect)
                     42:  * TOSTACK put the result on the stack
                     43:  * ASADDR as an address, for various weird environments (calls, extzv, ...)
                     44:  * SCRATCH ; the result is in a scratch place
                     45:  * ICON0 ; the result is the constant 0
                     46:  * ICON1 ; the result is the constant 1
                     47:  * ISREG ; the result is in a register
                     48:  * DESTISLEFT put the result in the left operand (asg ops)
                     49:  * CANINDIR ; the result can be indirected through
                     50:  * FAIL ; there is no result, for we ran out of registers
                     51:  * INDEX ; some size-dependent addressing mode was used, so watch it
                     52:  * FAIL0 ; we ran out of register 0
                     53:  * USED plan to use result; don't re-use, as in 3+(*p++=*q++), register p, q
                     54: /* ASADDR is never used with a dest, and is always VALUE|ASADDR */
                     55: ret doit(), allocreg(), specialreg(), indir(), tostack(), indirit(), simpler(),
                     56:        alloctmp(), checksize();
                     57: 
                     58: #define LEFT 1
                     59: #define RIGHT 2
                     60: char *genjmp();
                     61: 
                     62: #define BUF 64 /* overflow unchecked */
                     63: char bufs[256][BUF];
                     64: char *buf, *bufend;
                     65: char prbuf[10240];
                     66: char *prptr;
                     67: #define done(s, n, rm) s.ans = (buf - bufs[0])/BUF; buf += BUF; s.flag = n; s.regmask = rm; if(buf >= bufend) cerror("buf ov"); return(s)
                     68: #define str(s) bufs[s.ans]
                     69: 
                     70: NODE *copytree(), *gimmenode(), *convnodol();
                     71: extern int ntree, regvar, Pflag, bbcount;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.