! fmap1 ! 10/10/86 - insert include files ! ftnmap5 ! 12/08/86 - NAMELIST to lower case ! ftnmap4 !* modified 27/11/85 !* %include "ftn_ht" {%include "ftn_consts3"} !* modified 23/09/86 !* !* %constinteger WSCALE = 2;! scale word address to byte address %constinteger BSCALE = 0;! scaling factor for words to architectural units %constinteger CSCALE = 0;! byte offset to architectural unit offset %constinteger DSCALE = 2;! dict pointer scaling in RES records !* %constinteger W1 = 4 ;! 1 word in architectural units %constinteger W2 = 8 ;! 2 words in architectural units %constinteger W3 = 12 ;! 3 words in architectural units %constinteger W4 = 16 ;! 4 words in architectural units !* %constinteger TRIADLENGTH = 12 ;! size of an individual triad %constinteger BLRECSIZE = 44 ;! size of a block table entry in architectural units %constinteger LOOPRECSIZE = 16 ;! size of a loop table entry %constinteger PROPRECSIZE = 12 ;! size of a propagation table entry %constinteger CLOOPSZ = 12 ;! size of cloop table entry %constinteger FRSIZE = 8 ;! size of freelist created by PUSHFREE %constinteger TESZ = 20 %constinteger DTSZ = 20 %constinteger ARTICSZ = 4 %constinteger CTSIZE = 2 ;! used in OP3 %constinteger EXTNSIZE = 4 ;! used in OP3 !* !* following used in strength reduction !* %constinteger RDSZ = 8 %constinteger RUSESZ = 12 %constinteger RTESTSZ = 4 %constinteger RDEFSZ = 16 %constinteger USESZ = 32 %constinteger SRUSESZ = 2 %constinteger SRSCALE = 2;! SR==RECORD(ABLOCKS + SRPTR<= B L = A; U = B D = X(U) E = PL(U) -> FIND UP: L = L+1 -> FOUND %IF L = U FIND: -> UP %UNLESS X(L) > D X(U) = X(L) PL(U) = PL(L) DOWN: U = U-1 -> FOUND %IF L = U -> DOWN %UNLESS X(U) < D X(L) = X(U) PL(L) = PL(U) -> UP FOUND: X(U) = D PL(U) = E QKSORT(X,PL,A,L-1) QKSORT(X,PL,U+1,B) %END; ! QKSORT %ROUTINE PRINTOUT(%INTEGER L) %INTEGER T, C, I, J, K, S, LEN %STRING (32) ID %RECORD(PRECF) %NAME PP %RECORD(SRECF) %NAME SS %ROUTINESPEC PUT(%STRING(20) S) %ROUTINESPEC WRIT(%INTEGER I) %CONSTSTRING(2)%ARRAY SIZE(3:8)="1 ","2 ","4 ","8 ","16","32" %CONSTSTRING(10)%ARRAY TYPE(1:5)= %C "integer*","real*","complex*","logical*","character*" %CONSTSTRING(10)%ARRAY SUBPROG(0:3)= %C "program","function","subroutine","entry" %CONSTSTRING(18)%ARRAY SPECIAL(10:13)= %C "namelist","","common block","statement function" !* PP==RECORD(ADICT+L) %RETURN %IF PP_X1>>4=15;! STANDARD FUNCTION NEWLINE ID=STRING(ANAMES+PP_IDEN) PRINTSTRING(ID) LEN=LENGTH(ID) I=12-LEN %IF I<=0 %THEN I=1 SPACES(I) LEN=LEN+I C=PP_CLASS&X'1F' T=PP_TYPE&15 S=PP_TYPE>>4 %IF C<7 %THENSTART;! VARIABLE OR ARRAY %IF C&1#0 %THEN PUT("parameter ") %IF C&2#0 %AND PP_X0&X'10'=0 %THEN PUT("common ") %IF PP_X1&X'80'#0 %THEN PUT("equivalenced ") %IF C&4#0 %THEN PUT("array, ") %C %ELSE PUT("variable, ") T: %IF PP_X0&8=0 %THEN PUT("implicit ") PUT(TYPE(T)) %IF T=5 %THENSTART;! CHARACTER %IF PP_LEN=0 %THEN PUT("(*)") %ELSE WRIT(PP_LEN) %FINISHELSESTART %IF T=3 %THEN S=S+1 PUT(SIZE(S)) %FINISH %FINISHELSESTART;! SPECIAL IDEN %IF C=16 %THENSTART PUT("constant, ") ->T %FINISH %IF C<10 %OR C=11 %THENSTART;! SUBPROGRAM %IF C#11 %THEN PUT("external ") PUT(SUBPROG((PP_X1>>4)&3)) %FINISHELSESTART PUT(SPECIAL(C)) %FINISH %FINISH %RETURN %IF XREF=0;! NOXREF SPACES(51-LEN) SPACE I=PP_XREF;! LISTHEAD OF REFS J=0 %WHILE I#0 %CYCLE;! REVERSE LIST K=I SS==RECORD(ADICT+I) I=SS_LINK1 SS_LINK1=J J=K %REPEAT PP_XREF=J J=L+IDRECSIZE K=0;! FOR NOTE OF LAST LINE WRITTEN L=5 %WHILE J#0 %CYCLE SS==RECORD(ADICT+J) I=SS_INF0 %IF I#K %THENSTART K=I %IF L=0 %THEN NEWLINE %AND SPACES(52) %AND L=5 L=L-1 WRITE(I,4) %FINISH J=SS_LINK1 %REPEAT %RETURN %ROUTINE PUT(%STRING(20) S) PRINTSTRING(S) LEN=LEN+LENGTH(S) %END;! PUT %ROUTINE WRIT(%INTEGER A) %CONSTINTEGERARRAY M(0:3)=10000,1000,100,10 %INTEGERARRAY B(0:4) %INTEGER I,J %CYCLE I=0,1,3 B(I)=A//M(I) A=A-B(I)*M(I) %REPEAT B(4)=A J=0 %CYCLE I=0,1,4 %IF B(I)#0 %OR J#0 %OR I=4 %THENSTART PRINTSYMBOL(B(I)+'0') LEN=LEN+1 J=1 %FINISH %REPEAT %RETURN %END;! WRIT %END; ! PRINTOUT !* %END; ! MAP !* %ENDOFFILE