Re: [pypy-dev] Optimize constant float division by multiplication?

2014-11-05 Thread Maciej Fijalkowski
one bad thing about making such decisions (assuming we can loose a bit of precision, which I'm not convinced about) would mean that you would get different results when the code is jitted vs when the code is not jitted. I think this is not acceptable. On Thu, Nov 6, 2014 at 3:48 AM, Steven D'Apran

Re: [pypy-dev] Optimize constant float division by multiplication?

2014-11-05 Thread Steven D'Aprano
On Wed, Nov 05, 2014 at 10:02:01PM +, Alex Gaynor wrote: > Hey Toni, > > If this optimization is valid for any float, we should definitely do it, > and this is a missed optimization. If it's not valid for all floats, I'm > not sure how we should handle it, if at all. I don't believe that it i

Re: [pypy-dev] Optimize constant float division by multiplication?

2014-11-05 Thread Alex Gaynor
Hey Toni, If this optimization is valid for any float, we should definitely do it, and this is a missed optimization. If it's not valid for all floats, I'm not sure how we should handle it, if at all. Alex On Wed Nov 05 2014 at 10:16:36 AM Toni Mattis < toni.mat...@student.hpi.uni-potsdam.de> wr

[pypy-dev] Optimize constant float division by multiplication?

2014-11-05 Thread Toni Mattis
Hello, I discovered that PyPy's JIT generates "DIVSD" instructions on xmm registers when dividing a float by a constant C. This consumes an order of magnitude more CPU cycles than the corresponding "MULSD" instruction with a precomputed 1/C. I know that only powers of two have an exact reciprocal

Re: [pypy-dev] Segfault in Hy for PyPy 2.4

2014-11-05 Thread Ryan Gonzalez
That's the weird issue: it's already fixed! A version compiled from tip works, but the prebuilt 2.4 binaries are the ones that crash. On Wed, Nov 5, 2014 at 2:27 AM, Amaury Forgeot d'Arc wrote: > 2014-11-05 1:57 GMT+01:00 Ryan Gonzalez : > >> I just built the PyPy alpha yesterday. I can run the

Re: [pypy-dev] Segfault in Hy for PyPy 2.4

2014-11-05 Thread Amaury Forgeot d'Arc
2014-11-05 1:57 GMT+01:00 Ryan Gonzalez : > I just built the PyPy alpha yesterday. I can run the tests using nose for > the Hy project under PyPy 2.5 alpha > and PyPy 2.3. However, using the prebuilt PyPy 2.4 binaries fails with a > segfault. Why does this happe