5 * Revision 1.2 1996/04/18 16:12:30 mclareni
6 * Incorporate changes from J.Zoll for version 3.77
8 * Revision 1.1.1.1 1996/03/06 10:47:20 mclareni
12 #include "zebra/pilot.h"
15 C- Find the 4 largest gaps,
16 C- gaps 3 + 4 may be inside the moving memory region
17 C- defined by JQSTMV,JQDVM1+2,NQDVMV
18 C- gaps 1 + 2 must be outside the moving memory region
20 C- Entry 'J' in the table contains :
21 C- IQGAP(1,J) = number of words available
22 C- IQGAP(2,J) = abs. zebra adr of first word in the gap
23 C- IQGAP(3,J) = division number
24 C- IQGAP(4,J) = store number
25 C- IQGAP(5,J) user flag
27 C- Original meaning of JQSTMV,JQDVM1,JQDVM2,NQDVMV (cf. MZTABS):
28 C- unless JQSTMV<0, the divisions JQDVM1 to JQDVM2 inclusive
29 C- of the store JQSTMV may have to be shifted by NQDVMV words,
30 C- to the left if -ve, to the right if +ve.
31 C- NQDVMV=0 means to the left by a yet unknown amount.
32 C- It follows that the gaps after divisions JDIV are not available
33 C- for the relocation table because they may be over-written
34 C- by the memory move, with :
35 C- NQDVMV 0, -ve : JDIV = <JQDVM1-1,JQDVM2-1>
36 C- +ve : JDIV = <JQDVM1, JQDVM2 >
38 C- MZFGAP is also used for I/O to find a gap where to put the
39 C- relocation table on input. In this case there is just one
40 C- gap unavailable, namely the one which will receive the data.
41 C- This is the gap before a reverse division (JQMODE=1) or after
42 C- a forward division (JQMODE=0). To block this gap one can give
43 C- JQDVM1=JQDVM2=JDIV and NQDVMV=1-2*JQMODE, setting JQSTMV also.
45 #include "zebra/zstate.inc"
46 #include "zebra/zunit.inc"
47 #include "zebra/mqsys.inc"
48 #include "zebra/mzct.inc"
49 C-------------- End CDE --------------
50 DIMENSION NGAPV(7), JDIVV(7), JSTOV(7), JPV(7)
51 EQUIVALENCE (NGAPV(1),IQUEST(11)), (JDIVV(1),IQUEST(21))
52 EQUIVALENCE (JSTOV(1),IQUEST(31)), (JPV(1), IQUEST(41))
54 EQUIVALENCE (NQGAPV(1),NQGAPN)
62 IF (JQSTMV.LT.0) GO TO 19
66 IF (NQDVMV.GT.0) GO TO 19
67 IF (JDVSH1.EQ.IQTABV(KT+9)) JDVSH1=IQTABV(KT+8)+1
75 C------ Loop all stores
79 IF (JSTO.GT.NQSTOR) GO TO 61
80 IF (NQALLO(JSTO+1).LT.0) GO TO 21
85 C---- Loop all divisions
88 IF (JDIV.EQ.21) GO TO 21
90 IF (JDIV.EQ.IQTABV(KT+8)) JDVN=IQTABV(KT+9)
92 NWGAP = LQSTA(KT+JDVN) - LQEND(KT+JDIV)
93 IF (NWGAP.LT.164) GO TO 31
94 IF (JSTO.NE.JQSTMV) GO TO 41
95 IF (JDIV.LT.JDVSH1) GO TO 41
96 IF (JDIV.GT.JDVSH2) GO TO 41
98 C-- Gap in moving region
100 IF (NWGAP.LE.MINGV) GO TO 31
101 NGAPV(JMINGV) = NWGAP
106 IF (MINGV.LE.NGAPV(6)) GO TO 31
111 C-- Gap in non-moving region
113 41 IF (NWGAP.LE.MINGN) GO TO 31
114 NGAPV(JMINGN) = NWGAP
120 IF (MINGN.LE.NGAPV(J)) GO TO 44
126 C------- Store the result
131 C-- Sort non-moving gaps
136 IF (NGAPV(JF).LT.NGAPV(JN)) GO TO 67
137 IF (JG.EQ.3) GO TO 71
143 IF (JG.EQ.1) GO TO 66
152 IF (NGAPV(JF).LT.NGAPV(JN)) GO TO 77
153 IF (JG.EQ.5) GO TO 81
159 IF (JG.EQ.3) GO TO 76
163 C-- Store 4 biggest gaps
171 IF (NWGAP.EQ.0) GO TO 87
177 IQGAP(2,JG) = KS+ LQEND(KT+JDIV)
183 NQGAP = MAX (NQGAPN,NQGAP)
184 #if defined(CERNLIB_QDEVZE)
186 +WRITE (IQLOG,9888) NQGAPV,(JG,(IQGAP(J,JG),J=1,5),JG=1,NQGAP)
187 9888 FORMAT (1X/' DEVZE MZFGAP, NQGAPN,NQGAP=',2I4
188 F/16X,' JGAP SIZE LOC JDIV JSTO USED'
193 * ==================================================
194 #include "zebra/qcardl.inc"