From: Jacob Lifshay <programmerjake@gmail.com>
To: Libre-RISCV General Development <libre-riscv-dev@lists.libre-riscv.org>
Subject: Re: [libre-riscv-dev] div pipe
Date: Sun, 19 Jul 2020 19:06:34 -0700
Message-ID: <CAC2bXD5ODi8di2yqitLQ40MSychRA-2WGg0+zH7U-wKCe5A2WA@mail.gmail.com> (raw)
In-Reply-To: <CAPweEDzzY9OXscMQSh1HM26AtM+43PJpCa0RS44y+MmErFr8sw@mail.gmail.com>
On Sun, Jul 19, 2020, 18:39 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
wrote:
> On Monday, July 20, 2020, Jacob Lifshay <programmerjake@gmail.com> wrote:
>
> >
> > effectively what's happening is the code is treating the compare_?hs
> > signals as if the binary value N means the fraction N/2^(3*fract_width)
> > (essentially fixed-point numbers), so changing the bit width of N without
> > adjusting the fract_width means there are too few integer bits and too
> many
> > fractional bits.
>
>
> ahh i remember. that took a while to get right when connecting to fpdiv.
>
>
> > additionally, some of the shifts and bit sliced will have
> > to be adjusted to get the right bits.
> >
> > >
> > > no reversion should be needed.
> > >
> >
> > except that, last I checked DivPipeCore doesn't correctly do divisions
> when
> > configured to only support UDivRem, since that's when it enables the
> broken
> > code adjustments.
>
>
> yuk. hmm a way to "cheat" there: tell it that it can handle sqrt as well,
> temporarily :)
>
I think a better way would be to find all the code like:
if core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3
and replace every occurrence with:
# TODO(programmerjake): re-enable once bit_width reduction is fixed
if False and core_config.supported == {DP.UDivRem}:
self.compare_len = bw * 2
else:
self.compare_len = bw * 3
As far as I can tell, that should work.
Jacob
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
next prev parent reply index
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-18 22:18 [libre-riscv-dev] lots of stuff broken Luke Kenneth Casson Leighton
2020-07-19 6:55 ` Jacob Lifshay
2020-07-19 10:46 ` Luke Kenneth Casson Leighton
2020-07-19 21:11 ` Luke Kenneth Casson Leighton
2020-07-19 21:27 ` [libre-riscv-dev] div pipe Jacob Lifshay
2020-07-19 22:07 ` Luke Kenneth Casson Leighton
2020-07-20 0:32 ` Jacob Lifshay
2020-07-20 1:38 ` Luke Kenneth Casson Leighton
2020-07-20 2:06 ` Jacob Lifshay [this message]
2020-07-20 2:13 ` Luke Kenneth Casson Leighton
2020-07-20 3:21 ` Jacob Lifshay
2020-07-20 10:31 ` Luke Kenneth Casson Leighton
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=CAC2bXD5ODi8di2yqitLQ40MSychRA-2WGg0+zH7U-wKCe5A2WA@mail.gmail.com \
--to=programmerjake@gmail.com \
--cc=libre-riscv-dev@lists.libre-riscv.org \
/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
Libre RISC-V Mailing list Archives (accessible via public-inbox)
Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev
Example config snippet for mirrors
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git