Bug 1245

Summary: av.mdwn minmax has separate pseudocode when Rc=1 which it definitely should not
Product: Libre-SOC's first SoC Reporter: Luke Kenneth Casson Leighton <lkcl>
Component: Source CodeAssignee: Jacob Lifshay <programmerjake>
Status: CONFIRMED ---    
Severity: enhancement CC: libre-soc-bugs, programmerjake
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Linux   
URL: https://libre-soc.org/openpower/isa/av/
See Also: https://bugs.libre-soc.org/show_bug.cgi?id=1057
https://bugs.libre-soc.org/show_bug.cgi?id=676
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:
Bug Depends on:    
Bug Blocks: 1012, 1230    

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.