* [libre-riscv-dev] [Bug 174] NLNet 2019 Formal Standards OpenPOWER proposal 2019-10-046
From: bugzilla-daemon @ 2020-04-15 12:14 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-174-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=174
Luke Kenneth Casson Leighton <lkcl@lkcl.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|CONFIRMED |IN_PROGRESS
--- Comment #5 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
received signed MoU from Bob Goudriaan at NLNet (with thanks and gratitude)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 284] TypeError Object is not an nMigen signal
From: bugzilla-daemon @ 2020-04-15 16:57 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-284-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=284
--- Comment #4 from Tobias Platen <libre-soc@platen-software.de> ---
Now the documentation is fixed
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 182] Move to libre-soc.org
From: bugzilla-daemon @ 2020-04-15 17:05 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-182-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=182
Alain D D Williams <addw@phcomp.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|CONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #26 from Alain D D Williams <addw@phcomp.co.uk> ---
I think that all is now done.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 185] Getting 502 Bad Gateway
From: bugzilla-daemon @ 2020-04-15 17:06 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-185-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=185
Alain D D Williams <addw@phcomp.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|CONFIRMED |RESOLVED
--- Comment #22 from Alain D D Williams <addw@phcomp.co.uk> ---
All now done
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 17:54 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #6 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #5)
> ok so would you like to do the next step? which is, yep you guessed it:
> IEEE754 FP sin and cos :)
I'm not really sure how to do this though. I know you did a similar thing on
the divider, did you handle it as a float the entire way through or convert it
to integer... somehow?
Doing it as a float means that the adders/subtractors need to be full floating
point adders, like those in fpadd/, right?
For converting the inputs to integers, it seems like there would be issues as
the input angle approached 0 (because floats give more resolution there). Cole
emailed me a paper (which I linked to in the resources page) that contained a
hybrid cordic that switched to a taylor series approximation when the input
became small enough. This seems like it might work reasonably well for handling
the small input case.
Thoughts?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* Re: [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: Cole Poirier @ 2020-04-15 18:04 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: libre-riscv-dev
In-Reply-To: <bug-208-13-S4waoUKkxV@https.bugs.libre-soc.org/>
On Apr 15 2020, at 10:54 am, bugzilla-daemon@libre-soc.org wrote:
> https://bugs.libre-soc.org/show_bug.cgi?id=208
>
> --- Comment #6 from Michael Nolan <mtnolan2640@gmail.com> ---
> (In reply to Luke Kenneth Casson Leighton from comment #5)
>> ok so would you like to do the next step? which is, yep you guessed it:
>> IEEE754 FP sin and cos :)
>
> I'm not really sure how to do this though. I know you did a similar
> thing on
> the divider, did you handle it as a float the entire way through or
> convert it
> to integer... somehow?
>
> Doing it as a float means that the adders/subtractors need to be full floating
> point adders, like those in fpadd/, right?
>
> For converting the inputs to integers, it seems like there would be
> issues as
> the input angle approached 0 (because floats give more resolution
> there). Cole
> emailed me a paper (which I linked to in the resources page) that
> contained a
> hybrid cordic that switched to a taylor series approximation when the input
> became small enough. This seems like it might work reasonably well for handling
> the small input case.
>
> Thoughts?
>
> Michael
Here's the link to the paper, which you've linked to on the resources
page. I just thought I'd include it in this bug/mailing list for ease of
access: "Low Latency and Low Error Floating-Point Sine/Cosine Function
Based TCORDIC Algorithm" (https://ieeexplore.ieee.org/document/7784797).
For project members that do not have IEEE explore access, please email
Michael or myself off-list.
I also think that this paper may be relevant, however, I am not entirely sure.
"Pipelined Range Reduction Based Truncated Multiplier" (https://ieeexplore.ieee.org/document/9062697).
Cole
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 286] DataPointer concept: long-immediate references
From: bugzilla-daemon @ 2020-04-15 18:44 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-286-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=286
Jacob Lifshay <programmerjake@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |programmerjake@gmail.com
--- Comment #5 from Jacob Lifshay <programmerjake@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #4)
> particularly as a reduction in i-cache
> size obeys a square law reduction in power consumption.
I would expect the cache power usage to be linearly proportional to it's size
in bits once it's big enough to split into many smaller sram chunks, since each
sram chunk would use about the same power and you'd only need a linear number
of them. I have not been able to find any useful references for that though.
> therefore if we can
> get it down 5% that's a 10.25% reduction in power (!)
yes -- except that cache sizes are almost always a power of 2 in size (or
rarely 3 * 2^n), so the only effect is probably to reduce the access rate.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 19:14 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #7 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #6)
> (In reply to Luke Kenneth Casson Leighton from comment #5)
> > ok so would you like to do the next step? which is, yep you guessed it:
> > IEEE754 FP sin and cos :)
>
> I'm not really sure how to do this though. I know you did a similar thing on
> the divider, did you handle it as a float the entire way through or convert
> it to integer... somehow?
integer, and kept things at the same exponent. i.e. we:
* adjusted the relative range of both numbers a and b so that they
had the same exponent (-1 from exp, shift mantissa until exp(a)==exp(b)
* keeping enough bits (3x the IEEE754 length in some places) at all times
so that there will be no loss of precision
* from that point on treated the mantissa as an integer, *completely ignoring*
the exponent until
* finally at the end "re-normalising" the result.
> Doing it as a float means that the adders/subtractors need to be full
> floating point adders, like those in fpadd/, right?
actually fpadd simply does the same trick above as well. here's the original
jon dawson verilog code that we started from:
https://github.com/dawsonjon/fpu/blob/master/adder/adder.v#L174
you can see there's no "actual" FPadds, it's literally, "line up the
exponents, do an integer add, then adjust/normalise the result".
> For converting the inputs to integers, it seems like there would be issues
> as the input angle approached 0 (because floats give more resolution there).
it's ok to have double (or even triple) the number of bits being used for the
fixed-integer computation. so where the mantissa for FP32 is 23 bits, it's
ok to use 23*3 = 69 bits (plus a few more for rounding).
> Cole emailed me a paper (which I linked to in the resources page) that
> contained a hybrid cordic that switched to a taylor series approximation
> when the input became small enough. This seems like it might work reasonably
> well for handling the small input case.
unfortunately, as we will (later) be using the CORDIC block for other purposes,
not just SIN/COS but as an actual opcode, if it doesn't do "actual CORDIC"
we're stuffed, there.
i suspect that it might be possible, as the size of the ATAN2 constants
gets smaller, to "shift" the result up slightly.
this we can do - test out - right now long before trying to move to FP.
each CordicStage can take an extra argument which specifies that dx, dy and
dz should be shifted by N extra bits.
the transfer of input to output needs to take into consideration that the
next stage is going to be shifted by N.
in this way, smaller numbers don't end up losing quite so many bits.
the only thing we have to make sure is that, throughout the whole pipeline,
there's enough extra bits such that the shifts do *not* end hitting the
ceiling of the maximum range of x (or y).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 19:16 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #8 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
ah.
on other thing.
i don't really trust the standard c-library atan to be accurate enough.
i think we should use python bigfloat, here. it can produce arbitrary
precision floating-point.
that way we can ensure that for FP64 CORDIC (64-bit sin/cos), by using
128-bit (or greater) atan2 tables, we get the full accuracy needed to
get the right answers for IEEE754 sin/cos FP64.
if we try to use the "standard" math atan2 library i guarantee we will
fail to get sufficient accuracy at the limits of the range.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 19:17 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #9 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
cole wrote (on the list):
http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2020-April/005993.html
Here's the link to the paper, which you've linked to on the resources
page. I just thought I'd include it in this bug/mailing list for ease of
access: "Low Latency and Low Error Floating-Point Sine/Cosine Function
Based TCORDIC Algorithm" (https://ieeexplore.ieee.org/document/7784797).
For project members that do not have IEEE explore access, please email
Michael or myself off-list.
I also think that this paper may be relevant, however, I am not entirely sure.
"Pipelined Range Reduction Based Truncated Multiplier"
(https://ieeexplore.ieee.org/document/9062697).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 19:19 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #10 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Luke Kenneth Casson Leighton from comment #9)
> cole wrote (on the list):
> "Pipelined Range Reduction Based Truncated Multiplier"
> (https://ieeexplore.ieee.org/document/9062697).
appreciated. things like this are important to look at because we
can always learn something, even if it's "nice, however we're not
going to do it that way".
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* Re: [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: Cole Poirier @ 2020-04-15 19:21 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: libre-riscv-dev
In-Reply-To: <bug-208-13-lHYqPg44iK@https.bugs.libre-soc.org/>
On Apr 15 2020, at 12:19 pm, bugzilla-daemon@libre-soc.org wrote:
> https://bugs.libre-soc.org/show_bug.cgi?id=208
>
> --- Comment #10 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
> (In reply to Luke Kenneth Casson Leighton from comment #9)
>> cole wrote (on the list):
>
>> "Pipelined Range Reduction Based Truncated Multiplier"
>> (https://ieeexplore.ieee.org/document/9062697).
>
> appreciated. things like this are important to look at because we
> can always learn something, even if it's "nice, however we're not
> going to do it that way".
Thanks Luke. By the way, should I reply using the buzilla GUI instead of
replying on list?
Cole
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 286] DataPointer concept: long-immediate references
From: bugzilla-daemon @ 2020-04-15 19:22 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-286-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=286
--- Comment #6 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Jacob Lifshay from comment #5)
> (In reply to Luke Kenneth Casson Leighton from comment #4)
> > particularly as a reduction in i-cache
> > size obeys a square law reduction in power consumption.
>
> I would expect the cache power usage to be linearly proportional to it's
> size in bits once it's big enough to split into many smaller sram chunks,
> since each sram chunk would use about the same power and you'd only need a
> linear number of them.
whilst the cache power usage itself is linear (that being one dimension
of the square effect), the increased size means that on loops you cannot
fit as much code of the average loop *into* that cache, meaning that you
end up with more L2 cache lookups. this i believe is where the 2nd of
the two dimensions of the square effect comes in.
it's quite... odd :)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* Re: [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: Luke Kenneth Casson Leighton @ 2020-04-15 19:25 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <E5D90FB8-1D7E-43B6-8225-AAB6E3DE7ABF@getmailspring.com>
On Wed, Apr 15, 2020 at 8:21 PM Cole Poirier <colepoirier@gmail.com> wrote:
> On Apr 15 2020, at 12:19 pm, bugzilla-daemon@libre-soc.org wrote:
> Thanks Luke. By the way, should I reply using the buzilla GUI instead of
> replying on list?
well, the answer to that should be clear from reading the bug
comments. what you wrote... isn't... there... therefore as far as the
bugreport is concerned, it is as if you never wrote it.
lesson: mailing lists are for one-off communication (fire-and-forget).
they are *not* "informational resources", and they are not
task-orientated management systems. *wikis* are informational
resources. *bugtrackers* are task-orientated management systems
l.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* Re: [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: Cole Poirier @ 2020-04-15 19:29 UTC (permalink / raw)
To: Libre-RISCV General Development; +Cc: Libre-RISCV General Development
In-Reply-To: <CAPweEDyiHhvz-X2jDQDrmOO4PNS=km5nsdzLivRqk97iiZnuHg@mail.gmail.com>
On Apr 15 2020, at 12:25 pm, Luke Kenneth Casson Leighton
<lkcl@lkcl.net> wrote:
> On Wed, Apr 15, 2020 at 8:21 PM Cole Poirier <colepoirier@gmail.com> wrote:
>
>> On Apr 15 2020, at 12:19 pm, bugzilla-daemon@libre-soc.org wrote:
>> Thanks Luke. By the way, should I reply using the buzilla GUI instead of
>> replying on list?
>
> well, the answer to that should be clear from reading the bug
> comments. what you wrote... isn't... there... therefore as far as the
> bugreport is concerned, it is as if you never wrote it.
>
> lesson: mailing lists are for one-off communication (fire-and-forget).
> they are *not* "informational resources", and they are not
> task-orientated management systems. *wikis* are informational
> resources. *bugtrackers* are task-orientated management systems
>
> l.
Thanks Luke, I appreciate the clarification all the same.
Cole
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 19:34 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #11 from Michael Nolan <mtnolan2640@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #7)
> integer, and kept things at the same exponent. i.e. we:
>
> * adjusted the relative range of both numbers a and b so that they
> had the same exponent (-1 from exp, shift mantissa until exp(a)==exp(b)
> * keeping enough bits (3x the IEEE754 length in some places) at all times
> so that there will be no loss of precision
> * from that point on treated the mantissa as an integer, *completely
> ignoring*
> the exponent until
> * finally at the end "re-normalising" the result.
Ah ok, this makes more sense.
> unfortunately, as we will (later) be using the CORDIC block for other
> purposes,
> not just SIN/COS but as an actual opcode, if it doesn't do "actual CORDIC"
> we're stuffed, there.
Ah I see. So at some point we'll be wanting to use this for general rotations,
hyperbolic sin/cos, and such?
>
> i suspect that it might be possible, as the size of the ATAN2 constants
> gets smaller, to "shift" the result up slightly.
>
> this we can do - test out - right now long before trying to move to FP.
> each CordicStage can take an extra argument which specifies that dx, dy and
> dz should be shifted by N extra bits.
I think I sort of understand - you want to scale up dx, dy (and presumably x
and y) when they're small so that they have more bits of precision.
One thing that occurred to me - since power (and I assume riscv) don't include
any sin/cos opcodes but instead use a function in libc to calculate them, the
cordic would only be used by the GPU, right? If that's the case, do sin/cos
necessarily need to be as accurate as the result from libc?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 286] DataPointer concept: long-immediate references
From: bugzilla-daemon @ 2020-04-15 19:40 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-286-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=286
--- Comment #7 from Jacob Lifshay <programmerjake@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #6)
> (In reply to Jacob Lifshay from comment #5)
> > (In reply to Luke Kenneth Casson Leighton from comment #4)
> > > particularly as a reduction in i-cache
> > > size obeys a square law reduction in power consumption.
> >
> > I would expect the cache power usage to be linearly proportional to it's
> > size in bits once it's big enough to split into many smaller sram chunks,
> > since each sram chunk would use about the same power and you'd only need a
> > linear number of them.
>
> whilst the cache power usage itself is linear (that being one dimension
> of the square effect), the increased size means that on loops you cannot
> fit as much code of the average loop *into* that cache, meaning that you
> end up with more L2 cache lookups. this i believe is where the 2nd of
> the two dimensions of the square effect comes in.
I think you might be incorrect: increasing the size of the L1 cache should
increase hit rate which decreases the rate of accessing L2 and memory. Having a
bigger cache allows fitting more code into the cache, reducing the miss rate.
So, increasing the cache size would have a slightly less than linear increase
in power consumption due to decreasing L2 accesses.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 19:54 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
Cole Poirier <colepoirier@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |colepoirier@gmail.com
--- Comment #12 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Michael Nolan from comment #11)
> (In reply to Luke Kenneth Casson Leighton from comment #7)
> > unfortunately, as we will (later) be using the CORDIC block for other
> > purposes,
> > not just SIN/COS but as an actual opcode, if it doesn't do "actual CORDIC"
> > we're stuffed, there.
>
> Ah I see. So at some point we'll be wanting to use this for general
> rotations, hyperbolic sin/cos, and such?
>
> >
> > i suspect that it might be possible, as the size of the ATAN2 constants
> > gets smaller, to "shift" the result up slightly.
> >
> > this we can do - test out - right now long before trying to move to FP.
> > each CordicStage can take an extra argument which specifies that dx, dy and
> > dz should be shifted by N extra bits.
>
> I think I sort of understand - you want to scale up dx, dy (and presumably x
> and y) when they're small so that they have more bits of precision.
>
> One thing that occurred to me - since power (and I assume riscv) don't
> include any sin/cos opcodes but instead use a function in libc to calculate
> them, the cordic would only be used by the GPU, right? If that's the case,
> do sin/cos necessarily need to be as accurate as the result from libc?
Michael, here are some possibly relevant links to FPU accuracy... or rather
inaccuracy. I've also added them to the resources page under "5.4 Past FPU
Mistakes to learn from".
Intel Underestimates Error Bounds by 1.3 quintillion
Posted on October 9, 2014 to Random ASCII – tech blog of Bruce Dawson
https://randomascii.wordpress.com/2014/10/09/intel-underestimates-error-bounds-by-1-3-quintillion/
Intel overstates FPU accuracy 06/01/2013
http://notabs.org/fpuaccuracy/
Cole
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 284] TypeError Object is not an nMigen signal
From: bugzilla-daemon @ 2020-04-15 21:08 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-284-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=284
--- Comment #5 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Tobias Platen from comment #4)
> Now the documentation is fixed
fantastic. if anyone finds discrepancies do just sort them.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-15 21:30 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #13 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #11)
> (In reply to Luke Kenneth Casson Leighton from comment #7)
> > * from that point on treated the mantissa as an integer, *completely
> > ignoring*
> > the exponent until
> > * finally at the end "re-normalising" the result.
>
> Ah ok, this makes more sense.
FP is odd, it can only be done in fixedpoint. however it is actually
relatively straightforward. the only real tricky bits are that rounding rules
and interactions can be seriously obtuse.
>
> > unfortunately, as we will (later) be using the CORDIC block for other
> > purposes,
> > not just SIN/COS but as an actual opcode, if it doesn't do "actual CORDIC"
> > we're stuffed, there.
>
> Ah I see. So at some point we'll be wanting to use this for general
> rotations, hyperbolic sin/cos, and such?
yes. a general purpose CORDIC engine with all possible modes (i think there
are at least 3: linear, rotate and hyperbolic) and to make an instruction that
can access aaall those modes...
...yet for sin, cos, log etc use that exact same engine by setting some of
those parameters manually.
> >
> > i suspect that it might be possible, as the size of the ATAN2 constants
> > gets smaller, to "shift" the result up slightly.
> >
> > this we can do - test out - right now long before trying to move to FP.
> > each CordicStage can take an extra argument which specifies that dx, dy and
> > dz should be shifted by N extra bits.
>
> I think I sort of understand - you want to scale up dx, dy (and presumably x
> and y) when they're small so that they have more bits of precision.
correct.
however we cannot lose sight of how *many* shifts occurred (in each stage and
cumulatively) because each shift would be a doubling (halving?) of the ultimate
answer.
i honestly do not know if it is a good idea to have dynamic shifting or not. it
would mean testing both x and y, but the problem is that might get small whilst
y gets large.
keeping track of whether shifting occurs, it is actually an exponent! you
double the mantissa (shift x/y up) however you need to *subtract* one from the
exponent when doing so.
and because x can get large while y gets small and vice versa now you would
need *two* exponents. worse than that, you need 2 copies of z because one z
needs likewise shifting down and the other up. too complicated.
hm.
i'm therefore tempted to suggest dropping one of x or y and setting a mode to
decide whether to compute a sin or cos result (but not both).
see how it goes.
> One thing that occurred to me - since power (and I assume riscv) don't
> include any sin/cos opcodes but instead use a function in libc to calculate
> them, the cordic would only be used by the GPU, right?
well if we propose the opcodes for fpsin and fpcos and they are accepted by the
OpenPOWER Foundation for a future version of POWER then yes some hardware would
call the opcodes whilst others would emulate it using libc. or libm.
> If that's the case,
> do sin/cos necessarily need to be as accurate as the result from libc?
we need to be Vulkan compliant however i think as long as it does not use
massive amounts of power we can do IEEE754 compliance.
if you mean testing *against* libc (libm), i honestly do not know if libm is
fully IEEE754 compliant and that's why i suggested testing against python
bigfloat for now.
later we will definitely need to use jacob's algorithmic library, to make sure
we have full compliance at the bit level.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-16 7:53 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #14 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
btw that "close to zero" is i think what wad meant about altering the range and
adding fractions of pi to the result.
sin x + 90 equals cos x
therefore in the ranges where either gets close to zero you use the OTHER
version.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-16 8:53 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
Jacob Lifshay <programmerjake@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |programmerjake@gmail.com
--- Comment #15 from Jacob Lifshay <programmerjake@gmail.com> ---
normally, for implementing sin, you specifically want to try to switch to
inputs close to zero rather than away, since that allows retaining much higher
accuracy, since for small x: sin(x) ≈ x (≈ is the approximately equal
operator).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-16 9:48 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #16 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Jacob Lifshay from comment #15)
> normally, for implementing sin, you specifically want to try to switch to
> inputs close to zero rather than away, since that allows retaining much
> higher accuracy, since for small x: sin(x) ≈ x (≈ is the approximately equal
> operator).
interesting, how we will be able to match that up with CORDIC.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* Re: [libre-riscv-dev] morphing 6600 code to use power decoder
From: Luke Kenneth Casson Leighton @ 2020-04-16 12:19 UTC (permalink / raw)
To: Libre-RISCV General Development
In-Reply-To: <CAPweEDxn1wqweqoz+-g3OoKkKDrxLUZ=zmcF-vLTEWow1ccohg@mail.gmail.com>
ok i've got the computation unit "operational" with multiple
go-read/acknowledge signals. i say operational, it's tricky code that
i'm not completely happy with, however it "works". finally i can move
on to getting the comp unit and dependency matrices multi-rd/write
signals integrated.
l.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
* [libre-riscv-dev] [Bug 208] implement CORDIC in a general way sufficient to do transcendentals
From: bugzilla-daemon @ 2020-04-16 15:36 UTC (permalink / raw)
To: libre-riscv-dev
In-Reply-To: <bug-208-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=208
--- Comment #17 from Michael Nolan <mtnolan2640@gmail.com> ---
I'm working on converting the floating point input to the fixed point value
needed by the cordic. I've got my module decoding the float into sign,
exponent, and mantissa with FPNumDecode, and the mantissa is missing the
(implied) leading 1 bit. I'm also looking at the modules of fpdiv (div0.py and
nmigen_div_experiment.py), and they don't seem to add that bit back in. Is
there a way to have FPNumDecode generate a mantissa with the leading 1 bit?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
^ permalink raw reply
page: next prev latest
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