5211 w/ CW6.4 - math issues

Discussion created by Toe on Nov 29, 2007
Latest reply on Nov 29, 2007 by Toe
I'm trying to perform a log on a float, but the return value is bogus.  I've searched through this forum and have seen this issue posted before without any closure.

I'm using the following libraries: C_4i_CF_Runtime.a, fp_coldfire.a, and C_4i_CF_MSL.a

The code compiles, links and executes fine.

the source:
t3 = (float)logf(t2);                       // ln(t2);

the assembler:
0000592C: 202EFFF0        move.l   -16(a6),d0
00005930: 2F400004        move.l   d0,4(a7)
00005934: 41EEFFF8        lea      -8(a6),a0
00005938: 2E88            move.l   a0,(a7)
0000593A: 4EB9000098F4    jsr      .vectors + 0x00000000 (0x000098F4) (0x98f4); 0x000098f4
00005940: 2D48FFBC        move.l   a0,-68(a6)
00005944: 206EFFBC        movea.l  -68(a6),a0
00005948: 2010            move.l   (a0),d0
0000594A: 22280004        move.l   4(a0),d1
0000594E: 2F410004        move.l   d1,4(a7)
00005952: 2E80            move.l   d0,(a7)
00005954: 4EB900009D4C    jsr      _logf (0x9d4c)          ; 0x00009d4c
0000595A: 2D40FFD8        move.l   d0,-40(a6)
0000595E: 202EFFD8        move.l   -40(a6),d0
00005962: 2E80            move.l   d0,(a7)
00005964: 4EB900009C54    jsr      .vectors + 0x00000070 (0x00009C54) (0x9c54); 0x00009c54
0000596A: 2D40FFB8        move.l   d0,-72(a6)
0000596E: 202EFFB8        move.l   -72(a6),d0
00005972: 2D40FFEC        move.l   d0,-20(a6)

log, logf, log10, etc...  none of these work correctly.