[M3devel] integer overflow

Rodney M. Bates rodney_bates at lcwb.coop
Sun Jun 13 17:12:54 CEST 2010



Jay K wrote:
> Been reading about Alpha:
> 
> 
> Alpha and Programming Languages 
> Alpha is an attractive architecture for compiling a large variety of programming languages. 
> Alpha has been carefull y desi gned to avoi d bi as t oward one or two progra mmi ng languages. 
> For example: 
> • Alpha does not contain a subroutine call instruction that moves a register window by a 
> fixed amount. Thus, Alpha is a good match for programming languages with many 
> parameters and programming languages with no parameters. 
> • Alpha does not contain a global integer overflow enable bit. Such a bit would need to 
> be changed at every subroutine boundary when a FORTRAN program calls a C pro- 
> gram. 
> 
> 
> 
> 
> 
> 
> 
> ...
> 
> 
> Integer Operate Instructions 
> ...Integer overfl ow tr ap enable is encoded in t he functi on fie ld of ea ch instruct ion, ra ther t han 
> kept in a global state bit. Thus, for example, both ADDQ/V and ADDQ opcodes exist for spec- 
> ifying 64-bi t ADD with and without overflow checking. That makes it easier to pipe line 
> implementations. 
> 
> 

I'm all for trapping integer overflows, if the performance penalty isn't just horrible.  I doubt
that in more than a tiny minority of cases, integer overflows that silently wrap around (or
silently do anything else) are cases the original programmer knew were correct or even thought
about the possibility they might happen.

> 
>  - Jay
>  		 	   		  



More information about the M3devel mailing list