On 08/15/2014 08:32 AM, Sébastien Bourdeauducq wrote: > On 08/14/2014 09:16 AM, Robert Jordens wrote: >> Also that excerpt misses the point of the underlying question, which is >> when to best convert floating point physical quantities to integer >> device units. > > What about having soft floating point (and rational with e.g. 64-bit > numerator and denominator) support on the device? That's not > particularly hard to implement, as we already need a typing system to > distinguish between 32-bit integers (for fast computations), 64-bit > integers (for high range variables like time) and integer arrays (for > histograms). > > Then the compiler just tries to fold constants as much as possible to > improve performance. If parts of the computation are not folded - either > because the transform is not smart enough or because of a dependency on > runtime data - things will still work, albeit at a slower speed.
That sounds good to me. I would expect the overwhelming majority of cases to be foldable down to integer device units. And I assume these could then be represented in the binary kernel more efficiently than a double or a 2x64 bit rational. Robert. _______________________________________________ ARTIQ mailing list https://ssl.serverraum.org/lists/listinfo/artiq Migen/MiSoC: please use de...@lists.m-labs.hk instead.