Bug 863 - AV opcode implementation, add to Decoder, CSV files
Summary: AV opcode implementation, add to Decoder, CSV files
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL: https://libre-soc.org/openpower/sv/av...
Depends on:
Blocks:
 
Reported: 2022-06-19 19:12 BST by Luke Kenneth Casson Leighton
Modified: 2022-08-10 17:27 BST (History)
2 users (show)

See Also:
NLnet milestone: NLNet.2019.10.031.Video
total budget (EUR) for completion of task and all subtasks: 3000
budget (EUR) for this task, excluding subtasks' budget: 3000
parent task for budget allocation: 234
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:
red = { amount = 2500, submitted = 2022-06-25, paid = 2022-08-09 } [jacob] amount = 500 submitted = 2022-07-06 paid = 2022-07-21


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2022-06-19 19:12:42 BST
add all AV opcodes (minmax, avgadd, avgsum) to simulator,
CSV files, PowerDecoder, svp64.py
Comment 1 Luke Kenneth Casson Leighton 2022-06-19 19:38:23 BST
add avgadd DRAFT instruction

https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=fe396116d1dbb039642f584879bb5d242c34befa
Comment 4 Jacob Lifshay 2022-06-19 23:00:19 BST
I fixed minu[.] to actually be unsigned:
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=2f9891616d1a251bbb83b1ab29da7040258847ab

i noticed absdu does signed comparison instead of unsigned, either that needs to be changed to unsigned (and probably renamed to absdiffu) or the name changed to absdiff (not absd since imho that would be interpreted as absolute value dword, not absolute difference).

i'm not sure which one you wanted, so i'll let you change it. imho we probably want both of them as separate instructions.

also, imho the absadd* instructions should be renamed to addabsdiff* since they add the absolute differences, not take the absolute value of addition.
Comment 5 Luke Kenneth Casson Leighton 2022-06-19 23:12:30 BST
(In reply to Jacob Lifshay from comment #4)
> I fixed minu[.] to actually be unsigned:
> https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;
> h=2f9891616d1a251bbb83b1ab29da7040258847ab

doh.
 
> i noticed absdu does signed comparison instead of unsigned, 

yes, that comes from VSX, although i must re-read the page,
despite there being a ">u" operator people do insist on using
the wrong one then saying "but read the english words", sigh.

> either that
> needs to be changed to unsigned (and probably renamed to absdiffu) or the
> name changed to absdiff (not absd since imho that would be interpreted as
> absolute value dword, not absolute difference).

need to keep mnemonics short.

> 
> i'm not sure which one you wanted, so i'll let you change it. imho we
> probably want both of them as separate instructions.

like it. absds. have to find space.  grev* needs to go, replace with grevlut.
really running out.

> also, imho the absadd* instructions should be renamed to addabsdiff* since
> they add the absolute differences, not take the absolute value of addition.

too long a mnemonic. abssadd absuadd. hmm
Comment 6 Jacob Lifshay 2022-06-19 23:20:44 BST
(In reply to Luke Kenneth Casson Leighton from comment #5)
> (In reply to Jacob Lifshay from comment #4)
> > I fixed minu[.] to actually be unsigned:
> > https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;
> > h=2f9891616d1a251bbb83b1ab29da7040258847ab
> 
> doh.
>  
> > i noticed absdu does signed comparison instead of unsigned, 
> 
> yes, that comes from VSX, although i must re-read the page,
> despite there being a ">u" operator people do insist on using
> the wrong one then saying "but read the english words", sigh.
> 
> > either that
> > needs to be changed to unsigned (and probably renamed to absdiffu) or the
> > name changed to absdiff (not absd since imho that would be interpreted as
> > absolute value dword, not absolute difference).
> 
> need to keep mnemonics short.

not confusing is more important than shortness...how about absdd -- abs diff dword -- specifically to avoid confusion with abs dword. or maybe asub -- abs(sub(ra, rb)) (with sub not overflowing).
> 
> > 
> > i'm not sure which one you wanted, so i'll let you change it. imho we
> > probably want both of them as separate instructions.
> 
> like it. absds. have to find space.  grev* needs to go, replace with grevlut.
> really running out.
> 
> > also, imho the absadd* instructions should be renamed to addabsdiff* since
> > they add the absolute differences, not take the absolute value of addition.
> 
> too long a mnemonic. abssadd absuadd. hmm

addasub[u][.] :) -- add(rt, abs(sub(ra, rb)))
Comment 7 Luke Kenneth Casson Leighton 2022-06-20 14:48:08 BST
(In reply to Jacob Lifshay from comment #6)

> not confusing is more important than shortness...how about absdd -- abs diff
> dword -- specifically to avoid confusion with abs dword. or maybe asub --
> abs(sub(ra, rb)) (with sub not overflowing).

yep. asub. short. nice.

> addasub[u][.] :) -- add(rt, abs(sub(ra, rb)))

# DRAFT Absolute Accumulate Unsigned Difference

absdac[us]

"abs" "d"ifference "ac"cumulate "u"nsigned.