home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / g-format / part4 / gfloat / f77 / src / f77pass1 / vax.c.diff < prev   
Encoding:
Text File  |  1986-11-30  |  5.5 KB  |  306 lines

  1. *** ../f77/src/f77pass1/vax.c.orig    Tue Oct 29 15:16:18 1985
  2. --- ../f77/src/f77pass1/vax.c    Tue Oct 29 15:23:13 1985
  3. ***************
  4. *** 69,74
  5.   
  6.   ftnint intcon[14] =
  7.       { 2, 2, 2, 2,
  8.         15, 31, 24, 56,
  9.         -128, -128, 127, 127,
  10.         32767, 2147483647 };
  11.  
  12. --- 69,75 -----
  13.   
  14.   ftnint intcon[14] =
  15.       { 2, 2, 2, 2,
  16. + #ifndef GFLOAT
  17.         15, 31, 24, 56,
  18.         -128, -128, 127, 127,
  19.   #else GFLOAT
  20. ***************
  21. *** 71,76
  22.       { 2, 2, 2, 2,
  23.         15, 31, 24, 56,
  24.         -128, -128, 127, 127,
  25.         32767, 2147483647 };
  26.   
  27.   #if HERE == VAX
  28.  
  29. --- 72,81 -----
  30.   #ifndef GFLOAT
  31.         15, 31, 24, 56,
  32.         -128, -128, 127, 127,
  33. + #else GFLOAT
  34. +       15, 31, 24, 53,
  35. +       -128, -1024, 127, 1023,
  36. + #endif GFLOAT
  37.         32767, 2147483647 };
  38.   
  39.   #if HERE == VAX
  40. ***************
  41. *** 78,83
  42.   long realcon[6][2] =
  43.       {
  44.           { 0200, 0 },
  45.           { 0200, 0 },
  46.           { 037777677777, 0 },
  47.           { 037777677777, 037777777777 },
  48.  
  49. --- 83,89 -----
  50.   long realcon[6][2] =
  51.       {
  52.           { 0200, 0 },
  53. + #ifndef GFLOAT
  54.           { 0200, 0 },
  55.   #else GFLOAT
  56.           { 0020, 0 },
  57. ***************
  58. *** 79,84
  59.       {
  60.           { 0200, 0 },
  61.           { 0200, 0 },
  62.           { 037777677777, 0 },
  63.           { 037777677777, 037777777777 },
  64.           { 032200, 0 },
  65.  
  66. --- 85,93 -----
  67.           { 0200, 0 },
  68.   #ifndef GFLOAT
  69.           { 0200, 0 },
  70. + #else GFLOAT
  71. +         { 0020, 0 },
  72. + #endif GFLOAT
  73.           { 037777677777, 0 },
  74.   #ifndef GFLOAT
  75.           { 037777677777, 037777777777 },
  76. ***************
  77. *** 80,85
  78.           { 0200, 0 },
  79.           { 0200, 0 },
  80.           { 037777677777, 0 },
  81.           { 037777677777, 037777777777 },
  82.           { 032200, 0 },
  83.           { 022200, 0 }
  84.  
  85. --- 89,95 -----
  86.           { 0020, 0 },
  87.   #endif GFLOAT
  88.           { 037777677777, 0 },
  89. + #ifndef GFLOAT
  90.           { 037777677777, 037777777777 },
  91.   #else GFLOAT
  92.           { 037777677777, 037777777777 },
  93. ***************
  94. *** 81,86
  95.           { 0200, 0 },
  96.           { 037777677777, 0 },
  97.           { 037777677777, 037777777777 },
  98.           { 032200, 0 },
  99.           { 022200, 0 }
  100.       };
  101.  
  102. --- 91,99 -----
  103.           { 037777677777, 0 },
  104.   #ifndef GFLOAT
  105.           { 037777677777, 037777777777 },
  106. + #else GFLOAT
  107. +         { 037777677777, 037777777777 },
  108. + #endif GFLOAT
  109.           { 032200, 0 },
  110.   #ifndef GFLOAT
  111.           { 022200, 0 }
  112. ***************
  113. *** 82,87
  114.           { 037777677777, 0 },
  115.           { 037777677777, 037777777777 },
  116.           { 032200, 0 },
  117.           { 022200, 0 }
  118.       };
  119.   #else
  120.  
  121. --- 95,101 -----
  122.           { 037777677777, 037777777777 },
  123.   #endif GFLOAT
  124.           { 032200, 0 },
  125. + #ifndef GFLOAT
  126.           { 022200, 0 }
  127.   #else GFLOAT
  128.           { 036320, 0 }
  129. ***************
  130. *** 83,88
  131.           { 037777677777, 037777777777 },
  132.           { 032200, 0 },
  133.           { 022200, 0 }
  134.       };
  135.   #else
  136.   double realcon[6] =
  137.  
  138. --- 97,105 -----
  139.           { 032200, 0 },
  140.   #ifndef GFLOAT
  141.           { 022200, 0 }
  142. + #else GFLOAT
  143. +         { 036320, 0 }
  144. + #endif GFLOAT
  145.       };
  146.   #else
  147.   double realcon[6] =
  148. ***************
  149. *** 197,202
  150.   prconr(fp, type, x)
  151.   FILEP fp;
  152.   int type;
  153.   float x;
  154.   {
  155.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  156.  
  157. --- 214,220 -----
  158.   prconr(fp, type, x)
  159.   FILEP fp;
  160.   int type;
  161. + #ifndef GFLOAT
  162.   float x;
  163.   #else GFLOAT
  164.   float *x;
  165. ***************
  166. *** 198,203
  167.   FILEP fp;
  168.   int type;
  169.   float x;
  170.   {
  171.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  172.   }
  173.  
  174. --- 216,224 -----
  175.   int type;
  176.   #ifndef GFLOAT
  177.   float x;
  178. + #else GFLOAT
  179. + float *x;
  180. + #endif GFLOAT
  181.   {
  182.   #ifndef GFLOAT
  183.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  184. ***************
  185. *** 199,204
  186.   int type;
  187.   float x;
  188.   {
  189.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  190.   }
  191.   #endif
  192.  
  193. --- 220,226 -----
  194.   float *x;
  195.   #endif GFLOAT
  196.   {
  197. + #ifndef GFLOAT
  198.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  199.   #else GFLOAT
  200.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), *x);
  201. ***************
  202. *** 200,205
  203.   float x;
  204.   {
  205.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  206.   }
  207.   #endif
  208.   
  209.  
  210. --- 222,230 -----
  211.   {
  212.   #ifndef GFLOAT
  213.   fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), x);
  214. + #else GFLOAT
  215. + fprintf(fp, "\t%s\t0f%e\n", (type==TYREAL ? ".float" : ".double"), *x);
  216. + #endif GFLOAT
  217.   }
  218.   #endif
  219.   
  220. ***************
  221. *** 207,212
  222.   prconr(fp, type, x)
  223.   FILEP fp;
  224.   int type;
  225.   double x;
  226.   {
  227.   /* non-portable cheat to preserve bit patterns */
  228.  
  229. --- 232,238 -----
  230.   prconr(fp, type, x)
  231.   FILEP fp;
  232.   int type;
  233. + #ifndef GFLOAT
  234.   double x;
  235.   {
  236.   /* non-portable cheat to preserve bit patterns */
  237. ***************
  238. *** 226,231
  239.       fprintf(fp, "\t.long\t0x%X,0x%X\n", cheat.xl[0], cheat.xl[1]);
  240.       i = SZDOUBLE;
  241.       }
  242.   if(fp == initfile)
  243.       i_offset += i;
  244.   else
  245.  
  246. --- 252,274 -----
  247.       fprintf(fp, "\t.long\t0x%X,0x%X\n", cheat.xl[0], cheat.xl[1]);
  248.       i = SZDOUBLE;
  249.       }
  250. + #else GFLOAT
  251. + /* This assumes two longs make a double */
  252. + long *x;
  253. + {
  254. + register int i;
  255. + if(type == TYREAL)
  256. +     {
  257. +     fprintf(fp, "\t.long\t0x%X\n", *x );
  258. +     i = SZFLOAT;
  259. +     }
  260. + else
  261. +     {
  262. +     fprintf(fp, "\t.long\t0x%X,0x%X\n", *x, *(x+1) );
  263. +     i = SZDOUBLE;
  264. +     }
  265. + #endif GFLOAT
  266.   if(fp == initfile)
  267.       i_offset += i;
  268.   else
  269. ***************
  270. *** 369,374
  271.   else if (type == TYSHORT)
  272.       p2pass("\ttstw\tr0");
  273.   else
  274.       p2pass("\ttstd\tr0");
  275.   p2pi("\tjlss\tL%d", neg);
  276.   p2pi("\tjeql\tL%d", zer);
  277.  
  278. --- 412,418 -----
  279.   else if (type == TYSHORT)
  280.       p2pass("\ttstw\tr0");
  281.   else
  282. + #ifndef GFLOAT
  283.       p2pass("\ttstd\tr0");
  284.   #else GFLOAT
  285.       p2pass("\ttstg\tr0");
  286. ***************
  287. *** 370,375
  288.       p2pass("\ttstw\tr0");
  289.   else
  290.       p2pass("\ttstd\tr0");
  291.   p2pi("\tjlss\tL%d", neg);
  292.   p2pi("\tjeql\tL%d", zer);
  293.   p2pi("\tjbr\tL%d", pos);
  294.  
  295. --- 414,422 -----
  296.   else
  297.   #ifndef GFLOAT
  298.       p2pass("\ttstd\tr0");
  299. + #else GFLOAT
  300. +     p2pass("\ttstg\tr0");
  301. + #endif GFLOAT
  302.   p2pi("\tjlss\tL%d", neg);
  303.   p2pi("\tjeql\tL%d", zer);
  304.   p2pi("\tjbr\tL%d", pos);
  305.