{erinyes}compiler> D2TOpCodes.tedit Thu9 Jan86 M Herring This document is an extension of D2T.tedit. It lists the D-machine opcodes by group, saying of each opcode what the D->T and D->D translation processes do to it. Opcode groups-- list / stack constants variable references types manipulating built-in data structures arithmetic / logic shifts / bit fields call/return jumps memory access & address calculation system pseudo Below-- "??" tends to mean: "what is this?" "D=T"does not officially include the case where the only change is that the size of an atom-number argument is 3 bytes vs 2, but it is compatible with it. D=T includes the case where the OpCode is UFNed on the Tamarin. D=T is the default; just mentioned to occupy the space. "atom#size" means that this opcode is affected by a change in atom # size. If this affects the D+T machine then it would have to be renamed for the D+T machine? "n/u" = "not used". I.e. probably don't need to write the UFN. "macro" means that this is taken by the assembler as a sort of macro. "macro?~ probably means: either that or it will UFN. "wordAddr" means that the opcode's word-offset argument has to be translated somehow. "32-bit" means that the argument of the opcode must be construed to be a 32-bit object vs a word, which may take some translation. "style?" means the Tamarin may deal with this opcode group differently or format the arguments differently. ÿÿïf ÿlist / stack -- CAR CDR CONS D=T RPLACA RPLACD D=T CDDR n/u LIST1 T:macro? RPLCONS ?? COPY POP D=T COPY.N STORE.N D=T SWAP T:macro involving a new variable? POP.N T:macro? BIND different. D2T: translate in terms of explicit setting of variables. (T2D puts in null BINDs as well.) UNBIND DUNBIND different. D2T: translate in terms of TUNBIND/TDUNBIND, together with explicit setting of variables to 'UNBIND. (T2D: simulate the 'UNBIND VAR_ sequence with BIND & DUNBIND.) ÿÿïf ÿconstants -- 'NIL 'T '0 D=T '1 T:macro = SIC 1. SIC SNIC SICX D2T:generic SIC. T:different set of opcodes. GCONST T: treats as generic for the set of TGCONSTs by major type bits. These are all 4 bytes vs 3. ACONST T:atom#size ATOMNUMBER ?? atom#size ÿÿïf ÿvariable references -- GVAR GVAR_ T:atom#size IVAR IVARX IVARX_ in non-lambda*: D2T:generics VAR & VAR_. (T2D takes to generics IVAR & IVAR_.) T:macro deals with slot#s>6.. in lambda*: D2T:translates in terms of (ARG0) & (FN2 \SETARG0). PVAR PVAR_ PVAR_^ D2T:generics VAR VAR_ VAR_^. (T2D takes back to generics PVAR PVAR_ PVAR_^.) PVARX PVARX_ FVAR FVARX FVARX_ D2T:generics. ÿÿïf ÿtypes -- type bits differ; hierarchy differs DTEST TYPECHECK style TYPEP style NTYPX style -- similar LISTP => TYPEP TYPEMASK.N not used in Tam: NUMBERP => TYPEP ÿÿïf ÿmanipulating built-in data structures -- ASSOC GETP LISTGET D=T GETHASH PUTHASH ELT SETA NTHCHC FMEMB n/u DOCOLLECT ENDCOLLECT RPLCHARCODE * * * * * * * * * * ÿÿïf ÿarithmetic / logic -- status of -xx vs Ixx ?? EQ EQL D=T EQUAL ?? D=T PLUS2 DIFFERENCE GREATERP D=T TIMES2 QUOTIENT D=T IPLUS2 IDIFFERENCE IGREATERP D=T ITIMES2 IQUOTIENT IREMAINDER D=T IPLUS.N IDIFFERENCE.N macro? FPLUS2 FDIFFERENCE FGREATERP D=T FTIMES2 FQUOTIENT D=T BOXIPLUS BOXIDIFFERENCE D=T UBFLOAT1 UBFLOAT2 UBFLOAT3 D=T FLOATBLT FFTSTEP D=T MISC3 MISC4 D=T MAKENUMBER ?? D=T LOGAND2 LOGOR2 LOGXOR2 T:AND OR XOR ÿÿïf ÿshifts / bit fields -- LSH style? ?? LLSH1 LLSH8 LRSH1 LRSH8 style? ?? GETBITS.N.FD PUTBITS.N.FD style? 32bit wordAddr ?? * * * * * * * * * * ÿÿïf ÿcall / return -- FN0 .. FN4 FNX D2T:generic FN, and translate those with >6 args via a vectorizing ufn & FN7. (T2D: take out the latter.) atom#size APPLYFN D=T, but semantics a bit different: don't need CHECKAPPLY* CHECKAPPLY* D2T:take out. (T2D: put back.) RETURN D=T, though the semantics are different. \RETURN ?? MYALINK D2T: translate to MYCLINK. (T2D: put back.) ARG0 D=T MYARGCOUNT not in Tam -- handled via entry vector etc. ÿÿïf ÿjumps -- JUMP JUMPX JUMPXX generics FJUMP FJUMPX TJUMP TJUMPX generics NFJUMPX NTJUMPX generics NOP generics treat as a kind of JUMP (or vv.) * * * * * * * * * * ÿÿïf ÿmemory access & address calculation -- BLT ?? wordAddr? 32-bit? GETBASEBYTE PUTBASEBYTE ?? D=T GETBASE.N PUTBASE.N ?? wordAddr 32-bit? GETBASEPTR.N PUTBASEPTR.N wordAddr GETBASEFIXP.N PUTBASEFIXP.N wordAddr ADDBASE ?? wordAddr? VAG2 ?? ÿÿïf ÿsystem -- EVAL EVALV D=T CONTEXTSWITCH RAID D=T GCREF GCSCAN1 GCSCAN2 ?? CREATECELL RECLAIMCELL ?? wordAddr? 32-bit? RPLPTR.N ?? wordAddr? STKSCAN ?? ATOMCELL.N ?? atom # size MISC2 MISC10 ?? LOLOC HILOC ?? SUBRCALL ?? not in Tam BIN D=T BOUT n/u BUSBLT DOVEMISC not in Tam READPRINTERPORT WRITEPRINTERPORT not in Tam ? UPCTRACE ?? READFLAGS READRP RCLK ?? D=T WRITEMAP MISC1 MISC7 MISC8 ?? D=T DRAWLINE PILOTBITBLT ?? D=T POPDISP not in Tam RDPROLOGPTR RDPROLOGTAG not in Tam WRTPTR&TAG WRTPTR&0TAG not in Tam ÿÿïf ÿpseudo -- -X- D=T(<76l¢ö.<@6l¢ö2n¼@6l¢ö2n¼@6l¢ö2n¼MODERN MODERN  !  & $$¢@~Vƒm *qà =hƒEb!,0'     !!! %"3ˆF.39 9#1%*#% ,  . #" yzº