Strange conditional jumps on the POWER4

David Edelsohn dje@watson.ibm.com
Sun Apr 6 03:33:00 GMT 2003


>>>>> Roger Sayle writes:

Roger> but the same code, (j > 1), generates with gcc3.4 "-O2" (600 ticks)

Roger> L..10:
Roger> cmpwi 7,31,1
Roger> li 31,1
Roger> ble- 7,L..4
Roger> li 31,0
Roger> L..4:
Roger> bdnz L..10

Roger> However, with (j == 1) and "gcc-3.4 -O2 -fno-if-conversion", we get
Roger> (1200 ticks)

Roger> L..10:
Roger> cmpwi 7,31,1
Roger> li 31,1
Roger> beq- 7,L..12
Roger> bdnz L..10
Roger> L..13:

	It appears that you are not compiling the code with -mcpu=power4
commandline option for GCC 3.4, because the branch hint mnemonics (+/-)
would not be present without greater probabilities.

David



More information about the Gcc mailing list