[Libre-soc-bugs] [Bug 713] PartitionedSignal enhancement to add partition-context-aware lengths
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Fri Oct 15 06:13:09 BST 2021
https://bugs.libre-soc.org/show_bug.cgi?id=713
--- Comment #119 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Jacob Lifshay from comment #108)
> (In reply to Luke Kenneth Casson Leighton from comment #107)
> > (In reply to Jacob Lifshay from comment #106)
> > > I read through all the new layout() code, looks mostly fine, though afaict
> > > the computation of bmask is incorrect if the object was to figure out which
> > > partitions are always padding.
> >
> > yes, i can't quite work it out. if you can fix that, these algorithmic
> > things do my head in.
>
> yeah, I can do that tomorrow (actually today, but you get what I meant).
Done. I changed bmask to be such that bmask & (1 << i) is set if partition
index i is always padding. Note that there is one more partition than the
number of ppoints, since ppoints separate partitions, not are partitions.
Demo manually worked out in comments:
https://git.libre-soc.org/?p=ieee754fpu.git;a=blob;f=src/ieee754/part/layout_experiment.py;h=6c32022ec750433ff5adca21f4345cfca51181e2;hb=HEAD#l324
# combined with vec_el_counts {0:1, 1:1, 2:2, 3:4} we have:
# elwidth=0b00 1x 24-bit
# elwidth=0b01 1x 12-bit
# elwidth=0b10 2x 5-bit
# elwidth=0b11 4x 6-bit
#
# bmask<--------1<----0<---------10<---0<-------1<0<----0<---0<----00<---0
# always unused:| | | || | | | | | | || |
# 1111111111000000 1111111111000000 1111111100000000 0000000000000000
# | | | || | | | | | | || |
# 0b00 xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxx........ ..............24|
# 0b01 xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxx..........12|
# 0b10 xxxxxxxxxxxxxxxx xxxxxxxxxxx....5|xxxxxxxxxxxxxxxx xxxxxxxxxxx....5|
# 0b11 xxxxxxxxxx.....6|xxxxxxxxxx.....6|xxxxxxxxxx.....6|xxxxxxxxxx.....6|
# ^ ^ ^^ ^ ^ ^ ^ ^ ^^
# ppoints: | | || | | | | | ||
# | bit-48 /\ | bit-24-/ | | bit-12 /\-bit-5
# bit-54 bit-38-/ \ bit-32 | bit-16 /
# bit-37 bit-22 bit-6
So, in that example bmask = 0b101001000000
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list