9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Fernan Bolando <fernanbolando@mailc.net>
To: erik quanstrom <quanstro@labs.coraid.com>
Cc: 9fans@9fans.net
Subject: Re: [9fans] vlong double-spill botch
Date: Tue,  4 Jan 2011 21:31:17 +0800	[thread overview]
Message-ID: <AANLkTikm1kWXbixZ-1OUEgPELif6o7a=V4vmaESm=TbE@mail.gmail.com> (raw)
In-Reply-To: <0e14b63351a438d2b8fef5043e4cd988@coraid.com>

On Mon, Jan 3, 2011 at 10:56 PM, erik quanstrom
<quanstro@labs.coraid.com> wrote:
>> what does vlong double-spill botch mean in
>> r = (a * b) + (((a * u) + (b * t)) << 18);          /* low is only 35b */
>>
>
> this is a workaround that i put in the compiler;
> it's not in the distribution.  the distribution
> compiler happily miscompiles.
>
> if both the left and rhs side of an expression
> need to allocate more registers, then 8c often
> miscompiles.  you may be able to fix this by
> changing 18 to 18ull, but you might as well
> do it this way:
>
>        r = a*u + b*t;
>        r <<= 18ull;
>        r += a*b;
>
This did not work, but this did
ra = a * b;
rb = a * u;
rc = b * t;
r = ra + ((rb + rc) << 18);



      reply	other threads:[~2011-01-04 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03 14:44 Fernan Bolando
2011-01-03 14:56 ` erik quanstrom
2011-01-04 13:31   ` Fernan Bolando [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTikm1kWXbixZ-1OUEgPELif6o7a=V4vmaESm=TbE@mail.gmail.com' \
    --to=fernanbolando@mailc.net \
    --cc=9fans@9fans.net \
    --cc=quanstro@labs.coraid.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).