home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,912 of 2,753   
   shrey to All   
   Type demotion of induction variable for    
   23 Jun 10 21:17:44   
   
   From: shreyas76@gmail.com   
      
   Hi all   
      I wish to explore the scenarios when the type of an induction   
   variable used say to index A[i[ in a loop can be demoted to a short.   
   The motivation being it would aid in an efficient code using 16 bit   
   multiplies instead of needing 32 bit multiplies for the target.   
      
      
   So far I can see the following cases   
   1. Size of A is less than 2^32 and assuming the source does not do out   
   of array access. Does c99 provide such guarrantees ?   
      
   2. the maximum value of i is less that 2^16/ sizeof(A[i])   
   Size of A[i] is size of element.   
      
   Is my reasoning valid ? And are there other scenarios ?   
      
   Also can some one point to me any such existing work ?   
      
   thanks   
   shrey   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca