Bug 1051 - OPF RFC ls012 research: create table of instructions and their priorities
Summary: OPF RFC ls012 research: create table of instructions and their priorities
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Specification (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL: https://libre-soc.org/openpower/sv/rf...
Depends on:
Blocks: 1052
  Show dependency treegraph
 
Reported: 2023-04-07 10:50 BST by Luke Kenneth Casson Leighton
Modified: 2023-10-29 17:24 GMT (History)
2 users (show)

See Also:
NLnet milestone: NLnet.2022-08-051.OPF
total budget (EUR) for completion of task and all subtasks: 3500
budget (EUR) for this task, excluding subtasks' budget: 3500
parent task for budget allocation: 1011
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:
[jacob] amount = 1200 submitted = 2023-06-28 paid = 2023-07-12 [red] amount = 1000 submitted = 2023-06-24 paid = 2023-06-28 [lkcl] amount = 1300 submitted = 2023-06-22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2023-04-07 10:50:36 BST
we need a list of the full suite of Scalar instructions to be
proposed to the OPF ISA WG, along with a list of priorities.
this milestone covers the initial research work, including
generating a CSV-to-markdown-table generator program that
can create different priority listings: by RFC, by EXT2xx,
by EXT0xx, etc.
Comment 1 Luke Kenneth Casson Leighton 2023-04-07 11:12:17 BST
made a start on a CSV file
https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=2c5bdcca43b4a91c6fcaf294da7475465cfabef3

columns (so far):

instruction, rfc, priority, vectorisable, prefixable, primary, page
Comment 2 Luke Kenneth Casson Leighton 2023-04-07 14:55:28 BST
https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=2af32465bfd9db84980891ebeb71ac0275d58a4c

added transcendentals, made a start on the priorities, based on the
page https://libre-soc.org/openpower/transcendentals/
Comment 3 Jacob Lifshay 2023-04-07 20:08:48 BST
please add a comment to the csv defining if 100 priority is really high priority must be done first, or really low priority done last.
Comment 4 Jacob Lifshay 2023-04-07 20:10:11 BST
(In reply to Jacob Lifshay from comment #3)
> please add a comment to the csv defining if 100 priority is really high
> priority must be done first, or really low priority done last.

nm, misread the columns. high/med/low is used for priority.
Comment 5 Jacob Lifshay 2023-04-07 20:17:57 BST
please do define "prefixable", does that mean it can go in ext2xx or does that mean it can have a svp64 prefix or something else?
Comment 6 Luke Kenneth Casson Leighton 2023-04-07 20:32:45 BST
(In reply to Jacob Lifshay from comment #5)
> please do define "prefixable", does that mean it can go in ext2xx or does
> that mean it can have a svp64 prefix or something else?

i've been meaning to put some definitions in, "prefixable" refers to PO1
and i've changed the heading column to reflect that.

related: https://libre-soc.org/openpower/sv/po9_encoding/
Comment 7 Jacob Lifshay 2023-04-11 07:19:10 BST
turns out the fpow instruction isn't super high priority for 3D, the following is sufficient:
pow(b, x) = exp2(x * log2(b))

I also did some misc cleanups and implemented recursive [[!inline]] support (which it turns out we need since ls010 uses svp64/appendix which in turn uses preduce.py)

https://git.libre-soc.org/?p=libreriscv.git;a=shortlog;h=789d7892bb20f292c31394b7997e5dd9124a06c6

commit 789d7892bb20f292c31394b7997e5dd9124a06c6
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 23:09:02 2023 -0700

    adjust priorities -- all inverse trig functions can be expressed in terms of atan2[pi]

commit d5f837fe00e4f3c9efaeca49fdbb29a0c11fe0df
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 23:07:08 2023 -0700

    add notes on pow's use in 3D graphics

commit 9b6f2fbcd321a48d31d89942c64c9f6ff9c4e9c3
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 23:06:17 2023 -0700

    assign fmod/fremainder to ZftransExt -- seems good enough to me

commit a67c976f69b56b46bd0ff9849f9a691b31e4f4bf
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 23:04:47 2023 -0700

    add fmin/max and mark as high priority

commit c17c44a5f18d573d7cd2f988c6fcb16a3f7df9af
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 23:02:22 2023 -0700

    mark integer min/max as high priority since vector reduce min/max is common.

commit 260dff6846d231f8249b85fb933d59cee5f1bd71
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 22:11:42 2023 -0700

    clean up makefile and support recursive [[!inline]]

commit 930a3f161b826374ceae5a0683fe799e33044995
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 22:11:30 2023 -0700

    spelling fix

commit 1e465da52acc21f3c30994aa1d4eaa878c645a3a
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 22:10:04 2023 -0700

    add .gitignore for new intermediate files

commit b51d4b382d733df660ddc875085546c5f0b876c9
Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Mon Apr 10 21:20:06 2023 -0700

    fix spelling and formatting
Comment 8 Luke Kenneth Casson Leighton 2023-04-11 10:17:12 BST
(In reply to Jacob Lifshay from comment #7)
> turns out the fpow instruction isn't super high priority for 3D, the
> following is sufficient:
> pow(b, x) = exp2(x * log2(b))

... and bit-level accuracy isn't absolute (or is it? what's the
Khronos Group ULP for fpow?)
 
> I also did some misc cleanups and implemented recursive [[!inline]] support
> (which it turns out we need since ls010 uses svp64/appendix which in turn
> uses preduce.py)

briilliant
Comment 9 Jacob Lifshay 2023-04-11 10:22:58 BST
(In reply to Luke Kenneth Casson Leighton from comment #8)
> (In reply to Jacob Lifshay from comment #7)
> > turns out the fpow instruction isn't super high priority for 3D, the
> > following is sufficient:
> > pow(b, x) = exp2(x * log2(b))
> 
> ... and bit-level accuracy isn't absolute (or is it? what's the
> Khronos Group ULP for fpow?)

the spec literally says: the accuracy is "Inherited from exp2(y × log2(x))"
Comment 10 Jacob Lifshay 2023-04-21 02:40:49 BST
https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=0be9acb5598025ce680f2f2cd2b7c37be3f9e495

Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Thu Apr 20 18:37:09 2023 -0700

    fix int/fp mv/cvt in optable.csv


https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=8ed4acf7c47737f5536486930c7ddf4831d8c9d8

Author: Jacob Lifshay <programmerjake@gmail.com>
Date:   Thu Apr 20 18:26:31 2023 -0700

    adjust optable.csv -- [f]minmax[s][.] need 6 XO bits and merge all the fminmax variants
Comment 11 Luke Kenneth Casson Leighton 2023-06-22 17:57:39 BST
initial version completed