Having something like this on the mspgcc would be nice. Currently, I have to 
use inline assembly for all these vector-register-driven ISRs (Timer, USART, 
NMI etc.)
It works and once made, you can forget it, but doing so in 'plain' C would be 
nicer.
OTOH, IAR and CCE require something liek that as they don't offer reliable 
inline assembly. The GCC is superior here.

JMGross



----- Ursprüngliche Nachricht -----
Von: Sergey A. Borshch
An: GCC for MSP430 - http://mspgcc.sf.net
Gesendet am: 14 Jun 2010 11:38:01
Betreff: Re: [Mspgcc-users] intrinsic function __even_in_range

On 14.06.2010 5:50, Paul F. Sehorne wrote:
> I wrote an assembly routine to emulate the intrinsic function
> __even_in_range, and although it might work I doubt that it accomplishes
> anything significant.
This function ensures the compiler that it's first argument is always even and 
always in range [0...second argument]. So compiler allowed to generate case as 
efficient table jump without additional checking of switch() statement.
And nothing more. You can just replace
switch(__even_in_range(ADC12IV,34))
to
switch(ADC12IV).


Reply via email to