Shop OBEX P1 Docs P2 Docs Learn Events
Propeller C, 32 bit floating point options — Parallax Forums

Propeller C, 32 bit floating point options

ImageCraftImageCraft Posts: 348
edited 2008-10-31 20:21 in Propeller 1
32-bit FP support has been added to the ImageCraft Propeller C compiler. My question is whether to enable the support only for STD compiler users, or extend it to the NC noncommercial users as well. I think I know what forumers' preference is, but may as well ask and see what people say.

Thoughts? Comments?

// richard

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-29 01:55
    From a forum perspective, providing the floating point support for all compiler users will increase the base of applications and experience using floating point (and normal / full C as well). You'll have to answer the question of whether ImageCraft can afford to do so. People who can't justify paying for the STD version will experiment with floating point if it's in the non-commercial version. They may even be able to develop an application that may allow them to upgrade. Mostly you will be appealing to the hobbist / educational market who would tend to drop into floating point easily while the commercial users may be interested in using scaled arithmetic to avoid the overhead of floating point.
  • simonlsimonl Posts: 866
    edited 2008-10-29 09:23
    Hi Richard,

    For me the answer's simple; please add it to the NC version too. I suspect most hobbiests will arrive at the Propeller from having played with other micro's or PC languages (incl. C), and whilst we probably shouldn't be relying on FP (as we should learn how to do integer math instead!), having FP will make the cross-over *much* simpler - and simpler will lead to less frustration, which may lead to wanting the full version wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2008-10-30 06:18
    I don't think I will ever use the floating point support in ICC for the Propellor. Why? because anything that I would want floating point for would be horrendously slow and just not worth it. No matter how optimal you were able to make the code, it's still software emulation of floating point math, and it's just too painfully slow for me to even consider. I will use fixed point from time to time, but you don't need to add anything for that.

    I realize there are applications for it, and people will use it, but I just can't imagine doing it.

    One thing I actually would like is the ability to build without float support (which I assume you have in or planned) since I don't want a cog wasted for it. I also hope it doesn't take up too much of the kernal cog space.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out the Propeller Wiki·and contribute if you can.
  • RossHRossH Posts: 5,436
    edited 2008-10-30 08:12
    Hi,

    I would only consider C if it had floating point support. Why? Because for everything else SPIN or assembly is sufficient, so there is no advantage in moving to C.

    Good luck!
  • wadiprawitawadiprawita Posts: 7
    edited 2008-10-30 13:22
    Agree with RossH, no matter how slow, I think it will still be useful, anyway propeller is fast. I think ImageCraft will be more adopted when the release of Propeller II. Let us practice first.

    regards

    -doni-
  • ImageCraftImageCraft Posts: 348
    edited 2008-10-30 20:08
    OK, we will be releasing a new update in the next day or so that supports floating point even in the non-commercial version. I hope this will entice more users to Propeller C, even if they are just hobbyists.

    Thank you for all the comments.
  • AleAle Posts: 2,363
    edited 2008-10-30 20:51
    Having implemented FP myself for the propeller (binary double precision and BCD with 12 digits) I cannot say that it is slow at all. The propeller is competing with other uC (like low end ARM and similar) that do not provide much faster emulated FP. At least when embedded into pasm. Saying that it is painfully slow is in my opinion comparing it to the Spectrum or C64 FP, when in fact it is much much faster.
    It must also be considered that compiled C code has a penalty due to the LMM kernel, when fast it cannot compete with an equally clocked ARM but it has other features most ARMs dream of.
    The ICC package packs all the standard goodies a modern C has, even floating point. If you need 1+ MFLOPS, the propeller, an low-end ARM7, any 8 bit uC and most 16 bit uC or similar are the wrong answer. So asking pears to an oak is well asking an impossible, so get yourself a proper FP unit!. Converting a propeller to deliver 100kFLOPS is possible, using all processors... but not much more.
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2008-10-30 22:51
    I guess I didn't convey my point well. I wouldn't use floating point on any of the comparable chips either, but perhaps that's just me? The things I would want FP for would require much higher perf.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out the Propeller Wiki·and contribute if you can.
  • lonesocklonesock Posts: 917
    edited 2008-10-30 23:11
    I have occasionally used floating point calcs to _set_up_ my fixed point calcs, that way I get execution speed inside the loop, but no headaches worrying about overflow during the initial (for example) slope calculation. So I vote for FP inclusion. Having said that, I understand the desire to keep some killer features for the paid version, so perhaps the FP functions could be LMM only, with the option to use a spare cog as a FP co-processor only in the paid version?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-10-30 23:16
    Roy Eltham said...
    I guess I didn't convey my point well. I wouldn't use floating point on any of the comparable chips either, but perhaps that's just me? The things I would want FP for would require much higher perf.

    Thats why DSPs exist, it just matters what your price tolerance is. DSPs and heavier processors which have integrated floating point are aimed at a different market than microcontrollers are.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • ImageCraftImageCraft Posts: 348
    edited 2008-10-30 23:30
    We can argue whether FP is fast enough all days long, but the fact is that a small but sizable ImageCraft customers (for all chips: AVR, CPU12, MSP430 and ARM and others) do use and rely on floating point.

    Having said that, what most people need is really fixed point smile.gif, and we have plans to support that with the Dinkumware library port (see our blog).

    // richard
  • ImageCraftImageCraft Posts: 348
    edited 2008-10-30 23:53
    It's going through the final round of testing, but anyone interested in kicking the tires, try it at http://www.imagecraft.com/pub/iccv7prop_v704_beta1.exe
  • ImageCraftImageCraft Posts: 348
    edited 2008-10-31 20:21
    Our final round of testing came back positive, so 7.04 with FP support is gold. Existing customer can download the latest demo and install to upgrade.

    For tirekickers and fence sitters, now there is one less reason not to try Propeller C. $99 == 2 (small) tanks of gas. Give it a try.
Sign In or Register to comment.