This fix still caused my test cases to fail. After examining things more closely I noticed that gcc expects the same results from all comparison functions. After fixing cmpsf I made all the compare functions call __cmpsf2 and they all worked in my test cases. The following is a list of compare functions that I made call __cmpsf2. msp430-libc/src/libm/eqsf.c msp430-libc/src/libm/gesf.c msp430-libc/src/libm/gtsf.c msp430-libc/src/libm/lesf.c msp430-libc/src/libm/ltsf.c msp430-libc/src/libm/nesf.c
Is it possible to instead make these functions all point to the same place so you save the extra function call code and stack frame? -Chris Takahashi -----Original Message----- From: Dmitry [mailto:di...@mail.ru] Sent: Tuesday, August 05, 2003 2:34 AM To: mspgcc-users@lists.sourceforge.net Subject: Re: [Mspgcc-users] more libfp problems. actually, >,<,>=,<= should return either -1 or 1. am I ...?? may be :) fixed. ~d On Tuesday 05 August 2003 02:06, Takahashi, Chris wrote: > 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 -- /***************************************************************** ("`-''-/").___..--''"`-._ (\ Dimmy the Wild UA1ACZ `6_ 6 ) `-. ( ).`-.__.`) State Polytechnical Univ. (_Y_.)' ._ ) `._ `. ``-..-' Radio-Physics Departament _..`--'_..-_/ /--'_.' ,' Saint Petersburg, Russia (il),-'' (li),' ((!.-' +7 (812) 5403923, 5585314 *****************************************************************/ ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users