[libre-riscv-dev] fp special functions

Jacob Lifshay programmerjake at gmail.com
Mon Aug 5 01:45:44 BST 2019


On Sun, Aug 4, 2019, 17:36 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:

> On Sun, Aug 4, 2019 at 7:17 PM Jacob Lifshay <programmerjake at gmail.com>
> wrote:
>
> > trig-pi functions (range reduction is trivial (x mod 2.0)):
> > * sinpi
> > * cospi
> > * sincospi (non-standard; like sincos)
> > * atan2pi
>
> oof.  that's... 85% of funct5=01011 taken up:
> https://libre-riscv.org/rv_major_opcode_1010011/#transcendentals_1op
>
> please review / check, make sure i didn't miss any from the list.
> this is *1-op* only, i'll do 2-op later.
>
atan2/atan2pi are 2-input 1-output ops. Not sure that reciprocal is needed,
for correctly rounded results it's the same as fdiv. if we want it to not
be correctly rounded, I think we should specify the exact results to
promote repeatability.

>
> sincos and sincospi do simultaneous sin and cosine result, i'd
> recommend those be done as fused macro-ops, that's generally how
> 2-result-op is done in RISC-V.
>
sounds good to me.

Jacob


More information about the libre-riscv-dev mailing list