[libre-riscv-dev] Introduction

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue Feb 5 01:15:59 GMT 2019


---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

On Tue, Feb 5, 2019 at 1:08 AM Jacob Lifshay <programmerjake at gmail.com> wrote:
>
> On Mon, Feb 4, 2019, 17:04 Luke Kenneth Casson Leighton <lkcl at lkcl.net
> wrote:
>
> > ---
> > crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
> >
> > On Tue, Feb 5, 2019 at 12:05 AM Jacob Lifshay <programmerjake at gmail.com>
> > wrote:
> > >
> > > On Mon, Feb 4, 2019, 15:59 Luke Kenneth Casson Leighton <lkcl at lkcl.net
> > > wrote:
> > >
> > > > On Mon, Feb 4, 2019 at 11:45 PM Jacob Lifshay <
> > programmerjake at gmail.com>
> > > > wrote:
> > > > >
> > > > > lets use python then.
> > > >
> > > > checking....
> > > >
> > > > # pip3 install sfpy
> > > > $ python3
> > > > >>> import sfpy
> > > > >>> sfpy.Float16.from_bits(0x10)
> > > > Float16(9.5367431640625e-07)
> > > > >>> sfpy.Float16.from_bits(0x1000)
> > > > Float16(0.00048828125)
> > > > >>> sfpy.Float16.from_bits(0x0000)
> > > > Float16(0.0)
> > > >
> > > > main concern alleviated, there's a conversion from hex (bits)
> > > >
> > > > has all of the functions from berkeley softfloat3 all there.
> > > >
> > > no, it doesn't (assuming you posted the complete list).
> > > it's missing tininess before/after rounding, which RISC-V defines to be
> > > after rounding.
> >
> > ah well spotted.  RISCV/specialize.h... arse.  ok tracking that
> > through to the Makefile "build/Linux-x86_64-GCC/Makefile":
> > SPECIALIZE_TYPE ?= 8086-SSE
> >
> no, the RISC-V folder is for implementing softfloat using risc-v
> instructions, not for simulating them.
>
> you want the softfloat_detectTininess variable from softfloat.h

berkeley-softfloat-3/source$ grep -ri detectTin

include/softfloat.h:extern THREAD_LOCAL uint_fast8_t softfloat_detectTininess;
s_roundPackToF16.c:                (softfloat_detectTininess ==
softfloat_tininess_beforeRounding)
softfloat_state.c:THREAD_LOCAL uint_fast8_t softfloat_detectTininess =
init_detectTininess;

yep, my mistake.

ieee754fpu/sfpy$ grep -ri detectTin
sfpy/cfloat.pxd:    # extern uint_fast8_t softfloat_detectTininess; #
THREAD_LOCAL

nuts.  it's commented-out.  wonder why.

l.



More information about the libre-riscv-dev mailing list