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

Runtime of if

Hello,
if there is code like

    if (condition) bla = blub;


than the timming can be different if condition is true or false.

How to make timing equal on both path?

Is

   else dummy = blub;


a good idea?

Are there other ways?

Parents
  • "an update of the compiler or change of optimization level can completely change the timing."

    It could change even without updating the compiler or adjusting the optimisation.

    eg, just by adding apparently unrelated code, the compiler might change its choice of which variables to optimise into registers...

    So, one more time:

    if this is really important to you, then you must do it in assembler.
    Period.

Reply
  • "an update of the compiler or change of optimization level can completely change the timing."

    It could change even without updating the compiler or adjusting the optimisation.

    eg, just by adding apparently unrelated code, the compiler might change its choice of which variables to optimise into registers...

    So, one more time:

    if this is really important to you, then you must do it in assembler.
    Period.

Children
No data