This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

a proposal ?

I have a thought that would make many processes much more effective and, being only one voice, I would like to know if there is a demand before I propose it to Keil.

This is the result of me having to change a switch statement to a series of IFs to make an ISR process fast enough.

I realize, and thus do not complain, that Keil caould not implemet an ANSI-C switch more efficient than the way it is done.

'n' below will be either 2 or 3 (if Keil decide to implement, they can choose)

a Proposal:
if #pragma QUICKSWITCH then
a) no case value can be more than 255
b) all case values must be multiples of n
c) the switch will be implemented as a jump table

Erik

Parents
  • The advantage of a #pragma as I see it would be that you effectively told the compiler "tell me if you can not do this". If an 'automatic' were implemented, you would never know (except through investigating the assembler) if you had achieved the goal.

    Good point. And I agree, the compiler should take every opportunity, regardless of OT level, to leverage direct jump tables if possible...IMO ;)

Reply
  • The advantage of a #pragma as I see it would be that you effectively told the compiler "tell me if you can not do this". If an 'automatic' were implemented, you would never know (except through investigating the assembler) if you had achieved the goal.

    Good point. And I agree, the compiler should take every opportunity, regardless of OT level, to leverage direct jump tables if possible...IMO ;)

Children
No data