[Libre-soc-bugs] [Bug 1157] Implement poly1305

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Nov 19 23:06:17 GMT 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1157

--- Comment #37 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Sadoon Albader from comment #36)

> Says there that vl=10, clearly it is set to 6, is that just a typo?

ignore or fix it, i don't mind which.

> Nevermind. I'm at that stage where I can't see the forest for the trees.

no forest, no trees. it is very simple.  go through it step by step.

overview. SV Loops https://libre-soc.org/openpower/sv/overview/

    for i = 0 to VL-1:
       GPR(RT+i) = GPR(RA+i) + GPR(RB+i)

remap. dead simple. https://libre-soc.org/openpower/sv/remap/

    for i in range(VL):
       GPR[RT+remap1(i)] <= GPR[RA+remap2(i)] + GPR[RB+remap3(i)];

indexed. also dead simple.

    def index_remap(i):
        return GPR((SVSHAPE.SVGPR<<1)+i)
    for i in 0..VL-1:
        GPR(RT + indexed_remap(i)) = ...

*THAT IS ALL THERE IS TO IT*. full stop.

you can see it right there in the unit test expected results.

    118         for i in range(6):
    119             RA = initial_regs[0+ ----===>>>idxs[i]<<<====----]
    120             RB = initial_regs[0+i]
    121             expected_regs[i+8] = RA+RB

RA: Index-REMAPped
RB: *NOT* REMAPped.

you are expecting the VALUES to "magically" be REMAPped but have not
supplied any INDEXes.  you must SUPPLY the Indices to use for REMAP
and i recommended they start at r20. this is NOT THE SAME AS THE VALUES
which start at r0. how else can the values be REMAPped if you supply no
indices?

to repeat:

    THE INDICES HAVE NOTHING TO DO WITH THE VALUES.

conceptually the code that you wrote is attempting to do this:

    118         for i in range(6):
    119             RA = idxs[i] # values conflated as indices

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list