Feature request: First class labels

Daniel Keep daniel.keep.lists at gmail.com
Sun May 6 18:36:18 PDT 2007



janderson wrote:
> Daniel Keep wrote:
>>> void padd(ubyte[] a, ubyte[] b)
>>> {
>>> selectSSE2:
>>>     invariant if( cpuid.hasSSE2 )
>>>     {
>>>         // SSE2 implementation
>>>     }
>>>     else
>>>     {
>>>         // Software implementation
>>>     }
>>> }
>>>
>>> void reset_padd()
>>> {
>>>     break padd.selectSSE2;
>>> }
> What about if the compiler just detected the use of a constant, and you
> didn't have to do anything be specify the variables as const.  Also the
> compiler could do a better optimisation on those loops by taking the
> jump out all together and having 4 separate loops.
> 
> -Joel

If the contents of the conditional were constant, you could just use
static if and remove the branch altogether.

	-- Daniel

-- 
int getRandomNumber()
{
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

http://xkcd.com/

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d mailing list