Bug#1100781: yosys: Bring back i386/32bit support
Scott Ashcroft
scott.ashcroft at hotmail.com
Tue Mar 18 21:52:23 GMT 2025
On Tue, 2025-03-18 at 19:23 +0000, Scott Ashcroft wrote:
> That only leaves the cxxrtl tests failing. I don't think fixing them
> will be as straightforward.
Once I figured out what the test was trying to do it turned out to be
quite simple.
It is trying to compare the cxxrtl versions of some operations to the
standard ones.
One of these is 'count leading zeros' or clz.
The standard version they chose to test against is __builtin_clzl but
they used it on a uint64_t.
That's fine on 64-bit arches where longs are 64-bit but on 32-bit and
if gives the wrong answers.
If it was just for Debian I'd would have swapped to __builtin_clzg
which works all this stuff out but that's only arrived in gcc-14.
If it was just for Linux then always using __builtin_clzll would
probably work as long longs are 64-bit.
But since upstream support Windows and Mac OSX I went with the
equivalent of:
if long is 32-bit use __builtin_clzll else use _builtin_clzl
If we can get the three fixes accepted upstream 32-bit should build and
pass all tests.
Cheers,
Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cxxrtl.patch
Type: text/x-patch
Size: 396 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20250318/e6469ea6/attachment.bin>
More information about the debian-science-maintainers
mailing list