Forum Discussion
Altera_Forum
Honored Contributor
15 years agoNow I added all CIs for floating point comparison. Not only the ones for >,<.
And it's working. The compiler flags I used: --- Quote Start --- -mcustom-floatis=1 -mcustom-fixsi=2 -mcustom-fcmplts=19 -mcustom-fcmples=20 -mcustom-fcmpgts=17 -mcustom-fcmpges=18 -mcustom-fcmpeqs=16 -mcustom-fcmpnes=21 --- Quote End --- --- Quote Start --- So I think your "if (a<b)" is being turned into "if(b>=a)" by the compiler. --- Quote End --- But actually the reason why it didn't work, seemed not to be the missing CI for the operator >= as you assumed. If I take a look at the *.objdump the compiler uses the CI for the operator <. (-O3 optimization)if ((float)a<(float)b)
a=b;
return a;Becomes: 20239e0: 2143c4f2 custom 19,at,r4,r5
20239e4: 0800021e bne at,zero,20239f0 <TEST_Float+0x10>
20239e8: 2005883a mov r2,r4
20239ec: f800283a ret
20239f0: 2809883a mov r4,r5
20239f4: 2005883a mov r2,r4
20239f8: f800283a retBut never mind, it's working:-) So thanks for your guiding to a solution! Regards