On Tue, 19 May 2015, Michael Ferguson wrote:
> I have verified that GCC at least does not inline frexp. I don't
> understand why it couldn't, but it didn't in my experiments. Neither
> did clang...
C/C++ does not know the details so cannot expand it. If frexp were
implemented as a template in C++, it is another story, and another
email discussion list.
> I agree that you don't want to pay for a function call for this sort
> of thing.
It is more that the optimizer then gets conservative.
> I'm having trouble finding documentation for it, but it seems
> that ieee754.h is a GLIBC header file. Do you know more about it?
> (is it in some standard or other?).
Now you have me thinking!!! Will investigate.
> I'm happy to implement them in the Chapel runtime - I was just saying
> that if you needed the functionality quickly, you could do it yourself
> as a stop-gap approach.
OK. All these issues need some further discussion so will do some of this
task in C shortly and then get back to you for some further input.
> I believe such memcpys would normally get optimized away - but it
> depends on your compiler. I'm quite sure that LLVM based compilers will
> remove 8 byte memcpys and turn it all into registers.
Wow. Smart.
> I think that the main optimization issue here is that the processor
> might use registers for the floating point number that might not
> support bit extraction - so the value might end up in memory
> or in general purpose registers than staying in floating point registers.
> I'm sure it depends on the compiler and the architecture though.
Yes. I always check the compiler output. The C keyword 'volatile' is
occassionally useful in such contexts.
I will reference those comments on
bits(64)
when I reply to Brad's later email which has more comments.
I will put some more thoughts down on paper soon.
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