Thu Mar 28 13:50:51 1996 James G. Smith <jsmith@cygnus.co.uk>
* interp.c (Convert): Provide round-to-nearest and round-to-zero support for Sun hosts. * Makefile.in (gencode): Ensure the host compiler and libraries used for cross-hosted build. Allow a DOS hosted version of the simulator to be built. NOTE: The FP is still not complete, since round-to-nearest and round-to-zero have not been implemented generically.
This commit is contained in:
parent
1d8eda7ab4
commit
d0757082eb
2 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Thu Mar 28 13:50:51 1996 James G. Smith <jsmith@cygnus.co.uk>
|
||||||
|
|
||||||
|
* interp.c (Convert): Provide round-to-nearest and round-to-zero
|
||||||
|
support for Sun hosts.
|
||||||
|
* Makefile.in (gencode): Ensure the host compiler and libraries
|
||||||
|
used for cross-hosted build.
|
||||||
|
|
||||||
Wed Mar 27 14:42:12 1996 James G. Smith <jsmith@cygnus.co.uk>
|
Wed Mar 27 14:42:12 1996 James G. Smith <jsmith@cygnus.co.uk>
|
||||||
|
|
||||||
* interp.c, gencode.c: Some more (TODO) tidying.
|
* interp.c, gencode.c: Some more (TODO) tidying.
|
||||||
|
|
|
@ -494,6 +494,8 @@ sim_open (args)
|
||||||
s[1] = 0x00000000;
|
s[1] = 0x00000000;
|
||||||
if (((float)4.01102924346923828125 != *(float *)s) || ((double)523.2939453125 != *(double *)s)) {
|
if (((float)4.01102924346923828125 != *(float *)s) || ((double)523.2939453125 != *(double *)s)) {
|
||||||
fprintf(stderr,"The host executing the simulator does not seem to have IEEE 754-1985 std FP\n");
|
fprintf(stderr,"The host executing the simulator does not seem to have IEEE 754-1985 std FP\n");
|
||||||
|
fprintf(stderr,"*(float *)s = %f (4.01102924346923828125)\n",*(float *)s);
|
||||||
|
fprintf(stderr,"*(double *)s = %f (523.2939453125)\n",*(double *)s);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -814,7 +816,7 @@ sim_close (quitting)
|
||||||
#endif /* TRACE */
|
#endif /* TRACE */
|
||||||
|
|
||||||
if (membank)
|
if (membank)
|
||||||
cfree(membank);
|
free(membank); /* cfree not available on all hosts */
|
||||||
membank = NULL;
|
membank = NULL;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -2912,13 +2914,21 @@ Convert(rm,op,from,to)
|
||||||
/* Round result to nearest representable value. When two
|
/* Round result to nearest representable value. When two
|
||||||
representable values are equally near, round to the value
|
representable values are equally near, round to the value
|
||||||
that has a least significant bit of zero (i.e. is even). */
|
that has a least significant bit of zero (i.e. is even). */
|
||||||
|
#if defined(sun)
|
||||||
tmp = (float)anint((double)tmp);
|
tmp = (float)anint((double)tmp);
|
||||||
|
#else
|
||||||
|
/* TODO: Provide round-to-nearest */
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FP_RM_TOZERO:
|
case FP_RM_TOZERO:
|
||||||
/* Round result to the value closest to, and not greater in
|
/* Round result to the value closest to, and not greater in
|
||||||
magnitude than, the result. */
|
magnitude than, the result. */
|
||||||
|
#if defined(sun)
|
||||||
tmp = (float)aint((double)tmp);
|
tmp = (float)aint((double)tmp);
|
||||||
|
#else
|
||||||
|
/* TODO: Provide round-to-zero */
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FP_RM_TOPINF:
|
case FP_RM_TOPINF:
|
||||||
|
@ -2960,11 +2970,19 @@ Convert(rm,op,from,to)
|
||||||
|
|
||||||
switch (rm) {
|
switch (rm) {
|
||||||
case FP_RM_NEAREST:
|
case FP_RM_NEAREST:
|
||||||
|
#if defined(sun)
|
||||||
tmp = anint(*(double *)&tmp);
|
tmp = anint(*(double *)&tmp);
|
||||||
|
#else
|
||||||
|
/* TODO: Provide round-to-nearest */
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FP_RM_TOZERO:
|
case FP_RM_TOZERO:
|
||||||
|
#if defined(sun)
|
||||||
tmp = aint(*(double *)&tmp);
|
tmp = aint(*(double *)&tmp);
|
||||||
|
#else
|
||||||
|
/* TODO: Provide round-to-zero */
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FP_RM_TOPINF:
|
case FP_RM_TOPINF:
|
||||||
|
|
Loading…
Reference in a new issue