Bug 910 - mins/maxs with (RB|0) or (RA|0) option?
Summary: mins/maxs with (RB|0) or (RA|0) option?
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Specification (show other bugs)
Version: unspecified
Hardware: Other Linux
: --- enhancement
Assignee: Jacob Lifshay
URL: https://libre-soc.org/openpower/sv/av...
Depends on:
Blocks: 952 1057
  Show dependency treegraph
 
Reported: 2022-08-24 14:45 BST by Luke Kenneth Casson Leighton
Modified: 2024-01-08 01:07 GMT (History)
3 users (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

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2022-08-24 14:45:29 BST
although there is saturation in svp64 the mins etc
instructions are standalone.  would it be useful to
allow zero-immediate in RA or RB?
Comment 1 Jacob Lifshay 2023-04-21 01:47:25 BST
https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=8e385d96fa576825af8111a3057ab39cfd34dd31

commit 8e385d96fa576825af8111a3057ab39cfd34dd31
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Thu Apr 20 17:45:05 2023 -0700

    change integer min/max to use (RA|0)

I still need to change the simulator
Comment 3 Dmitry Selyutin 2023-05-04 06:12:06 BST
I assume this again needs binutils update, since they do different RA vs (RA|0).
Comment 4 Jacob Lifshay 2023-05-04 06:13:33 BST
(In reply to Dmitry Selyutin from comment #3)
> I assume this again needs binutils update, since they do different RA vs
> (RA|0).

this should have been done as part of adding minmax instead of mins/maxs/minu/maxu
Comment 5 Dmitry Selyutin 2023-05-04 06:15:54 BST
I think I know the reason  We don't actually distinguish RA and RA0 in the codegen. There might be more places where we have this problem.
Comment 6 Dmitry Selyutin 2023-05-04 06:16:48 BST
So this is a common problem related to sv_binutils.py. I'll revisit all instructions we added and check for RA0 operand.
Comment 7 Dmitry Selyutin 2023-05-07 09:52:36 BST
It seems that minmax does not have its RA operand described as RA_OR_ZERO, therefore current binutils definition matches what we have at repo. I pushed a branch minmax_ra0 branch to openpower-isa with the relevant changes, and wait for CI to complete.

That said, I rechecked all instructions we have in binutils, and it seems that setvl must be fixed: it should have RA0 operand in binutils instead of RA.

For the record, the count of instructions we support is 295. I counted instructions marked as SFFS, but these are the only ones we have now.
Comment 8 Dmitry Selyutin 2023-05-07 10:19:54 BST
1. openpower-isa was updated with RA_OR_ZERO for minmax instruction.
2. binutils were updated with RA0 for minmax and its aliases.
3. In scope of this task, I rechecked all instructions we added into binutils, and found that setvl must also have RA0 operand, so I updated it respectively.

https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=6626fc852a2a18c85cdf8b621f7307dc1d35a25b
https://git.libre-soc.org/?p=binutils-gdb.git;a=commitdiff;h=60b205de34383d8e315b2b54b7723da084b4a59f