Forum Discussion
Altera_Forum
Honored Contributor
15 years agoThank you for your post.
--- Quote Start --- However are you sure you are actually performing a single precision floating point comparison? --- Quote End --- Yes, I am or at least I think so. Here is my code for testing it. Should be single precision.float TEST_Float (float a, float b)
{
if (a<b)
a=b;
return a;
}With following compiler (user) flags: --- Quote Start --- -mcustom-floatis=1 -mcustom-fixsi=2 -mcustom-fcmplts=25 -mcustom-fcmpgts=26 --- Quote End --- Becomes 020241b4 <TEST_Float>:
20241b4: defffd04 addi sp,sp,-12
20241b8: dc400115 stw r17,4(sp)
20241bc: dc000015 stw r16,0(sp)
20241c0: dfc00215 stw ra,8(sp)
20241c4: 2021883a mov r16,r4
20241c8: 2823883a mov r17,r5
20241cc: 202797c0 call 202797c <__ltsf2>
20241d0: 1000010e bge r2,zero,20241d8 <TEST_Float+0x24>
20241d4: 8821883a mov r16,r17
20241d8: 8005883a mov r2,r16
20241dc: dfc00217 ldw ra,8(sp)
20241e0: dc400117 ldw r17,4(sp)
20241e4: dc000017 ldw r16,0(sp)
20241e8: dec00304 addi sp,sp,12
20241ec: f800283a retWe tried it with gcc3 and gcc4. It's not working for both. Have you done it successfully?