Bug 915 - add overflow to av maxu and maxs operations
Summary: add overflow to av maxu and maxs operations
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: Other Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL: https://libre-soc.org/openpower/sv/av...
Depends on:
Blocks: 952
  Show dependency treegraph
 
Reported: 2022-08-28 18:50 BST by Luke Kenneth Casson Leighton
Modified: 2022-10-24 09:42 BST (History)
1 user (show)

See Also:
NLnet milestone: NLnet.2022-08-051.OPF
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

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2022-08-28 18:50:40 BST
actually maxu. and maxs. as well as minu. and maxu.
these are needed for potential saturation scenarios

overflow occurs when src2 "wins" over src1.  swapping
the operands allows the opposite detection with no
need for a 2nd operation.

when used in sv with a scalar src2 it can be used to
clamp *and detect* when clamping occurred on an entire
vector src1.
Comment 1 Luke Kenneth Casson Leighton 2022-10-14 15:13:08 BST
also need Rc=1 variants which merge "cmp" functionality into
the instructions.  has to be done carefully because it's not
exactly the same as normal Rc=1, it is more like "cmp".
Comment 2 Luke Kenneth Casson Leighton 2022-10-23 17:03:57 BST
combined cmp with max:

* the lt flag is set if RA<RB
* the gt flag if RA>RB

etc.

but XER.SO being set can detect if the entire batch is set.
the dependencies however are hell.  it would be better to have
a CRfield vector "reduction" operation, afterwards.
Comment 3 Luke Kenneth Casson Leighton 2022-10-24 09:41:15 BST
CR0.GT being set is effectively "src2 wins"
CR0.LT is effectively "src1 wins"
CR0.EQ is effectively "nobody wins"