Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2006/0128/7

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Fix a few floating-point conversions in 8c.
 [rsc] --rw-rw-r-- M 1428987 glenda sys 23789 Jan 28 09:53 sys/src/cmd/8c/txt.c
	/n/sourcesdump/2006/0128/plan9/sys/src/cmd/8c/txt.c:791,799 - 
	/n/sourcesdump/2006/0129/plan9/sys/src/cmd/8c/txt.c:791,797
	  	case CASE(	TFLOAT,	TSHORT):
	  	case CASE(	TFLOAT,	TUSHORT):
	  	case CASE(	TFLOAT,	TINT):
	- 	case CASE(	TFLOAT,	TUINT):
	  	case CASE(	TFLOAT,	TLONG):
	- 	case CASE(	TFLOAT,	TULONG):
	  	case CASE(	TFLOAT,	TIND):
	  
	  	case CASE(	TDOUBLE,TCHAR):
	/n/sourcesdump/2006/0128/plan9/sys/src/cmd/8c/txt.c:801,820 - 
	/n/sourcesdump/2006/0129/plan9/sys/src/cmd/8c/txt.c:799,806
	  	case CASE(	TDOUBLE,TSHORT):
	  	case CASE(	TDOUBLE,TUSHORT):
	  	case CASE(	TDOUBLE,TINT):
	- 	case CASE(	TDOUBLE,TUINT):
	  	case CASE(	TDOUBLE,TLONG):
	- 	case CASE(	TDOUBLE,TULONG):
	  	case CASE(	TDOUBLE,TIND):
	- 
	- 	case CASE(	TVLONG,	TCHAR):
	- 	case CASE(	TVLONG,	TUCHAR):
	- 	case CASE(	TVLONG,	TSHORT):
	- 	case CASE(	TVLONG,	TUSHORT):
	- 	case CASE(	TVLONG,	TINT):
	- 	case CASE(	TVLONG,	TUINT):
	- 	case CASE(	TVLONG,	TLONG):
	- 	case CASE(	TVLONG,	TULONG):
	- 	case CASE(	TVLONG,	TIND):
	  		if(fproundflg) {
	  			regsalloc(&nod, &regnode);
	  			gins(AFMOVLP, f, &nod);
	/n/sourcesdump/2006/0128/plan9/sys/src/cmd/8c/txt.c:834,846 - 
	/n/sourcesdump/2006/0129/plan9/sys/src/cmd/8c/txt.c:820,845
	  		return;
	  
	  /*
	+  * float to ulong
	+  */
	+ 	case CASE(	TDOUBLE,	TULONG):
	+ 	case CASE(	TFLOAT,	TULONG):
	+ 	case CASE(	TDOUBLE,	TUINT):
	+ 	case CASE(	TFLOAT,	TUINT):
	+ 		regsalloc(&nod, &regnode);
	+ 		gmove(f, &fregnode0);
	+ 		gins(AFADDD, nodfconst(-2147483648.), &fregnode0);
	+ 		gins(AFMOVLP, f, &nod);
	+ 		gins(ASUBL, nodconst(-2147483648), &nod);
	+ 		gmove(&nod, t);
	+ 		return;
	+ 
	+ /*
	   * ulong to float
	   */
	  	case CASE(	TULONG,	TDOUBLE):
	- 	case CASE(	TULONG,	TVLONG):
	  	case CASE(	TULONG,	TFLOAT):
	  	case CASE(	TUINT,	TDOUBLE):
	- 	case CASE(	TUINT,	TVLONG):
	  	case CASE(	TUINT,	TFLOAT):
	  		regalloc(&nod, f, f);
	  		gmove(f, &nod);
	/n/sourcesdump/2006/0128/plan9/sys/src/cmd/8c/txt.c:873,886 - 
	/n/sourcesdump/2006/0129/plan9/sys/src/cmd/8c/txt.c:872,877
	  	case CASE(	TINT,	TDOUBLE):
	  	case CASE(	TLONG,	TDOUBLE):
	  	case CASE(	TIND,	TDOUBLE):
	- 
	- 	case CASE(	TCHAR,	TVLONG):
	- 	case CASE(	TUCHAR,	TVLONG):
	- 	case CASE(	TSHORT,	TVLONG):
	- 	case CASE(	TUSHORT,TVLONG):
	- 	case CASE(	TINT,	TVLONG):
	- 	case CASE(	TLONG,	TVLONG):
	- 	case CASE(	TIND,	TVLONG):
	  		regsalloc(&nod, &regnode);
	  		gmove(f, &nod);
	  		gins(AFMOVL, &nod, &fregnode0);
	/n/sourcesdump/2006/0128/plan9/sys/src/cmd/8c/txt.c:891,905 - 
	/n/sourcesdump/2006/0129/plan9/sys/src/cmd/8c/txt.c:882,890
	   */
	  	case CASE(	TFLOAT,	TFLOAT):
	  	case CASE(	TDOUBLE,TFLOAT):
	- 	case CASE(	TVLONG,	TFLOAT):
	  
	  	case CASE(	TFLOAT,	TDOUBLE):
	  	case CASE(	TDOUBLE,TDOUBLE):
	- 	case CASE(	TVLONG,	TDOUBLE):
	- 
	- 	case CASE(	TFLOAT,	TVLONG):
	- 	case CASE(	TDOUBLE,TVLONG):
	- 	case CASE(	TVLONG,	TVLONG):
	  		a = AFMOVD;	break;
	  	}
	  	if(a == AMOVL || a == AFMOVD)


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.