Bug 1245 - av.mdwn minmax has separate pseudocode when Rc=1 which it definitely should not
Summary: av.mdwn minmax has separate pseudocode when Rc=1 which it definitely should not
Status: CONFIRMED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Jacob Lifshay
URL: https://libre-soc.org/openpower/isa/av/
Depends on:
Blocks: 1012 1230
  Show dependency treegraph
 
Reported: 2024-01-07 20:36 GMT by Luke Kenneth Casson Leighton
Modified: 2024-01-07 21:34 GMT (History)
2 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 2024-01-07 20:36:21 GMT
hi jacob the usual way is to test Rc=1, we definitely
cannot present minmax to the ISA WG with two different
copies of the same pseudocode.
Comment 1 Luke Kenneth Casson Leighton 2024-01-07 21:09:40 GMT
also needs to be this style

    if      a < EXTS(SI) then c <- 0b100
    else if a > EXTS(SI) then c <- 0b010
    else                      c <- 0b001
    CR[4*BF+32:4*BF+35] <- c || XER[SO]

https://libre-soc.org/openpower/isa/comparefixed/

also needs CR0 to be matching the minmax.
right now the behaviour is counter-intuitive.
i think... ermermerm :)
Comment 2 Jacob Lifshay 2024-01-07 21:18:53 GMT
(In reply to Luke Kenneth Casson Leighton from comment #0)
> hi jacob the usual way is to test Rc=1, we definitely
> cannot present minmax to the ISA WG with two different
> copies of the same pseudocode.

iirc there's two copies because just testing Rc = 1 didn't work in the simulator, they should be identical except for commenting out the Rc = 1 block.

the minmax RFC contains a merged version with only one copy:
https://libre-soc.org/openpower/sv/rfc/ls013/
Comment 3 Jacob Lifshay 2024-01-07 21:21:17 GMT
(In reply to Luke Kenneth Casson Leighton from comment #1)
> also needs CR0 to be matching the minmax.
> right now the behaviour is counter-intuitive.
> i think... ermermerm :)

CR0 specifically matches RA <=> RB since that's the comparison done internally and imo the most useful output.
Comment 4 Jacob Lifshay 2024-01-07 21:34:45 GMT
changing bug #676 to see also instead of blocks, since minmax works just fine and is correct, it's just has non-optimal pseudo-code in terms of specification writing.