[Libre-soc-dev] SimdSignal library

Jacob Lifshay programmerjake at gmail.com
Mon Oct 4 23:59:40 BST 2021


On Sat, Oct 2, 2021, 21:32 Jacob Lifshay <programmerjake at gmail.com> wrote:

> On Sat, Oct 2, 2021, 02:50 lkcl <luke.leighton at gmail.com> wrote:
>
>> in attempting to correct them i couldn't even understand what this is
>> doing:
>>
>>         self.reference_output_values = {
>>             lane, tuple(
>>                 inp.sig[lane.translate_to(layout).as_slice()]
>>                 for inp, layout in zip(self.inputs, self.layouts))
>>             for lane in self.layouts[0].lanes()
>>         }
>
> well, it's actually:
>         self.reference_output_values = {
>             lane: tuple(
>                 inp.sig[lane.translate_to(layout).as_slice()]
>                 for inp, layout in zip(self.inputs, self.layouts))
>             for lane in self.layouts[0].lanes()
>         }
>

Turns out that was even more badly mangled than I thought when I looked at
the commit diff instead of the email, you deleted a whole subexpression (3
different times!) since your regex thought it was a type annotation instead
of what it is: the value for a dict entry.

Fixed:
 259         self.reference_output_values = {
 260             lane: Value.cast(reference(lane, tuple(
 261                 inp.sig[lane.translate_to(layout).as_slice()]
 262                 for inp, layout in zip(self.inputs, self.layouts))))
 263             for lane in self.layouts[0].lanes()
 264         }

I returned it to working order and finished removal of type info:
https://git.libre-soc.org/?p=ieee754fpu.git;a=commitdiff;h=8c8300e7d16782d634c6dfb6d84621712b4585e2

next: changing it to not use complex comprehensions.

Jacob

>


More information about the Libre-soc-dev mailing list