[#8787] Literal inconsistency — Calamitas <calamitates@...>
Hi,
Calamitas <calamitates@gmail.com> writes:
On 9/4/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:
[#8794] bignums — Ondrej Bilka <neleai@...>
I want ask how look integration of faster bignums.
[#8798] okay, threading & sandbox r70 -- the latest patch — why the lucky stiff <ruby-core@...>
We have previously talked about getting the sandbox to obey thread switching on
Hi,
[#8802] WEBrick::Cookie support for multiple cookies per set-cookie — Aaron Patterson <aaron_patterson@...>
WEBrick's cookie class has a method for parsing Set-Cookie headers, but
[#8813] ruby-1.8.5 loads fox16.so more than once — <noreply@...>
Bugs item #5701, was opened at 2006-09-08 20:59
[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>
Howdy,
On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:
On Saturday 09 September 2006 01:42, Eric Hodel wrote:
On Sep 9, 2006, at 7:16 PM, Sean E. Russell wrote:
On Sunday 10 September 2006 22:57, Eric Hodel wrote:
[#8826] OptionParser < Hash — "greg weber" <eegreg@...>
Hi,
[#8828] REXML fails to parse UTF-16 XML. — <noreply@...>
Bugs item #5711, was opened at 2006-09-11 01:25
Hi,
[#8861] new changes in strings+symbols — Mathieu Bouchard <matju@...>
On Wed, 13 Sep 2006, matz wrote:
[#8864] documentation of ruby internals — Deni George <denigeorge@...>
Hello
On Thursday 14 September 2006 11:30, Deni George wrote:
[#8885] numeric.c fails to build on 64-bit platforms (Fedora Core 5 x86_64 gcc 4.1.1) — <noreply@...>
Patches item #5774, was opened at 2006-09-16 12:19
Hi,
[#8897] Ruby's 'etc' module cannot handle the UID of OS X 'nobody' properly — <noreply@...>
Bugs item #5822, was opened at 2006-09-20 11:13
Hi,
[#8904] patch bignums — Ondrej Bilka <neleai@...>
I am so far with implementing faster bignums:
[#8920] rdoc capture output (help message) — "greg weber" <eegreg@...>
Hi,
The simplest command line would be
greg weber wrote:
It looks like you could seperate this out into a rake task, but then
On Sep 29, 2006, at 5:52 AM, greg weber wrote:
[#8929] Re: RDoc patch, possible bug in socket.c for TCPSocket.new — gwtmp01@...
[#8948] socket (and many others) not building on osx? — Ryan Davis <ryand-ruby@...>
I'm stumped. A brand new clean build doesn't build socket.
[#8954] The %? .. ? Operator — James Edward Gray II <james@...>
I'm needing to know the full list of characters that can (or cannot)
On Sep 29, 2006, at 9:56 AM, James Edward Gray II wrote:
Re: bignums
On Wed, Sep 06, 2006 at 12:12:12AM +0200, Mathieu Bouchard wrote:
> This message is in MIME format. The first part should be readable text,
> while the remaining parts are likely unreadable without MIME-aware tools.
> On Tue, 5 Sep 2006, Ondrej Bilka wrote:
>
> >With GMP benchmark I discovered that multipling 2 fixnums into bignum is
> >slow because it multiplies 2 temporary bignums. Without heavy magic its
> >unsolvable.
>
> What's the heavy magic like? Abstract out multiplication as something that
> happens between two or three BDIGIT* pointers (depending on whether it's
> inplace or not). This will allow to use temporary stack-allocated
> BDIGIT[], which is much faster than VALUE and GC.
I thought that assembler has something like MULC which like ADC handles
carry but didnt find anything.
I written another patch.
For 32 bits I use long long multiplication which is faster than checking by division.
For 64bits I have heuristic that if both are <2**31 is not necessary
perform check. But I am not sure if it will cause slowdown or speedup.
Can somebody with 64bit try this.
Compare with current HEAD/1.8. I wondered why my code causes slowdown and cause
was that recent commit slowed method dispatching.
>
> Unless #coerce is currently involved in creating the temporaries?
>
> BTW, is there any plan to use harmonics in order to speed up very very big
> multiplications? I mean like, pad the two bignums to the size of the
> result rounded up to a product of powers of small primes, then apply a
> forward Fast Fourier Transform on both bignums, then do pointwise complex
> multiplication, then do an inverse Fast Fourier Transform on the resulting
> spectrum and perform a carry pass. (here, each digit holder has to be much
> bigger than the digit it holds, because handling carries can only be done
> completely at the end)
I could try. Probably I modify libtommath to support fft for extra long
nums. for shorter perform asymptotic worse algorithms better
>
> _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard - t駘:+1.514.383.3801 - http://artengine.ca/matju
> | Freelance Digital Arts Engineer, Montr饌l QC Canada
>
>
Index: numeric.c
===================================================================
RCS file: /src/ruby/numeric.c,v
retrieving revision 1.143
diff -u -r1.143 numeric.c
--- numeric.c 4 Sep 2006 20:10:45 -0000 1.143
+++ numeric.c 9 Sep 2006 10:04:06 -0000
@@ -1973,13 +1973,26 @@
/* avoids an optimization bug of HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005] */
volatile
#endif
- long a, b, c;
- VALUE r;
+ long a, b;
a = FIX2LONG(x);
- if (a == 0) return x;
+ /*if (a == 0) return x;*/
b = FIX2LONG(y);
+
+#if SIZEOF_LONG*2 <= SIZEOF_LONG_LONG
+ LONG_LONG d;
+ d=((LONG_LONG) a)*b;
+ if (FIXABLE(d)) return LONG2FIX(d);
+ return rb_ll2inum(d);
+#else
+ VALUE r;
+ long c;
+ #define SQRT_LONG_MAX (1<<(sizeof(long)*4-2))
+ /*tests if N*N would overflow*/
+ #define FIT_SQRT_LONG(N) ((N<SQRT_LONG_MAX)&&(N>=-SQRT_LONG_MAX))
+ if ( FIT_SQRT_LONG(a) && FIT_SQRT_LONG(b))
+ return LONG2FIX(a*b);
c = a * b;
r = LONG2FIX(c);
@@ -1987,6 +2000,7 @@
r = rb_big_mul(rb_int2big(a), rb_int2big(b));
}
return r;
+#endif
}
switch (TYPE(y)) {
case T_BIGNUM: