rsqrt / sqrt in xls

55 views
Skip to first unread message

Jonathan Bailey

unread,
Jan 10, 2021, 6:00:09 PM1/10/21
to xls-dev
Hi all,

I'm looking to implement some stuff that will require floating point square root and / or inverse square root.  There's a refrence to XLS rsqrt in ir/value_helpers.h.  However, I cannot find rsqrt itself.  Is there a publicly available rsqrt function for XLS?  If this is in refrence to a proprietary rsqrt module, can anyone point me to a generic reference on an appropriate ways to implement this in dslx / hardware so I can add it?

I'm also in the market for floating point division, power, exponent, sine, and cosine units, so pointers on these would also be appreciated.

Thanks,
Jonathan

Chris Leary

unread,
Jan 11, 2021, 12:19:09 PM1/11/21
to Jonathan Bailey, xls-dev
Hi Jonathan,

Sorry about that reference, it was vestigial from the open sourcing process -- we do have transcendental functions implemented for internal use that I don't /expect/ we'll be able to open source in the near term. I wonder if alternatively there are open "soft float" libraries that implement transcendental functions that we could synthesize -- not the greatest of pointers, but have you checked out what "soft float" libraries are available yet?

Cheers,

Leary

--
You received this message because you are subscribed to the Google Groups "xls-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xls-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xls-dev/ec611186-4bce-4443-b351-4396ebe9cfadn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Bailey

unread,
Jan 23, 2021, 8:08:13 PM1/23/21
to xls-dev
Hi Chris,

Took me awhile to get up to this point because floating point is an abomination, but I've got a simple floating-point division module working.  I used this Berkeley softfloat implementation as a reference: https://github.com/ucb-bar/berkeley-softfloat-3/blob/master/source/f32_div.c

That source includes a copyright notice / terms of use.  It specifies that the notice should included be with any redistribution (including with modifications).  I thought it'd be best to run this by internal folks to see if this is kosher.  For what it's worth, the xls implementation is fairly different from the Berkely version other than lines 120-127 from the linked source.  The different language dictates some differences and I mixed and matched ideas from the Berkely implementation and our other floating point modules.

Thanks,
Jonathan
Reply all
Reply to author
Forward
0 new messages