On Tue, 19 May 2015, Brad Chamberlain wrote: > * Personally, I don't have any opposition to supporting more standard > module/library-based support for floating point utility functions and > values along the lines of what you're proposing.
It needs more discussion with more input from those with experience in more fields. > .. there's always been a strong sense that we need to do more for the > floating point community, but it isn't something that's become a > priority or show-stopper to date. We'd be particularly happy for any of > it to be contributed back to the project from the community, More than happy to do so. As I mentioned to Michael, I will send you some notes later. > * You're correct that the real(*) versions of abs() in Math.chpl aren't > as trivial as fiddling with a bit --- unless the fabs calls that they > use will do so, either directly or as optimized by the C compiler. Generally these get optimized to FABS type operations I believe. I have not experimented with integer 'abs'. > * Generally, my answer for doing C-style unions or casts would be to do > that in a C (static inline?) function or macro and call it from Chapel. > I.e., leave the gross stuff in C rather than Chapel. Any notes or examples on this? I went fishing but could not find anything but my choice of keywords to 'grep' might have been sub-optimal. > * Regarding your bits(n) type proposal. I am not saying it is a good solution. Just bouncing ideas around for now. > This concept comes up with some regularity, and doesn't give me as > many grey hairs (maybe due to naivete?) as many other things. I think > it would be reasonably straightforward to add, particularly once we > have user-defined coercions and casts in the language. > The stickiest issue would probably be a religious debate ... Yes. Let's try and avoid that. You probably need to compile a list of areas where such bit manipulation is used and try and get an idea of all the possible issues. Many, many more pop out of the woodwork when you start interacting with hardware devices, either in APIs or device drivers themselves. And to add to the issues, bit manipulation brings up issues such as endian'ness that need to be handled portably/transparently. None of which is as much fun as working with numerical algorithms to address leading edge engineering problems. Talk later. Regards - Damian Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037 Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here Views & opinions here are mine and not those of any past or present employer ------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y _______________________________________________ Chapel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-users
