Bug 599 - Usage of LSB0 in EXTRA pseudo-code
Summary: Usage of LSB0 in EXTRA pseudo-code
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Specification (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on:
Blocks:
 
Reported: 2021-02-15 21:21 GMT by Cesar Strauss
Modified: 2021-02-20 14:32 GMT (History)
1 user (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments
Proposed fixes for MSB0 issues in pseudo-code (3.41 KB, patch)
2021-02-20 12:08 GMT, Cesar Strauss
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cesar Strauss 2021-02-15 21:21:25 GMT
Consider the pseudo-code for register number augmentation:

https://libre-soc.org/openpower/sv/svp64/#index13h1

Accorting to the tables below, it seems that the bit for scalar/vector selection in "spec" is intended to be its MSB.

So, in MSB0 notation, it should be spec[0], not spec[2].

The augmentation bits then are the two less significant, so it should be spec[1:2], not spec[0:1].

In other words:

if extra3_mode:
    spec = EXTRA3
else:
    spec = EXTRA2 << 1 # same as EXTRA3, shifted
if spec[0]: # vector (MSB of spec)
     return (RA << 2) | spec[1:2]
else:         # scalar
     return (spec[1:2] << 5) | RA
Comment 1 Cesar Strauss 2021-02-20 12:08:15 GMT
Created attachment 126 [details]
Proposed fixes for MSB0 issues in pseudo-code

After a review of SVP64 register remapping documentation, I found these places where LSB0 numbering was being used in pseudo-code. OK to commit?
Comment 2 Luke Kenneth Casson Leighton 2021-02-20 12:16:32 GMT
Comment on attachment 126 [details]
Proposed fixes for MSB0 issues in pseudo-code

ah ok in the spec?  yes go for it.  i will try not to cry into my tea too much.  ok i'm done.  commit it :)
Comment 3 Cesar Strauss 2021-02-20 14:32:01 GMT
(In reply to Luke Kenneth Casson Leighton from comment #2)
> ah ok in the spec?  yes go for it.  i will try not to cry into my tea too
> much.  ok i'm done.  commit it :)

Done.