The patch msp430-libc/src/libm fixsfsi.c,1.4,1.5 mulsf.c,1.6,1.7 seems to work but there appear to be more problems with libfp.
While testing this update I noticed that there were still problems when I
linked in libfp. I narrowed the problem down to >=, <=, <, and > evaluation
with floating point numbers. After examining __gesf2 and the asm generated
to call __gesf2 I noticed that the code to return from __gesf2 seems faulty:
a[1] = (small >= big); //0
8092: 0b 43 clr r11 ;
8094: 1e 41 04 00 mov 4(r1), r14 ;
8098: 1f 41 06 00 mov 6(r1), r15 ;
809c: 2c 41 mov @r1, r12 ;
809e: 1d 41 02 00 mov 2(r1), r13 ;
80a2: b0 12 b4 81 call #-32332 ;#0x81b4
80a6: 0f 93 cmp #0, r15 ;r3 As==00
80a8: 01 38 jl $+4 ;abs 0x80ac
80aa: 1b 43 mov #1, r11 ;r3 As==01
80ac: 81 4b 12 00 mov r11, 18(r1) ;
where addr 0x81b4 is __gesf2.
Because __gesf2 always returns a 0 or a 1 cmp will never set the negative
flag and because cmp here does r15 - 0 the V flag will never be set either.
Oddly enough the tests for >= and <= I wrote work with the simulator.
I believe that the other operations may have similar problems.
Attached are my simulator (tests.c) source and my regular test (test.c)
source.
-Chris
test.c
Description: Binary data
tests.c
Description: Binary data
