[libre-riscv-dev] fp special functions

Jacob Lifshay programmerjake at gmail.com
Mon Aug 5 07:41:55 BST 2019


lui t0, 0x3F800 // upper bits of f32 1.0
fmv.x.s ft0, t0
fatan2pi.s rd, rs1, ft0

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

> On Monday, August 5, 2019, Luke Kenneth Casson Leighton <lkcl at lkcl.net>
> wrote:
>
> >
> >
> > On Monday, August 5, 2019, Jacob Lifshay <programmerjake at gmail.com>
> wrote:
> >
> >> On Sun, Aug 4, 2019, 22:41 Luke Kenneth Casson Leighton <lkcl at lkcl.net>
> >> wrote:
> >>
> >> > https://libre-riscv.org/rv_major_opcode_1010011/#transcendentals_1op
> >> >
> >> > wow, that filled up *real* fast.  i'd missed atan, in a 2nd reading of
> >> > bug #127 - got it now.
> >> >
> >> note that atan(x) and atanpi(x) are just atan2(x, 1.0) and atan2pi(x,
> >> 1.0),
> >> so the atan and atanpi instructions are not needed
> >
> >
> > Ok great, will move them to pseudo op aliases.
> >
> >
> Hang on... there's no immed for loading 1.0 into an FP reg, it's one of the
> downsides of RISCV, a FLD is a hard requirement.
>
> Hmmm....
>
>
>
> --
> ---
> crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev at lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
>


More information about the libre-riscv-dev mailing list