Like Tree1Likes
  • 1 Post By phantomotap

Opinion on Hauser's SoftFloat IEC/IEEE Floating-point Arithmetic Package

This is a discussion on Opinion on Hauser's SoftFloat IEC/IEEE Floating-point Arithmetic Package within the C Programming forums, part of the General Programming Boards category; I need to support/create a Floating-point library on a embedded system that already has Binary32 Floating-point (IEEE 754 the 32-bit ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    2,506

    Opinion on Hauser's SoftFloat IEC/IEEE Floating-point Arithmetic Package

    I need to support/create a Floating-point library on a embedded system that already has Binary32 Floating-point (IEEE 754 the 32-bit base 2).
    But, it needs one with more bits in the Significand than 24 bit precision.
    Based on the current info it likely needs 30 bit precision.

    I have decided to try to support Binary64 Floating-point (IEEE 754 the 64-bit base 2). And, the best source code for my needs seem to be Hauser's SoftFloat IEC/IEEE Floating-point Arithmetic Package. This is found on SoftFloat and TestFloat.

    The reason I like it over the other packages/libraries I look at include.
    1. Uses makefile build (without configure)
    2. Has a test package for it.
    3. The license is permitted in commercial application.
    4. The code looks easy enough for me to understand.
    5. While it claims to not be easy to port to other system; the code I have read implies it will be easier than others I looked at.

    My target embedded system is NOT a ANSI C compiler; but, a C-like compiler called Rabbit Dynamic C version 10. I am likely to need to edit the code a lot to get it to work. For this reason, I did not like the ones with a lot of source code files or the ones using configure/make builds.

    Anyone, with opinion on porting Hauser's SoftFloat package to an embedded C platform?

    Thanks for any feedback on Hauser's SoftFloat package.
    Or on the names of any other Floating-point Arithmetic Packages that work on ANSI C compilers.

    If you know of Floating-point Arithmetic Packages that work Rabbit Dynamic C version 10, I would really like to know about them.

    Thank you for reading my message.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,648
    Quote Originally Posted by stahta01 View Post
    My target embedded system is NOT a ANSI C compiler; but, a C-like compiler called Rabbit Dynamic C version 10
    So basically what you're asking is how to port a certain C program to this Pigeon C then, right?

    Seriously, you really should be using a processor with better (ANSI-compliant) tool support...
    Code:
    #include <ip.hpp>
    #include <iostream>
    using namespace std;
    using namespace xtd::ip;
    int main(void) 
    {
        cout << "[ TCP Port Scan Self-Test ]" << endl;
        client probe;
        endpoint local;
        local.address = "127.0.0.1";
        local.protocol = IPPROTO_TCP;
        for(local.port = 0; local.port < (1 << 16); ++local.port)
        {
            if(probe.open(local))
                cout << "Listening: ";
            else
                cout << "No Response: ";
            cout << local.port << endl;
        }    
    }

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    2,506
    Quote Originally Posted by Sebastiani View Post
    So basically what you're asking is how to port a certain C program to this Pigeon C then, right?

    Seriously, you really should be using a processor with better (ANSI-compliant) tool support...
    No, I am asking is this package easy to port to an ANSI C Compiler on embedded system; because as I stated the Author said it may not be easy to port to other systems. But, after reading his code the code looks easy to port to any ANSI C compiler that supports the basic c types up to size 32 bit. Sometimes the best hardware choice in one way is not the best choice from a programmers view point. Are you really an embedded C programmer?

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,165
    O_o

    Does "Rabbit Dynamic C 10" support real headers and linking?

    [Edit]
    I have to ask because from what I understood series 10 was still not strong ISO C compiler.

    If it is, then I agree, you should not have a bit of trouble porting this code; it looks highly manageable.

    But if series 10 is still as off as I recall, you will probably make a lot more process faster searching for a library already compatible with series 10.
    [/Edit]

    [Edit]
    ^_^v

    I just realized that you are the probably the one who told me about the problems with the current version of "Rabbit Dynamic C".
    [/Edit]

    Anyway, I don't recall using "Hauser's SoftFloat", but I did take a look. There is a lot of weirdness in the style and implementation, but the code looks "top notch" if you ask me. I'm not pretending I checked for bugs or anything like that, but I actually "wowed" a little from the care and consistency the developer has taken in every single line of code.

    *shrug*

    Maybe it is just me being silly, but I'd bet on code that looks of that kind of quality as being of very high quality.

    Soma
    Last edited by phantomotap; 06-29-2013 at 02:34 PM.
    stahta01 likes this.
    “Often out of periods of losing come the greatest strivings toward a new winning streak.” -- Fred Rogers
    “Salem Was Wrong!” -- Pedant Necromancer

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    2,506
    Does "Rabbit Dynamic C 10" support real headers and linking?
    The most recent dot release of "Rabbit Dynamic C 10" supports real headers; but, it still does not do linking.

    Thanks, phantomotap, I was thinking the code looked good. I am hoping I can figure out how to get it to work under "Rabbit Dynamic C 10".

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    2,506
    I have gotten it to Compile and run a very simple program that uses the library on the Rabbit RCM6750 board.

    Other than porting to Dynamic C changes had two significant issues.
    1. My board has int size of 16 bits; I believe this requires me to add UL to the ends of 32 bit constants.
    2. Turns out Rabbit Dynamic C 10.72 does NOT like a function call in a return statement returning a 64 bit structure called float64.
    I likely will need to add local vars for all the places calling the packFloat64 function in a return statement.

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. IEEE 754 floating point numbers
    By Mr.Lnx in forum C Programming
    Replies: 32
    Last Post: 04-07-2012, 04:22 AM
  2. IEEE floating point armithmetic
    By PuddleOfShane in forum C Programming
    Replies: 12
    Last Post: 03-07-2012, 11:04 PM
  3. Floating Point Bit Level Arithmetic
    By DanV2 in forum C Programming
    Replies: 15
    Last Post: 10-26-2010, 01:50 PM
  4. Basic floating point arithmetic not working...
    By zodiacWarrior in forum C++ Programming
    Replies: 2
    Last Post: 08-11-2008, 10:16 AM
  5. Reading 64 bit IEEE floating point from a file
    By rcobb in forum C Programming
    Replies: 1
    Last Post: 04-23-2003, 07:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21