Trailing-Edge
-
PDP-10 Archives
-
BB-4157D-BM
-
sources/tables.bli
There are 13 other files named tables.bli in the archive. Click here to see a list.
!THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
! OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
!COPYRIGHT (C) 1972,1977 BY DIGITAL EQUIPMENT CORPORATION
!AUTHOR: S. MURPHY/HPW/DCE/SJW
GLOBAL BIND TABLV = 5^24 + 1^18 + 156; !VERSION DATE: 11-MAY-77
%(
REVISION HISTORY
134 ----- ----- DEFINE FIELDS FOR E1LISTCALL AND
E2LISTCALL NODES
135 ----- ----- DEFINE DIMSUBSIZE
136 ----- ----- MODIFY DEFINITION OF DIMENSION TABLE ENTRIES
TO MAKE ROOM FOR "ARADLBL" FIELD
137 ----- ----- COMPLETE DEFINITIONS FOR I/O OPTIMIZATIONS
138 ----- ----- DEFINE NEW OPERSP EALISTCALL UNDER OPRCLS
IOLSCLS AND MOVE E2INCR FIELD
140 ---- ----- DEFINE THE MACROS "ADDRETREG" AND "REMRETREG" TO
ADD/REMOVE THE FN-VALUE RETURN REGISTERS TO A SET
OF FREE REGISTERS
141 ----- ----- CHANGE RGCENTBENTRY TO MAKE REGCANDIDATES
TABLES INTO A LINKED LIST
142 ----- ----- ADDITIONAL DEFINITIONS OF FIELDS
FOR IOLSCLS NODES
143 ----- ----- DEFINE OPRS FOR OPRCLS AND SRCID AND
OPERS MACRO TO DEFINE FIELDS FOR STATEMENT
NODES
FOR EACH STATEMENT TYPE APPROPRAITE BIND IS
CALLED XXXOS WHERE XXXX IS ID MNEMONIC
144 ----- ----- REWRITE MACROS ILFIX AND ILF1IX TO GENERATE
DABS IN LINE
145 ----- ----- ADDITIONAL DEFINITIONS TO GENERATE CMPLX
IN LINE
146 ----- ----- ADDITIONAL DEFINITIONS FOR CORRECT FOLDING
OF NESTED IMPLIED DO LOOPS WITH
DOUBLE AND SINGLE WORD DATA ITEMS
147 ----- ----- MODIFY THE MACRO "CLBNXREG" TO CALL THE
ROUTINE "CLOBBNX" - WE WERE NOT CATCHING
DIVISION OF LOGICALS AS CLOBBERING THE NEXT REG
148 ----- ----- ADD DVARFLGS TO THE DIMENSION TABLE ENTRY SO
THAT ACT1 WILL CLEAR THEM PROPERLY
149 ----- ----- REMOVE ALL REFERENCES TO "SQROP","CUBOP","P4OP"
(SINCE THEY ARE NOW UNDER EXPCIOP) -
DEFINE THE MACRO "KEXPIX" TO
DO EXPONEN OF CONSTS AT COMPILE TIME
150 ----- ----- DEFINE MACRO "POWEROF2" - TO USE IN REG
ALLOCATION OF INTEGER EXPONEN
151 ----- ----- REMOVE REFERENCE TO "CUBOP" FROM THE
DEFINITION OF "SPECOPIX"
152 ----- ----- RENAME THE MACRO "POWEROF2" TO "POWOF2" (HAD
A CONFLICT WITH A ROUTINE IN P2S2)
153 253 15425 ADD PUSHJOCD AND DIVOCD DEFINITIONS
154 261 15772 ADD XCTOCD DEFINITION
***** BEGIN VERSION 5A *****
155 551 21826 FIX DISPATCH FOR TYPE CONVERSION TO OCTAL/LOGICAL
156 571 22378 ADD ARALINK DEFINITION
)%
BIND DEBUGFLG=1; !COMPILE SWITCH TO LEAVE CONSISTENCY CHECKS IN
%(****************************************
TO OPTIMALLY TEST WHOLE-WD FLAGS FOR TRUE AND FALSE
****************************************)%
BIND TRUE= -1,
FALSE= 0;
MACRO TRUTH(X)= X NEQ 0$,
FALSITY(X)= X EQL 0$;
BIND AOBINCR=#1000001; !INCREMENT FOR AOBJN
%(****************************************
DEFINE BYTES FOR WHOLE, LEFT HALF, AND RIGHT HALF
****************************************)%
MACRO WHOLE=0,36$ ;
%(**********************************************************************
STRUCTURE FOR AN EXPRESSION NODE
************************************************************************)%
%(************************************************************
DEFINE THE FIELDS AND SUBFIELDS IN AN EXPRESSION NODE
************************************************************)%
BIND EXOPWD=1; !WORD IN WHICH THE OPERATOR FIELD
! AND FLAGS FIELD
! ARE CONTAINED (USE A MACRO ONLY BECAUSE
! WHEN THIS NUMBER CHANGES A LARGE
! NUMBER OF SUBFIELD DEFINITIONS
! MUST BE CHANGED)
%(*****DEFINE MAIN FIELDS****************************)%
MACRO
FIRSTWORD=0,0,FULL$,
PARENT=0,0,RIGHT$, !PTR TO PARENT-NODE
OPERATOR=0,EXOPWD,RIGHT$, !OPERATOR FIELD
EXPFLAGS=0,EXOPWD,LEFT$,
OPERWORD=0,EXOPWD,WHOLE$,
TARGET=0,2,WHOLE$,
ARGWD=0,3,WHOLE$, !WD HOLDING PTRS TO THE 2 ARGS
ARGWDOFFSET=3$,
ARG1PTR=0,3,LEFT$,
ARG2PTR=0,3,RIGHT$;
MACRO
COMPLEXITY=0,0,30,6$, !THIS FIELD IS USED ONLY DURING REGISTER ALLOCATION
! IT INDICATES THE NO OF REGS NEEDED TO EVAL THIS EXPR
SONNXTUSE=0,0,18,12$; !ISN OF THE STMNT WHERE THE VAR UNDER THIS EXPR IS NEXT
! USED (IN THIS BASIC BLOCK) USED BY BB REG ALLOC
%(**********SUBFIELDS IN OPERATOR FIELD*************************)%
MACRO
VALTYPE=0,EXOPWD,13,5$, !TYPE FOR VALUE
OPRCLS=0,EXOPWD,8,5$, !CLASS OF OPERATOR
OPERSP=0,EXOPWD,5,3$, !SPECIFIC OPERATOR WITHIN CLASS
%(***NOTE THAT OF THE 3 FREE BITS AT THE RIGHT END OF THE OPERATOR FIELD,
BIT 35 IS USED AS A SPECIAL FLAG BIT IN
1. TYPE-CONVERSION NODES: FLAG FOR NO CONVERSION
*******)%
%(***SUBFIELDS OF OPERSP FIELD*****)%
OPRSP1=0,EXOPWD,6,2$, !1ST 2 BITS OF OPERSP (THIS FIELD IS 00 FOR
! ADD AND SUB, 01 FOR MUL AND DIV
OPRSP2=0,EXOPWD,5,2$, !LAST 2 BITS OF OPERSP FIELD -
! USED TO DIFFERENTIATE ADD,SUB,MUL,DIV
! ALSO USED IN TYPE CONVERSION NODES TO DIFFERENTIATE
! FROMINT, FROMREL, FROMDBLPRC,
! FROMCMPLX
OPRSBIT0=0,EXOPWD,7,1$, !1ST BIT OF OPERSP FIELD - FOR AN ARITH
! NODE, THIS BIT IS SET ONLY FOR OPERSP EXPONEN
! FOR A TYPE-CONVERSION NODE THIS BIT IS SET
! FOR FROMINT,FROMREAL,FROMDBLPRC,FROMCMPLX
! AND NOT SET FOR FROMOCT,FROMCTL,FROMLIT,FROMDOCT
OPRSBIT2=0,EXOPWD,5,1$, !3RD BIT OF OPERSP FIELD - FOR AN ARITH
! NODE, THIS BIT IS SET ONLY FOR SUB AND MUL
OPR1=0,EXOPWD,5,8$, !OPRCLS AND OPERSP FIELDS CONCATENATED
OPR2=0,EXOPWD,6,7$; !OPRCLS FIELD AND 1ST 2 BITS OF OPERSP FIELD
%(***SUBFIELDS OF THE ABOVE "MAIN" SUBFIELDS***)%
MACRO
VALTP1=0,EXOPWD,15,2$, !MIDDLE 2 BITS OF VALTYPE ARE
! ALL THATS NEEDED FOR GETA1OPIX AND ARITHOPIX
VALTP2=0,EXOPWD,15,3$, !FIRST 3 BITS OF VALTYPE ARE
! IDENTICAL TO THE OPERSP FIELD FOR A TYPECNV
! NODE TO CONVERT FROM THAT VALTYPE
DBLFLG=0,EXOPWD,16,1$, !THE 2ND BIT OF VALTYPE IS FLAG
! FOR 2 WD VAL (DOUBLE PREC OR COMPLEX)
SDBLFLG=0,EXOPWD,6,1$; !THE 2ND BIT OF OPERSP FOR A
!NODE OF OPRCLS "TYPECNV" IS FLAG FOR SOURCE
!IS A 2 WD VAL
MACRO
BOOLOPR=0,EXOPWD,5,2$, !BOOLEAN OPERATOR IS SPECIFIED BY RIGHT
! 2 BITS OF OPERSP FIELD
BOOLCLS=0,EXOPWD,6,1$, !BOOLEAN CLASS (AND/OR OR XOR/EQV) IS
! SPECIFIED BY THE LEFTMOST OF THESE 2
BOPRFLG=0,EXOPWD,5,1$; !THE 2ND DIVIDES BOOLEANS INTO 2 OTHER
! CLASSES - OR/XOR AND AND/EQV
MACRO PARENLSTFLG=0,EXOPWD,7,1$; !FLAG FOR NAME WHICH SHOULD HAVE
! AN ARGLST FOLLOWING (THIS BIT IS
! 1ST BIT OF OPERSP FIELD OF A DATA ITEM)
MACRO FORMLFLG=0,EXOPWD,5,1$; !IN OPERSP FIELD FOR A DATA ITEM, FLAG
! FOR "FORMAL" (NOTE HOWEVER THAT THIS BIT
! IS ALSO SET IN THE OPERSP FIELD OF A TEMPORARY)
%(****MACRO TO CONSTRUCT AN "OPR1" FIELD*****)%
MACRO
OPR1C(OPCLS,OPSP)=(OPCLS^3 OR OPSP)$;
MACRO OPR2C(OPCLS,OPSP)=(OPCLS^2 OR OPSP^(-1))$;
%(****TO CONSTRUCT AN OPERATOR FIELD****)%
MACRO OPERC(VTYP,OPCLS,OPSP)=(VTYP^13 OR OPCLS^8 OR OPSP^5)$;
%(***TO GET A VALTP1 FIELD FROM A VALTYPE****)%
MACRO VTP1(VLTP)=(VLTP^(-2) AND (#3))$;
%(***TO GET A VALTP2 FIELD (FIRST 3 BITS) FROM A VALTYPE***)%
MACRO VTP2(VLTP)=(VLTP^(-2))$;
%(*******FLAGS IN EXPFLAG FIELD (THESE ARE SET BY PHASE 2 SKEL AND USED BY PHASE 3*******)%
MACRO
PARENFLG=0,EXOPWD,35,1$, !FLAG FOR PARENS AROUND THIS NODE (IN SOURCE)
PAIRMODEFLG=PARENFLG$, !IN ALL STATEMENTS TO INDICATE
!DOUBLE PRECISION
SAVREGFLG=0,EXOPWD,34,1$, !"SAVE THE REG CONTAINING THE VAL OF THE VAR
! UNDER THIS NODE FOR USE LATER IN THIS BASIC BLOCK"
RVRSFLG=0,EXOPWD,33,1$, !"VAL OF 2ND SON SHOULD BE
! COMPUTED BEFORE 1ST SON
STOREFLG=0,EXOPWD,32,1$, !RESULT MUST BE STORED AFTER IT IS COMPUTED
RESRFFLG=0,EXOPWD,31,1$, !FLAG FOR "UNDER THIS NODE THERE IS A
! REFERENCE TO THE VAR INTO WHICH THE RESULT
! OF THE WHOLE EXPRESSION WILL BE STORED
USRFNREF=RESRFFLG$, !STATEMENT CONTAINS A USER
!FUNCTION REFERENCE. ONLY ON
!A STATEMENT NODE.
FNCALLSFLG=0,EXOPWD,30,1$, !FLAG FOR "FN CALLS OCCUR UNDER THIS
! NODE
ALCRETREGFLG=0,EXOPWD,29,1$, !VAL OF THIS NODE IS TO BE COMPUTED
! IN THE "FN RETURN REG"
A1VALFLG=0,EXOPWD,28,1$, !FIRST ARG IS A COMMON SUBEXPR THAT
! WAS ALREADY COMPUTED ELSEWHERE
! OR A LEAF
VALINR0=A1VALFLG$, !SET IN ENTRY STATEMENT
!BY GLOBAL ALLOCATOR TO INDICATE
!FUNCTION VALUE IS ALREADY IN
!REGISTER ZERO
LABLARGS=A1VALFLG$, !SET ON A CALL STATEMENT
!ONLY TO INDICATE THERE
!ARE LABEL ARGS
TRUEISBR=A1VALFLG$, !SET ONLY ON LOGICAL IF
!TO INDICATE THE THE TRUE
!BRANCH IS A BRANCH.
A1NOTFLG=0,EXOPWD,27,1$, !APPLY 'NOT' TO 1ST ARG
A1NEGFLG=0,EXOPWD,26,1$, !NEGATE 1ST ARG
A1SAMEFLG=0,EXOPWD,25,1$, !LOC OF COMPUTATION FOR PARENT EQLS
! LOC OF VALUE OF FIRST ARG
A1IMMEDFLG=0,EXOPWD,24,1$, !1ST ARG IS IMMED CONSTANT
A2VALFLG=0,EXOPWD,23,1$, !2ND ARG IS A COMMON SUBEXPR THAT WAS ALREADY
! COMPUTED ELSEWHERE
! OR A LEAF
A2NOTFLG=0,EXOPWD,22,1$, ! APPLY NOT TO 2ND ARG
NOLBLLST=A2NOTFLG$, !USED BY OPTIMIZER ON AN
!ASSIGNED GO TO TO INDICATE
!THAT THE PROGRAMMER DID NOT
!SUPPLY A BRANCH LIST
A2NEGFLG=0,EXOPWD,21,1$, !NEGATE 2ND ARG
A2SAMEFLG=0,EXOPWD,20,1$, !LOC OF COMPUTATION FOR PARENT EQLS
! LOC OF VALUE OF 2ND ARG
OPTCONFLG=A2SAMEFLG$, !FLAG ON THE "CONTINUE" THAT WAS INSERTED BY THE OPTIMIZER
! AT THE END OF THE PROGRAM
A2IMMEDFLG=0,EXOPWD,19,1$, !2ND ARG IS AN IMMED CONSTANT
OPTOBOTHFLG=A2IMMEDFLG$, !IF THIS BIT IS SET **AND** MEMCMPFLG IS
! ALSO SET, THEN PERFORM OPERATION TO "BOTH"
MEMCMPFLG=0,EXOPWD,18,1$; !VALUE COMPUTED TO MEMORY
MACRO CSFULLWDFLG=RVRSFLG$; !IN A COMMON SUBEXPR NODEWHERE THE
! COMMON-SUBEXPR IS A SINGLE VARIABLE (EG A
! VAR USED IN RELATIONALS OR SUBSCRIPTS)
! THIS FLAG IS SET IF THE WHOLE VARIABLE MUST BE LOADED
! (EG IT IS USED IN A RELATIONAL), RATHER
! THAN THE RIGHT-HALF BEING USABLE REGARDLESS OF
! WHATS IN THE LEFT HALF (EG IT IS USED AS A SS ONLY)
MACRO CSSSFLG=A1NOTFLG$; !IN A COMMON SUBEXPR NODE, THIS FLAG IS SET IF THE
! COMMON SUB IS EVER USED AS A SUBSCRIPT
%(***DEFINE SUBFIELDS OF THE FLAGS FIELD***)%
%(*****FLAGS FOR EACH OF THE 2 ARGS***)%
MACRO
A1FLGS=0,EXOPWD,24,5$,
A2FLGS=0,EXOPWD,19,5$;
%(****LAST 4 FLAGS - NEG, NOT, SAME, IMMED****)%
MACRO
A1FLG1=0,EXOPWD,24,4$,
A2FLG1=0,EXOPWD,19,4$;
%(***A2IMMEDFLG CONCATENATED WITH MEMCMPFLG***)%
MACRO A2IMMEMCMPFLGS=0,EXOPWD,18,2$;
%(***NEG AND NOT FLAGS******************)%
MACRO
A1NGNTFLGS=0,EXOPWD,26,2$,
A2NGNTFLGS=0,EXOPWD,21,2$;
%(****TO CLEAR THE FLAGS FOR ARG1, OR FOR ARG2*****)%
MACRO CLRA1FLGS(ANODE)=
ANODE[EXPFLAGS]_.ANODE[EXPFLAGS] AND (NOT #003700)$;
MACRO CLRA2FLGS(ANODE)=
ANODE[EXPFLAGS]_.ANODE[EXPFLAGS] AND (NOT #000076)$;
%(******TO SWAP THE FLAGS FOR ARG1 AND ARG2 (WHEN ARE ALSO SWAPPIG THE 2 ARGS******)%
%(***VALUE FOR A1FLGS OR A2FLGS FIELD WHEN ONLY THE VAL FLG IS SET***)%
BIND VLFLSET=#20;
MACRO
SWAPFLGS(NODE) =
BEGIN
REGISTER T1;
T1_.NODE[A1FLGS];
NODE[A1FLGS]_.NODE[A2FLGS];
NODE[A2FLGS]_.T1;
END $;
%(****TO SET THE FLAGS FOR ARG1 TO THOSE FOR ARG2 AND CLEAR THOSE FOR ARG2 ****)%
MACRO A2TOA1FLGS(NODE)=
BEGIN
NODE[A1FLGS]_.NODE[A2FLGS];
CLRA2FLGS(NODE);
END$;
%(***TO MOVE FLAGS FOR A SON INTO THE FLAG FIELD OF ITS PARENT (WHEN
LINKING THE SON DIRECTLY UP TO THE PARENT'S PARENT***)%
MACRO
RAISEFLGS(PARFLGS,SONFLGS)=
BEGIN
REGISTER T1;
T1_(PARFLGS XOR SONFLGS) AND NGNTFLGMSK; !TAKE XOR OF NEGFLGS AND
! NOTFLGS OF PARENT AND SON
.T1 OR (SONFLGS AND VLIMSMMSK) !USE VALFLG, SAMEFLG
! AND IMMEDFLG FOR SON
END$;
%(***MASK FOR NEG AND NOT FLAGS WITHIN A1FLGS/A2FLGS FIELDS***)%
BIND NGNTFLGMSK=#14;
%(***MASK FOR VALFLG,SAMEFLG, AND IMMEDFLG FIELDS WITHIN A1FLG/A2FLG FIELDS***)%
BIND VLIMSMMSK=#23;
%(*********SUBFIELDS OF TARGET FIELD***********)%
MACRO
INREGFLG=0,2,35,1$, !FLAG FOR VAL LEFT IN A REG
TARGTAC=0,2,23,4$, !AC TO BE COMPUTED IN
TARGAUX=0,2,27,4$, !EXTRA AC TO COMPUTE IN, USED FOR
! RELATIONALS (WHICH ARE "COMPUTED" IN A DIFFERENT
! REG FROM THE ONE THAT HOLDS THE VALUE)
TARGTMEM=0,2,0,23$, !MEMORY REF TO GET AT FINAL RESULT
TARGADDR=0,2,0,18$, !ADDRESS FIELD FOR RETRIEVING RESULT
TARGXF=0,2,18,4$, !INDEX FIELD FOR RETRIEVING RESULT
TARGIF=0,2,22,1$, !INDIRECT FIELD FOR RETRIEVING RESULT
TARGIXF=0,2,18,5$; !INDIRECT AND INDEX FIELDS
%(***TO GET TARGTAC, TARGXF, OR TARGAUX FIELD FROM A TARGET WD INTO THE AC BITS OF AN INSTR***)%
%(****OR TO GET TARGET-REG FOR AN ASSIGNMENT-STATEMENT NODE INTO THE AC BITS OF AN INSTR***)%
MACRO GETTAC(NODE)=(.NODE[TARGET] AND #17^23)$,
GETTXF(NODE)=((.NODE[TARGET] AND #17^18)^5)$,
GETTAUX(NODE)= ((.NODE[TARGET] AND #17^27)^(-4))$,
GETASMNREG(STMNTNODE)= (.STMNTNODE[CW4] AND #17^23)$,
GETAIFREG(AIFNODE)=(.AIFNODE[CW5] AND #17^23)$;
%(***GET THE INDEX AND INDIRECT BITS OF A TARGET WD***)%
MACRO GETTXFI(NODE)=(.NODE[TARGET] AND #37^18)$;
MACRO IXFLD(REG)=REG^18$;
%(************************************************************
DEFINE THE STRUCTURE FOR AN EXPRESSION NODE
************************************************************)%
STRUCTURE PEXPRNODE[FTP,WD,POS,SIZE]=
%(***THE ARG "FTP" SELECTS THE ACCESSING ALGORITHM***)%
CASE .FTP OF SET
%(****FOR MOST FIELDS****)%
(@.PEXPRNODE+.WD)<.POS,.SIZE>
TES;
%(********************************************************
VALUES FOR SUBFIELDS OF OPERATOR FIELD
************************************************************)%
%(*******VALUES FOR VALTYPE FIELD*****)%
BIND
OCTAL=0, !00000
LOGICAL=1, !00001
CONTROL=4, !00100 - CONTROL-TYPE BOOLEAN
DOUBLOCT=8, !01000
LITERAL=12, !01100
INTEGER=16, !10000
BYTE=17, !10001
INDEX=18, !10010
REAL=20, !10100
DOUBLPREC=24, !11000
COMPLEX=28; !11100
%(**NOTE THAT IN THE ABOVE THE 2ND BIT IS A FLAG FOR
DOUBLE WD***)%
%(***NOTE ALSO THAT THE 2ND AND 3RD BITS DETERMINE THE CODE TO BE
GENERATED IN MANY CASES (WHERE INDEX,BYTE,LOG ARE
TREATED AS INTEGER); AND THAT THESE 2 BITS ARE
REFERENCED AS THE FIELD "VALTP1" *******)%
%(***NOTE ALSO THAT IF THE FIRST 3 BITS OF THE VALTYPES OF 2 NODES
ARE IDENTICAL, NO TYPE-CONVERSION OPERATION IS NECESSARY
WHEN COMBINING THE 2 NODES ARITHMETICALLY
*****)%
%(***NOTE ALSO THAT THE OPERSP FIELD FOR A TYPE CONVERSION NODE IS EQUAL
TO THE FIRST 3 BITS OF THE ORIGINAL TYPE
****)%
%(***VALUES FOR VALTP1 FIELD (BITS 2 AND 3 OF VALTYPE)***)%
BIND
INTEG1=VTP1(INTEGER); !00
%(***VALUES FOR VALTP2 FIELD (BITS 1,2,3 OF VALTYPE)***)%
BIND
LOGICAL2=LOGICAL^(-2),
REAL2=REAL^(-2);
%(***TO TEST WHETHER A GIVEN VALTYPE IS DOUBLE-WD***)%
MACRO DBLFROMVAL(VLTP)=
(VLTP^(-3) AND 1)$;
%(***TO TEST WHETHER A VALTYPE IS ONE THAT IS NEVER "CONVERTED",
IE IS ALWAYS USED AS A BIT PATTERN. THE TYPES THAT THIS IS TRUE
OF ARE: LOGICAL,OCTAL,DOUBLE-OCTAL,LITERAL, AND CONTROL***)%
MACRO BITPTNVALTYP(VLTP)=
VLTP LSS INTEGER$;
%(******VALUES FOR OPRCLS FIELD********)%
BIND
BOOLEAN=0, !00000
DATAOPR=1, !00001
RELATIONAL=2, !00010
FNCALL=3, !00011
ARITHMETIC=4, !00100
TYPECNV=5, !00101
ARRAYREF=6, !00110
CMNSUB=7, !00111
NEGNOT=8, !01000
SPECOP=9, !01001 ;A SPECIAL CASE TO BE OPTIMIZED
!(P2MUL,SQUARE,...)
FIELDREF=10, !01010
STORECLS=11, !01011
REGCONTENTS=12, !01100
LABOP=13, !01101
STATEMENT=14, !01110
IOLSCLS=15, !01111 ;ELEMENT IN AN IOLIST
INLINFN=16; !10000 ;A FN TO BE GENERATED IN LINE
%(********VALUES FOR OPERSP FIELD**************)%
%(****FOR OPRCLS BOOLEAN****)%
BIND
ANDOP=0, !000
OROP=1, !001
EQVOP=2, !010
XOROP=3; !011
%(***BIT 35 OF EXOPWD IS USED AS A FLAG IN A BOOLEAN NODE FOR "ARG2HAS VALTYPE
CONTROL, ARG1 IS A MASK" ****)%
%(****FOR OPRCLS DATA ITEM****)%
BIND
CONSTANT=0, !000
TEMPORARY=1, !001
VARIABLE=2, !010
FORMLVAR=3, !011
ARRAYNAME=4, !100
FORMLARRAY=5, !101
FNNAME=6, !110
FORMLFN=7; !111
%(***DEFINE SUBFIELD OF OPERSP FOR DATA-ITEMS THAT DIFFERENTIATES
FN AND FORMAL FN FROM ARRAY AND FORML ARRAY FROM VAR AND FORML VAR***)%
MACRO DATOPS1=OPRSP1$; !FIRST 2 BITS OF OPERSP
%(***DEFINE VALUES OF DATOPS1 FIELD***)%
BIND VARIABL1=1,
ARRAYNM1=2,
FNNAME1=3;
%(***TO TEST FOR AN DATA ITEM AN ENTRY IN THE SYMBOL TABLE (AS OPPOSED TO A
CONSTANT OR TEMPORARY*****)%
MACRO SYMBOL(NODE)=(.NODE[OPERSP] GEQ VARIABLE)$;
%(****FOR OPRCLS RELATIONAL****)%
BIND
L=1, !001
E=2, !010
LE=3, !011
GE=5, !101
N=6, !110
G=7; !111
MACRO
EQREL(MODE) = (MODE AND #1) EQL 0$; !E AND N HAVE LAST BIT=0
MACRO
REVREL(M) = M XOR #6$; !"REVERSE" RELATIONAL FROM M (EG FOR
! REVREL(GE) GET LE )
MACRO
CMREL(M)= M XOR 4$; !TO GET "COMPLEMENT" OF A CONDITION
%(****FOR OPRCLS FNCALL****)%
BIND
NONLIBARY=0, !NOT A LIBRARY FUNCTION
LIBARY=1; !A LIBARY FUNCTION
%(****FOR OPRCLS ARITHMETIC****)%
BIND
ADDOP=0, !000
SUBOP=1, !001
MULOP=2, !010
DIVOP=3, !011
EXPONOP=4; !100
%(***TO TRANSFORM ADD TO SUB, SUB TO ADD; MUL TO DIV, DIV TO MUL***)%
MACRO
CMPLSP(NODE)=
(NODE[OPERATOR]_.NODE[OPERATOR] XOR #40)$; !CHANGE RIGHTMOST BIT OF OPERSP
! (RIGHTMOST BIT OF OPERSP IS
! 5 BITS FROM RIGHT END OF
! OPERATOR FIELD
%(***TEST FOR OPERATOR EITHER ADD OR SUB****)%
MACRO
ADDORSUB(NODE) = .NODE[OPR2] EQL OPR2C(ARITHMETIC,ADDOP)$;
%(***TEST FOR OPERATOR FIELD EITHER MUL OR DIV***)%
MACRO
MULORDIV(NODE) = .NODE[OPR2] EQL OPR2C(ARITHMETIC,MULOP)$;
%(***TO TEST FOR OPERATOR (*KNOWN TO BE ARITH*) EQUAL TO EXPONENTIATION***)%
MACRO
EXPONEN(NODE) = .NODE[OPRSBIT0]$; !FIRST BIT OF OPERSP FIELD
%(***TO TEST FOR OPERATOR (*KNOWN TO BE ARITH*) EQUAL TO SUB OR DIV****)%
MACRO
SUBORDIV(NODE)= (.NODE[OPRSBIT2])$; !3RD BIT OF OPERSP FIELD IS SET FOR
! DIV AND SUB
%(***TO TEST FOR AN OPERATOR (OF UNKNOWN OPRCLS) EQUAL TO ADD OR MUL****)%
MACRO
%(***OPRCLS MUST BE ARITHMETIC, OPERSP MUST HAVE ITS 1ST AND 3RD BITS 0****)%
ADDORMUL(NODE)=((.NODE[OPERWORD] AND (#37^8 OR #5^5)) EQL (ARITHMETIC^8))$;
%(*****TO TEST FOR A NODE OF UNKNOWN OPRCLS TO BE COMMUTATIVE -
VAL IS TRUE FOR ALL BOOLEANS AND FOR ADD AND MUL*********)%
MACRO COMMUTATIVE(NODE)=
(.NODE[OPRCLS] EQL BOOLEAN OR ADDORMUL(NODE) )$;
%(****FOR OPRCLS TYPECNV****)%
BIND
FROMOCT=0, !000
FROMCTL=1, !001
FROMDOCT=2, !010
FROMLIT=3, !011
FROMINT=4, !100
FROMREAL=5, !101
FROMDBLPRC=6, !110
FROMCMPLX=7; !111
%(***NOTE THAT THIS FIELD IS EQUAL TO THE FIRST 3 BITS OF THE VALTYPE
FIELD FOR THE VALUE BEING CONVERTED FROM(THE VALTYPE FIELD
ON THIS NODE SPECIFIES THE TYPE TO CONVERT TO)****)%
MACRO
NOCNVFLG=0,EXOPWD,0,1$; !BIT 35 OF EXOPWD IS USED AS A FLAG FOR "NO ACTUAL
! CONVERSION TAKES PLACE"
%(***TEST WHETHER ANY CODE MUST BE GENERATED FOR A GIVEN TYPE-CONVERSION NODE***)%
MACRO NOCNV(TPCNODE)=
BEGIN
(
(.TPCNODE[NOCNVFLG]) !IF FLAG WAS SET TO NOT ACTUALLY CONVERT
OR
(.TPCNODE[VALTP2] EQL .TPCNODE[OPERSP])
OR
( (.TPCNODE[OPERSP] LSS FROMINT) !CONVERTING FROM LOGICAL/OCTAL
! OR DOUBLE-OCTAL OR CONTROL OR LITERAL
AND
( (NOT .TPCNODE[DBLFLG]) OR .TPCNODE[SDBLFLG]) !AND IF THE DESTIN IS
!DBL WD, SO IS THE SRC
)
)
AND (NOT .TPCNODE[A2IMMEDFLG]) !IF THE ARG UNDER THE TYPE-CNV
! IS THE RIGHT HALF OF AN AOBJN VAR,
! MUST LOAD IT
END$;
%(***FOR OPRCLS NEGNOT***************************)%
BIND
NEGOP=0,
NOTOP=1;
%(****FOR OPRCLS SPECOP (SPECIAL OPS INTRODUCED BY PHASE 2 SKEL)***)%
BIND
P2MULOP=0, !MULTIPLY BY A POWER OF 2
P2DIVOP=1, !DIVIDE BY A POWER OF 2
P2PL1OP=2, !MULTIPLY BY A POWER OF 2 PLUS 1
EXPCIOP=6; !RAISE TO A CONSTANT INTEGER POWER
! (NOT HANDLED IN RELEASE 1)
%(***FOR OPRCLS STORECLS****************************)%
BIND
STARVAL=0, !STORE CONTENTS OF AN ARRAY ELEM
STARADDR=1; !STORE PTR TO AN ARRAY ELEMENT
%(***FOR OPRCLS IOLSCLS (FOR IOLIST ELEMENTS)***)%
BIND
DATACALL=0, !SINGLE DATA ITEM
SLISTCALL=1, !ARRAY REFERENCED WITHOUT SUBSCRIPTS
IOLSTCALL=2, !GROUP OF OTHER IOLSTCALL NODES
E1LISTCALL=3, !FOLDED IMPLIED DO LOOPS CREATED
E2LISTCALL=4, !BY GLOBAL OPTIMIZER ONLY DURING PHASE2
ESNGLELEM=5, !SINGLE WORD ITEM UNDER AN ELISTCALL
EDBLELEM=6; !DOUBLE WORD ITEM UNDER AN ELISTCALL
%(***FOR OPRCLS INLINFN (FNS TO BE GENERATED IN LINE)****)%
BIND
ABSFN=0,
CMPLXFN=1,
SIGNFN=2,
DIMFN=3,
MODFN=4,
MAXFN=5,
MINFN=6;
%(***MACRO TO DETERMINE FOR A GIVEN IN-LINE-FN WHETHER THE ARG SHOULD BE PUT
INTO THE REG-FOR-COMPUTATION BEFORE THE VAL IS COMPUTED (FOR ABS,IABS
AND SIGN, DO NOT WANT TO LOAD THE ARG IN ADVANCE) ****)%
MACRO ILFINRFC(OPSP)=(OPSP GEQ DIMFN)$;
%(****VALS FOR OPR1 FIELD FOR SOME OF THE OPERATORS*****)%
BIND
ADDOPF=OPR1C(ARITHMETIC,ADDOP),
SUBOPF=OPR1C(ARITHMETIC,SUBOP),
MULOPF=OPR1C(ARITHMETIC,MULOP),
DIVOPF=OPR1C(ARITHMETIC,DIVOP),
EXPONOPF=OPR1C(ARITHMETIC,EXPONOP),
CONSTFL=OPR1C(DATAOPR,CONSTANT),
VARFL=OPR1C(DATAOPR,VARIABLE),
FMLVARFL=OPR1C(DATAOPR,FORMLVAR),
FMLARRFL=OPR1C(DATAOPR,FORMLARRAY),
NEGFL=OPR1C(NEGNOT,NEGOP),
MODFNFL=OPR1C(INLINFN,MODFN),
STARVLFL=OPR1C(STORECLS,STARADDR),
SLISTCLFL=OPR1C(IOLSCLS,SLISTCALL);
BIND
P2MULOPF=OPR1C(SPECOP,P2MULOP),
P2DIVOPF=OPR1C(SPECOP,P2DIVOP),
P2PL1OPF=OPR1C(SPECOP,P2PL1OP);
BIND
EXPCIF=OPR1C(SPECOP,EXPCIOP);
%(***VALUES OF OPERATOR FIELD FOR SOME OF THE OPERATORS***)%
BIND REALCONST=OPERC(REAL,DATAOPR,CONSTANT),
INTCONST=OPERC(INTEGER,DATAOPR,CONSTANT),
DOUBLCONST=OPERC(DOUBLPREC,DATAOPR,CONSTANT),
CPLXCONST=OPERC(COMPLEX,DATAOPR,CONSTANT),
LITCONST=OPERC(LITERAL,DATAOPR,CONSTANT),
INTVAR=OPERC(INTEGER,DATAOPR,VARIABLE),
INDEXVAR=OPERC(INDEX,DATAOPR,VARIABLE);
BIND INTDIVIDE=OPERC(INTEGER,ARITHMETIC,DIVOP);
BIND INTADD=OPERC(INTEGER,ARITHMETIC,ADDOP);
BIND CMPMUL=OPERC(COMPLEX,ARITHMETIC,MULOP),
CMPDIV=OPERC(COMPLEX,ARITHMETIC,DIVOP);
BIND ABSFNOP=OPERC(REAL,INLINFN,ABSFN),
IABSFNOP=OPERC(INTEGER,INLINFN,ABSFN),
DABSFNOP=OPERC(DOUBLPREC,INLINFN,ABSFN),
CMPLXFNOP=OPERC(COMPLEX,INLINFN,CMPLXFN),
SIGNFNOP=OPERC(REAL,INLINFN,SIGNFN),
ISIGNFNOP=OPERC(INTEGER,INLINFN,SIGNFN),
DIMFNOP=OPERC(REAL,INLINFN,DIMFN),
IDIMFNOP=OPERC(INTEGER,INLINFN,DIMFN),
MODFNOP=OPERC(INTEGER,INLINFN,MODFN),
MAXFNOP=OPERC(INTEGER,INLINFN,MAXFN),
MINFNOP=OPERC(INTEGER,INLINFN,MINFN),
AMAXFNOP=OPERC(REAL,INLINFN,MAXFN),
AMINFNOP=OPERC(REAL,INLINFN,MINFN);
BIND CMPLXOP=OPERC(COMPLEX,TYPECNV,FROMREAL),
DBLEOP=OPERC(DOUBLPREC,TYPECNV,FROMREAL),
DFLOATOP=OPERC(DOUBLPREC,TYPECNV,FROMINT),
FLOATOP=OPERC(REAL,TYPECNV,FROMINT),
IDINTOP=OPERC(INTEGER,TYPECNV,FROMDBLPRC),
INTOP=OPERC(INTEGER,TYPECNV,FROMREAL),
IFIXOP=OPERC(INTEGER,TYPECNV,FROMREAL),
REALOP=OPERC(REAL,TYPECNV,FROMCMPLX),
SNGLOP=OPERC(REAL,TYPECNV,FROMDBLPRC);
BIND LTOP=OPERC(CONTROL,RELATIONAL,L),
EQOP=OPERC(CONTROL,RELATIONAL,E),
LEOP=OPERC(CONTROL,RELATIONAL,LE),
GEOP=OPERC(CONTROL,RELATIONAL,GE),
NEOP=OPERC(CONTROL,RELATIONAL,N),
GTOP=OPERC(CONTROL,RELATIONAL,G);
BIND FIXOP=OPERC(INTEGER,TYPECNV,FROMREAL);
BIND IOLSTCFL=OPERC(0,IOLSCLS,IOLSTCALL),
E1LISTCFL=OPERC(0,IOLSCLS,E1LISTCALL),
E2LISTCFL=OPERC(0,IOLSCLS,E2LISTCALL),
DATACLFL=OPERC(0,IOLSCLS,DATACALL);
BIND DOSTATEMENT=STOPERC(STATEMENT,DOID);
BIND CONTSTATEMENT=STOPERC(STATEMENT,CONTID);
%(***DEFINE OPRCLS+SRCID FOR STATEMENTS***)%
MACRO
OPERS(OPCLS,SORCID)=(OPCLS^7+SORCID)$, !DEFINE CONCATENATED FIELDS
OPRS=0,EXOPWD,1,12$; !DEFINE OPRS FIELD
BIND
ASGNOS=OPERS(STATEMENT,ASGNID),
ASSIOS=OPERS(STATEMENT,ASSIID),
CALLOS=OPERS(STATEMENT,CALLID),
CONTOS=OPERS(STATEMENT,CONTID),
DOOS=OPERS(STATEMENT,DOID),
ENTROS=OPERS(STATEMENT,ENTRID),
COMNOS=OPERS(STATEMENT,COMNSUB),
GOTOOS=OPERS(STATEMENT,GOTOID),
AGOOS=OPERS(STATEMENT,AGOID),
CGOOS=OPERS(STATEMENT,CGOID),
IFAOS=OPERS(STATEMENT,IFAID),
IFLOS=OPERS(STATEMENT,IFLID),
RETUOS=OPERS(STATEMENT,RETUID),
STOPOS=OPERS(STATEMENT,STOPID),
READOS=OPERS(STATEMENT,READID),
WRITOS=OPERS(STATEMENT,WRITID),
DECOOS=OPERS(STATEMENT,DECOID),
ENCOOS=OPERS(STATEMENT,ENCOID),
REREDOS=OPERS(STATEMENT,REREDID),
FINDOS=OPERS(STATEMENT,FINDID),
CLOSOS=OPERS(STATEMENT,CLOSID),
INPUOS=OPERS(STATEMENT,INPUID),
OUTPOS=OPERS(STATEMENT,OUTPID),
BACKOS=OPERS(STATEMENT,BACKID),
BKFILOS=OPERS(STATEMENT,BKFILID),
REWDOS=OPERS(STATEMENT,REWDID),
SKFILOS=OPERS(STATEMENT,SKFILID),
SKRECOS=OPERS(STATEMENT,SKRECID),
UNLODOS=OPERS(STATEMENT,UNLODID),
RELSOS=OPERS(STATEMENT,RELSID),
ENDFOS=OPERS(STATEMENT,ENDFID),
ENDOS=OPERS(STATEMENT,ENDID),
PAUSOS=OPERS(STATEMENT,PAUSID),
OPENOS=OPERS(STATEMENT,OPENID),
SFNOS=OPERS(STATEMENT,SFNID),
FORMOS=OPERS(STATEMENT,FORMID),
BLTOS=OPERS(STATEMENT,BLTID),
REGOS=OPERS(STATEMENT,REGMASK);
%(********VALUES FOR SPECIAL OPERATOR SUBFIELDS***********)%
%(****USED FOR OPRCLS BOOLEAN*****)%
BIND
ANDORCLS=0, !VALUE OF BOOLCLS FOR AND/OR NODES
ANDOPF=0, !VALUE OF BOPRFLG FOR AND/EQV NODES
XOROROPF=1; !VALUE OF BOPRFLG FOR OR/XOR NODES
%(****************************************
TO CHECK FOR VALUES THAT FIT IN SINGLE WD
****************************************)%
MACRO SINGLWD(NODE)= NOT (.NODE[DBLFLG])$;
%(***************************************************************************
TO TEST A CONSTANT NODE FOR BEING AN IMMEDIATE-SIZE CONSTANT
***************************************************************************)%
MACRO IMMEDCNST(NODE)=
BEGIN
EXTERNAL KDPRL; !THESE GLOBALS ARE USED IN CALLING THE MACRO MODULE
EXTERNAL C1H,C1L,C2H,COPRIX; ! THAT ROUNDS REAL NUMBERS
EXTERNAL CNSTCM;
CASE .NODE[VALTP1] OF SET
%(***INTEGER CONSTANTS ARE IMMED SIZE IFF LH OF ABSOLUTE VAL IS 0***)%
((ABS(.NODE[CONST2]) AND #777777000000) EQL 0);
%(***REAL CONSTANTS ARE IMMED SIZE IFF THE RIGHT HALF WD IS
ALL 0'S*******)%
BEGIN
%(***BECAUSE WE KEEP 2 WDS OF PRECISION THRUOUT COMPILE TIME,
WE MUST EXAMINE WHAT THE ROUNDED CONSTANT WILL BE***)%
C1H_.NODE[CONST1]; C1L_.NODE[CONST2]; COPRIX_KDPRL; !ROUND THE NUMBER IN C1H-C1L
CNSTCM(); ! LEAVING THE RESULT IN C2H
(.C2H AND #777777) EQL 0
END;
%(***DOUBLE-PREC CONSTANTS CAN NOT BE TREATED IMMED MODE***)%
FALSE;
%(***COMPLEX CONSTANTS CAN BE TREATED IMMED MODE IFF THE REAL PART IS
IMMED SIZE AND THE IMAGINARY PART IS 0***)%
((.NODE[CONST1] AND #777777) EQL 0) AND (.NODE[CONST2] EQL 0)
TES
END$;
%(***TO TEST FOR A CONSTANT NEGATIVE***********)%
MACRO NEGATIVC(CNNODE)=
BEGIN
IF .CNNODE[VALTP1] EQL INTEG1
THEN
.CNNODE[CONST2] LSS 0
ELSE
.CNNODE[CONST1] LSS 0
END$;
%(*****************OPCODE FIELDS USED EXPLICITLY***************************)%
BIND
JRSTOC=#254^27,
JUMPOC=#320^27,
SKIPOC=#330^27,
SKIPGEOC=#335^27;
BIND
INDBIT=1^22; !INDIRECT BIT
BIND
ADDBOCD=#273,
ADDIOCD=#271,
ADDMOCD=#272,
AOJAOCD=#344,
AOSOCD=#350,
ASHOCD=#240,
CAIOCD=#300,
CAMOCD=#310,
DMOVEOCD=#120,
DMOVEMOCD=#124,
FADRBOCD=#147,
FADRMOCD=#146,
FDVRMOCD=#176,
FIXOCD=#122,
FLTROCD=#127,
FSCOCD=#132,
HRLZIOCD=#515,
IDIVMOCD=#232,
IMULMOCD=#222,
JRSTOCD=#254,
JUMPOCD=#320,
JUMPGEOCD=#325,
JUMPLOCD=#321,
MOVEIOCD=#201,
MOVEOCD=#200,
MOVEMOCD=#202,
MOVNOCD=#210,
MOVNIOCD=#211,
MOVNMOCD=#212,
MOVNSOCD=#213,
MOVSIOCD=#205,
SETCAMOCD=#452,
SETCMOCD=#460,
SETCMBOCD=#463,
SETZBOCD=#403,
SETOBOCD=#477,
SKIPOCD=#330,
SOJAOCD=#364,
SOSOCD=#370,
SUBIOCD=#275,
PUSHJOCD=#260, ![253]
DIVOCD=#230, ![253]
XCTOCD=#256, ![261]
SUBMOCD=#276;
%(***************************************************************************
DEFINE THE FIELDS OF THE NODES USED FOR IOLISTS (OPRCLS=IOLSCLS)
***************************************************************************)%
%(***
A BRIEF PICTURE (DATACALL NODES HAVE ONLY 2 WORDS
SLISTCALL NODES HAVE 3 WORDS)
-----------------------------------------
0 ! IOLSTLBL AND ! CLINK !
! IOLCMPLX ! !
-----------------------------------------
1 ! IOLSTPTR ! OPERATOR !
-----------------------------------------
2 ! IOLALTCMPLX ! IOLCOMNSUB OR !
! ! SCALLCT !
-----------------------------------------
3 ! E1INCR (E1LISTCALL) ! ECNTPTR !
-----------------------------------------
AN EALISTCALL NODE
-----------------------------------------
0 ! E2INCR (E2LISTCALL) ! CLINK !
-----------------------------------------
1 ! E2ARREFPTR ! OPERATOR !
-----------------------------------------
***)%
%(***FIELDS IN ALL IOLSCLS NODES***)%
MACRO
IOLSTLBL=0,0,LEFT$;
%(***FIELDS IN DATACALL NODES***)%
MACRO
DCALLELEM=0,1,LEFT$;
%(***FIELDS IN SLISTCALL NODES***)%
MACRO
SCALLELEM=0,1,LEFT$,
SCALLCT=0,2,RIGHT$;
%(***FIELDS IN IOLSTCALL NODES***)%
MACRO
IOLSTPTR=0,1,LEFT$, !PTR TO LINKED LIST OF SUBNODES
IOLCMPLX=SRCCMPLX$, !COMPLEXITY
IOLCOMNSUB=SRCCOMNSUB$, !COMMON SUBEXPRESSIONS
IOLALTCMPLX=0,2,LEFT$; !ALTERNATE COMPLEXITY IN
!E1LISTCALL AND E2LISTCALL NODES
%(***FIELDS IN E1LISTCALL AND E2LISTCALL NODES***)%
MACRO
ECNTPTR=0,3,RIGHT$, !PTR TO EXPRESSION FOR NUMBER OF ELEMS
! OF EACH ARRAY TO BE PROCESSED
ELSTPTR=0,1,LEFT$; !PTR TO LINKED LIST OF ARRAY REFS
%(***FIELDS IN E1LISTCALL NODES***)%
MACRO
E1INCR=0,3,LEFT$;
%(***FIELDS OF THE ELEMENTS OF THE LINKED LIST UNDER AN E2LISTCALL***)%
MACRO
E2INCR=0,0,LEFT$, !PTR TO EXPRESSION FOR INCREMENT TO BE
! USED FOR THIS ARRAY
E2ARREFPTR=0,1,LEFT$; !PTR TO ARRAYREF NODE
%(***************************************************************************
DEFINE AN OBJECT-CODE WORD AS A STRUCTURE.
DEFINE THE FIELDS OF THAT WORD FOR FOROTS ARG BLOCKS.
***************************************************************************)%
STRUCTURE OBJECTCODE[WD,POS,SIZE]=
(.OBJECTCODE+.WD)<.POS,.SIZE> ;
%(***DEFINE THE FIELDS OF AN INSTRUCTION***)%
MACRO
OBJADDR=0,0,18$, !ADDRESS FIELD
OBJIXF=0,18,5$, !INDIRECT AND INDEX FIELDS
OBJREG=0,23,4$, !REGISTER FIELD
OBJOPCOD=0,27,9$; !OPCODE
%(***DEFINE THE FIELDS USED FOR FOROTS ARG BLOCKS***)%
MACRO
OTSWHOLE=0,0,36$,
OTSCNT=0,27,9$,
OTSTYPE=0,23,4$, !VALUE-TYPE ALWAYS GOES IN BITS 9-12
OTSINX=0,18,4$, !INDEX FIELD
OTSIND=0,22,1$, !INDIRECT BIT
OTSADDR=0,0,18$, !ADDRESS FIELD
OTSUNIT=0,0,18$, !UNIT NUMBER ALWAYS GOES INTO BITS 18-35
OTSFORM=0,0,18$, !PTR TO FORMAT
OTSARRFMTFLG=0,35,1$, !FLAG FOR "FORMAT STMNT IS AN ARRAY"
OTSFSIZ=0,18,17$, !FORMAT SIZE
OTSIDN=0,27,9$, !FOR AN IOLIST ELEMENT - IDENTIFIES THE CLASS OF ELEM
OTSMEMRF=0,0,23$; !THE 23 BITS DESCRIBING MEMORY REFERENCE
%(***DEFINE VALUES FOR IDN FIELD FOR IOLIST ELEMENTS***)%
BIND
OTSZER=0,
OTSDATA=1,
OTSSLIST=2,
OTSELIST=3,
OTSFIN=4;
BIND
OTSZERWD=OTSZER^27,
OTSFINWD=OTSFIN^27;
%(***DEFINE ARG TYPE CODES THAT ARE USED FOR FOROTS CALLS***)%
BIND ADDRTYPE=#7, !TYPE CODE FOR A LABEL
IMMEDTYPE=0; !TYPE CODE INDICATING TO PICK UP ARG IMMED MODE
%(***************************************************************************
SPECIFIC VALUES FOR FIELDS IN AN ARITHMETIC-IF NODE
***************************************************************************)%
%(***VALUES FOR AIFLBEQV FIELD****)%
BIND
NOLBEQV=0,
LELBEQV=1, !LSS LABEL SAME AS EQL LABEL
LGLBEQV=2, !LSS LABEL SAME AS GTR LABEL
GELBEQV=3; !GTR LABEL SAME AS EQL LABEL
%(***VALUES FOR AIFLBNXT FIELD*******)%
BIND
NOLBNXT=0,
LLBNXT=1, !LSS LABEL IS NEXT STMNT
ELBNXT=2, !EQL LABEL IS NEXT STMNT
GLBNXT=3; !GTR LABEL IS NEXT STMNT
%(***WHEN SWAP THE GTR AND LESS LABELS (BECAUSE MULTIPLY BY -1), USE THE
FOLLOWING MACRO TO ADJUST THE "AIFLBNXT" AND "AIFLBEQV" FIELDS***)%
MACRO SWPAIFFLGS(STMNT)=
BEGIN
IF .STMNT[AIFLBNXT] !IF LAST BIT OF AIFLBNXT IS ON
THEN
STMNT[AIFLBNXT]_.STMNT[AIFLBNXT] XOR #2; !THEN COMPLEMENT 1ST BIT
IF .STMNT[AIFLBEQV] !IF LAST BIT OF AIFLBEQV ON
THEN
STMNT[AIFLBEQV]_.STMNT[AIFLBEQV] XOR #2; !THEN COMPLEMENT 1ST BIT
END$;
%(***************************************************************************
DEFINE THE STRUCTURE OF AN ARGUMENT LIST.
CERTAIN FIXED FIELDS ON THE LIST WILL BE REFERENCED SIMPLY BY NAME.
FIELDS CORRESPONDING TO THE NTH ARG WILL BE REFERENCED BY [N,NAME]
NOTE THAT THE FIRST ARG HAS N=1 (NOT!!!! 0)
NOTE THAT THE COUNT FIELD OF THE LIST WILL BE POSITIVE AND EQUAL
TO THE NUMBER OF ARGS.
***************************************************************************)%
STRUCTURE ARGUMENTLIST[ARGINDEX,WD,POS,SIZE]=
(@.ARGUMENTLIST+2+(.ARGINDEX-1)+.WD)<.POS,.SIZE>;
%(***DEFINE THE FIXED FIELDS THAT OCCUR AT THE START OF EVERY ARGUMENT LIST -
DEFINE ALL THESE FIELDS IN TERMS OF A NEGATIVE NUMBER OF WDS FROM THE
ENTRY FOR THE FIRST ARGUMENT (HENCE HAVE THE ARGINDEX FIELD=1) ***)%
MACRO
ARGLABEL=1,-2,LEFT$,
ARGLINK=1,-2,RIGHT$,
ARGCOUNT=1,-1,RIGHT$;
%(***DEFINE THE FIELDS THAT ARE REPEATED FOR EACH ARGUMENT.
WILL ALWAYS REFERENCE THESE FIELDS BY A REF OF THE FORM:
ALIST[N,FIELDNAME]
WHERE N IS THE NUMBER OF THE ARGUMENT DESIRED
*********)%
MACRO
ARGNPTR=0,RIGHT$, !PTR TO THE EXPRESSION NODE FOR THE ARG
AFLGFLD=0,LEFT$, !FLAGS
AVALFLG=0,35,1$; !FLAG IS SET IF ARG IS A DATA ITEM OR
! COMMON SUBEXPR
%(***DEFINE THE FOLLOWING FIELD SO THAT PHASE 1 CAN REFERENCE THE AVALFLG
BY USING A "BASE" STRUCTURE ON A GIVEN WORD*****)%
MACRO P1AVALFLG=0,0,35,1$;
%(***DEFINE MACRO THAT DESCRIBES NUMBER OF WDS NECESSARY IN AN ARGLIST THAT
INCLUDES "ACT" NUMBER OF ARGS***)%
MACRO ARGLSTSIZE(