[Libre-soc-dev] SimdSignal update
Luke Kenneth Casson Leighton
lkcl at lkcl.net
Wed Oct 27 12:08:52 BST 2021
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68
On Wed, Oct 27, 2021 at 10:32 AM Jacob Lifshay <programmerjake at gmail.com> wrote:
>
> I ended up somewhat distracted by other stuff, then I finished figuring out
> all of what you have done so far for SimdSignal and Cat,
i need to keep this brief because i have to focus on the OpenPOWER talk.
in the constructor, the plan is to use SimdScope.__add__ to compute
the total width: sum(map(lambda s:s.scope, self.catlist)) should do the trick.
this critically relies on SimdScope.__add__ working with *both* fixed_width
*and* elwidths.
i just realised though that there's a number of different cases, and it'll
need to be gone over thoroughly and be documented thoroughly, before
proceeding with writing code.
* when adding / mulling / etc. integers, fixed_width priority or
elwidths priority is easy
*BUT*, add/sub will need to fail if BOTH are set. mul on the other
hand is fine
because fixed_width*5 and elwidths-dict *5 is "compatible".
div however would fail on both fixed_width and elwidths if rounding occurs
shift up will always succeed
shift down will FAIL on both fixed_width-elwidths but only if the
shifted-out bits are nonzero
* when adding / subbing SimdShape to SimdShape then YES you are correct,
jacob: fixed_width must be IGNORED, the priority MUST always be on the
elwidths because the entirety of the elements must have room. this is for
PartitionedCat() to be able to succeed in adding a
fixed_width-priority SimdSignal
to an elwidths-priority SimdSignal.
so it is complex and a bit more than the 50-or-so lines i originally
envisaged, but
not that much.
also because of the different rules it is *not possible* to use a
common meta-function
also because of the different rules *please listen when i say keep it
to the absolute
bare minimum* and do not go spending time creating operators that have no
IMMEDIATE (on-demand) need.
add sub mul div shift-up shift-down for now.
l.
More information about the Libre-soc-dev
mailing list