Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Fixed point math #41

Open
zumpchke opened this issue Jan 4, 2016 · 4 comments
Open

Fixed point math #41

zumpchke opened this issue Jan 4, 2016 · 4 comments

Comments

@zumpchke
Copy link

zumpchke commented Jan 4, 2016

Is there any planned support for fixed point math for MCU's without a FPU? i.e Q16.16

@kovach
Copy link
Contributor

kovach commented Jan 4, 2016

It's not a high priority issue for us at this time. It's definitely doable, but requires touching several parts of the compiler. I'm beginning a refactor, and afterwards it should be more straightforward to add new numeric types like this.

@ryanorendorff
Copy link

I also would find this very helpful. There are a few methods to automatically convert C to fixed point, but then this usually requires annotations somewhere in the code. Maybe this would be simpler to just use one of the C to fixed point C tools?

@zumpchke
Copy link
Author

@ryanorendorff Can you point me in the direction to an example of this tool?

@ryanorendorff
Copy link

ryanorendorff commented Sep 27, 2016

Well by "a few methods" I should say a few papers. I sometimes forget academic work often doesn't really exist in practice. :-)

There is this one: suif.stanford.edu/suifconf/suifconf2/papers/4.ps. And papers that cite this one can be found here: https://goo.gl/K3h5WG (maybe this paper is helpful? https://www.researchgate.net/profile/Jiyang_Kang/publication/3325573_AUTOSCALER_for_C_An_optimizing_floating-point_to_integer_C_program_converter_for_fixed-point_digital_signal_processors/links/54f754570cf2ccffe9db1d47.pdf).

It also seems like MATLAB has some similar functionality baked in: http://www.mathworks.com/help/fixedpoint/automated-conversion.html.

I can look more in depth later if you would like.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants