Reducing JUMPs and using conditional exec based on if_then_else

Sami Khawam S.Khawam@ee.ed.ac.uk
Mon Nov 29 19:54:00 GMT 2004



Thanks a lot Hans-Peter for the info; indeed the 
documentation explains it quite well, however it 
does not explain well how to deal with the expansion 
on CPU that dont have a cc0.

Anyway, tried it with movsicc (without splitting it) 
and it works. However, there is a small problem.

The code is able to convert something like
         t1 = a+b;
         t2 = 8 - b;

         if (a <= 5)
             i = t1 ;
         else
             i = t2;

to make it use the movsicc insn, but if it is 
written as:
         if (a <= 5)
             i = a + b;
         else
             i = 8 - b;

the compiler does not recognise the optimisation and 
keeps using a jump, even though I set the 
BRANCH_COST to 999 and REGISTER_MOVE_COST to 0.

Am I missing something that would enable this 
optimisation?

Many thanks,

Sami Khawam





More information about the Gcc mailing list