SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Technology Stocks : Advanced Micro Devices - Moderated (AMD)
AMD 198.12-5.2%3:59 PM EST

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Joe NYC who wrote (64998)12/5/2001 6:33:57 PM
From: Neil BoothRead Replies (1) of 275872
 
I don't know how the case statement is compiled to assembler.

GCC orders the cases in a binary tree. It then creates a
set of if / then / else branches to get to the right conclusion as efficiently as possible.

Further, any subsets of the tree that are dense get done by
a jump table. Thus a single case statement can be translated into 0, 1 or many jump tables. GCC is pretty good at that kind of thing; other compilers often not as good.

Neil.
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext