9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] vlong double-spill botch
@ 2011-01-03 14:44 Fernan Bolando
  2011-01-03 14:56 ` erik quanstrom
  0 siblings, 1 reply; 3+ messages in thread
From: Fernan Bolando @ 2011-01-03 14:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

what does vlong double-spill botch mean in
r = (a * b) + (((a * u) + (b * t)) << 18);          /* low is only 35b */

a larger section of the code is shown below


t_uint64 a = ABS (s1);
t_uint64 b = ABS (s2);
t_uint64 t, u, r;

if ((a == 0) || (b == 0)) {                             /* operand = 0? */
    rs[0] = rs[1] = 0;                                  /* result 0 */
    return;
    }
if ((a & FIT32) || (b & FIT32)) {                       /* fit in 64b? */
    t = a >> 18;                                        /* no, split in half */
    a = a & RMASK;                                      /* "dp" multiply */
    u = b >> 18;
    b = b & RMASK;
    r = (a * b) + (((a * u) + (b * t)) << 18);          /* low is only 35b */
    rs[0] = ((t * u) << 1) + (r >> 35);                 /* so lsh hi 1 */
    rs[1] = r & MMASK;
    }



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-04 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-03 14:44 [9fans] vlong double-spill botch Fernan Bolando
2011-01-03 14:56 ` erik quanstrom
2011-01-04 13:31   ` Fernan Bolando

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).