openpower-isa.git
13 months agotest all fp -> int conversion modes
Jacob Lifshay [Wed, 17 May 2023 04:54:38 +0000 (21:54 -0700)]
test all fp -> int conversion modes

13 months agofix bug in fcvttg OpenPower and saturating conversion
Jacob Lifshay [Wed, 17 May 2023 04:52:52 +0000 (21:52 -0700)]
fix bug in fcvttg OpenPower and saturating conversion

13 months agoadd support for setting initial FPSCR in unit tests
Jacob Lifshay [Wed, 17 May 2023 04:51:39 +0000 (21:51 -0700)]
add support for setting initial FPSCR in unit tests

13 months agoadd fp value to BFPState.__repr__
Jacob Lifshay [Wed, 17 May 2023 04:50:47 +0000 (21:50 -0700)]
add fp value to BFPState.__repr__

13 months agoadd more fp -> int bfp* functions
Jacob Lifshay [Wed, 17 May 2023 04:50:07 +0000 (21:50 -0700)]
add more fp -> int bfp* functions

13 months agofix fp comparison
Jacob Lifshay [Wed, 17 May 2023 04:48:57 +0000 (21:48 -0700)]
fix fp comparison

13 months agofix round nearest-even
Jacob Lifshay [Wed, 17 May 2023 04:48:04 +0000 (21:48 -0700)]
fix round nearest-even

13 months agorename js_toint -> toint in preparation for adding non-js fp->int tests
Jacob Lifshay [Wed, 17 May 2023 02:50:13 +0000 (19:50 -0700)]
rename js_toint -> toint in preparation for adding non-js fp->int tests

13 months agoexpand fcvttg js tests to also test conversion to u32/i64/u64
Jacob Lifshay [Wed, 17 May 2023 02:11:24 +0000 (19:11 -0700)]
expand fcvttg js tests to also test conversion to u32/i64/u64

13 months agoadd bfp_CONVERT_FROM_UI32/64
Jacob Lifshay [Wed, 17 May 2023 02:10:03 +0000 (19:10 -0700)]
add bfp_CONVERT_FROM_UI32/64

13 months agorename js_toint32 -> js_toint in preparation for adding u32/i64/u64 tests
Jacob Lifshay [Wed, 17 May 2023 02:07:42 +0000 (19:07 -0700)]
rename js_toint32 -> js_toint in preparation for adding u32/i64/u64 tests

13 months agorephrase to avoid personal pronouns
Jacob Lifshay [Wed, 17 May 2023 00:28:02 +0000 (17:28 -0700)]
rephrase to avoid personal pronouns

13 months agoduplicate overflow comment as requested by luke
Jacob Lifshay [Wed, 17 May 2023 00:16:38 +0000 (17:16 -0700)]
duplicate overflow comment as requested by luke

https://libre-soc.org/irclog/%23libre-soc.2023-05-16.log.html#t2023-05-16T08:54:24

13 months agomention it is ok to duplicate code in inorder.py
Luke Kenneth Casson Leighton [Tue, 16 May 2023 15:58:22 +0000 (16:58 +0100)]
mention it is ok to duplicate code in inorder.py

13 months agoadd some copyright notices and development guidelines to inorder.py
Luke Kenneth Casson Leighton [Tue, 16 May 2023 15:56:42 +0000 (16:56 +0100)]
add some copyright notices and development guidelines to inorder.py

13 months agofcvttg*: test FPSCR output
Jacob Lifshay [Tue, 16 May 2023 06:53:40 +0000 (23:53 -0700)]
fcvttg*: test FPSCR output

13 months agofix fcvttg* overflow/FPSCR computation
Jacob Lifshay [Tue, 16 May 2023 06:50:52 +0000 (23:50 -0700)]
fix fcvttg* overflow/FPSCR computation

13 months agofix mis-computed exponent in bfp_CONVERT_FROM_BFP64
Jacob Lifshay [Tue, 16 May 2023 06:48:28 +0000 (23:48 -0700)]
fix mis-computed exponent in bfp_CONVERT_FROM_BFP64

13 months agomake mis-matched FPSCR errors much easier to read
Jacob Lifshay [Tue, 16 May 2023 06:47:03 +0000 (23:47 -0700)]
make mis-matched FPSCR errors much easier to read

13 months agofpscr: rename computed bits -> summary bits since that's what the spec uses
Jacob Lifshay [Tue, 16 May 2023 06:44:22 +0000 (23:44 -0700)]
fpscr: rename computed bits -> summary bits since that's what the spec uses

13 months agoauto-compute FPSCR exception summary bits
Jacob Lifshay [Tue, 16 May 2023 04:34:20 +0000 (21:34 -0700)]
auto-compute FPSCR exception summary bits

13 months agoreplace self.insnlog.append with self.trace function
Luke Kenneth Casson Leighton [Tue, 16 May 2023 01:31:43 +0000 (02:31 +0100)]
replace self.insnlog.append with self.trace function
that is explicitly inactive if the (new) insnlog input is None
https://bugs.libre-soc.org/show_bug.cgi?id=1039

13 months agowhoops no self.record, must be record argument
Luke Kenneth Casson Leighton [Tue, 16 May 2023 01:30:40 +0000 (02:30 +0100)]
whoops no self.record, must be record argument

13 months agoadd hazard profiles, add read_file function for tracelog
Luke Kenneth Casson Leighton [Tue, 16 May 2023 01:03:30 +0000 (02:03 +0100)]
add hazard profiles, add read_file function for tracelog

13 months agoskip reading ewsrc when SVMode is CROP
Luke Kenneth Casson Leighton [Mon, 15 May 2023 22:36:45 +0000 (23:36 +0100)]
skip reading ewsrc when SVMode is CROP

13 months agoadd "WRONG" sv.cmp in test_pysvp64dis.py
Luke Kenneth Casson Leighton [Mon, 15 May 2023 20:47:18 +0000 (21:47 +0100)]
add "WRONG" sv.cmp in test_pysvp64dis.py

13 months agofix sv_analysis ldux, missing s/d:RA
Luke Kenneth Casson Leighton [Mon, 15 May 2023 20:46:18 +0000 (21:46 +0100)]
fix sv_analysis ldux, missing s/d:RA

13 months agosort out sv.cmp zz (and correct unit tests)
Luke Kenneth Casson Leighton [Mon, 15 May 2023 20:43:41 +0000 (21:43 +0100)]
sort out sv.cmp zz (and correct unit tests)

13 months agoCROpFF3RM and CROpFF5RM were swapped round.
Luke Kenneth Casson Leighton [Mon, 15 May 2023 20:06:56 +0000 (21:06 +0100)]
CROpFF3RM and CROpFF5RM were swapped round.
FF3 has the CR-bit
(and only zz - bit 6)
FF5 has only the inv-bit

13 months agofound the location to cut/paste the disassembly extra from
Luke Kenneth Casson Leighton [Mon, 15 May 2023 19:47:02 +0000 (20:47 +0100)]
found the location to cut/paste the disassembly extra from
https://bugs.libre-soc.org/show_bug.cgi?id=1084

13 months agoRC1 does not exist in CROps, the selection of behaviour *called* RC1
Luke Kenneth Casson Leighton [Mon, 15 May 2023 19:38:34 +0000 (20:38 +0100)]
RC1 does not exist in CROps, the selection of behaviour *called* RC1
is whether the CROp destination is a 3-bit CR *field* (RC1=0)
or if it is a 5-bit CR *bit* (RC1=1)

13 months agofix empty slot in EXTRA
Luke Kenneth Casson Leighton [Mon, 15 May 2023 19:16:15 +0000 (20:16 +0100)]
fix empty slot in EXTRA
move (swap) Mode[0] and Mode[1] in CROps,
ff y/n is now Mode[1], VLI is now Mode[0].
https://bugs.libre-soc.org/show_bug.cgi?id=1083

13 months agoextraneous space
Luke Kenneth Casson Leighton [Mon, 15 May 2023 19:01:38 +0000 (20:01 +0100)]
extraneous space

13 months agoremove extraneous space
Luke Kenneth Casson Leighton [Mon, 15 May 2023 18:58:13 +0000 (19:58 +0100)]
remove extraneous space

13 months agosome empty slots now in RM and also source=dest in EXTRA
Luke Kenneth Casson Leighton [Mon, 15 May 2023 15:38:01 +0000 (16:38 +0100)]
some empty slots now in RM and also source=dest in EXTRA

13 months agold/st mismatch in power_insn.py and sv_analysis.py
Luke Kenneth Casson Leighton [Mon, 15 May 2023 15:37:26 +0000 (16:37 +0100)]
ld/st mismatch in power_insn.py and sv_analysis.py
some EXTRA slots run empty now due to source/dest being the same
register (s:RA;d:RA)

13 months agoadd sv.ffmadds test to test_pysvp64dis.py
Luke Kenneth Casson Leighton [Mon, 15 May 2023 15:12:42 +0000 (16:12 +0100)]
add sv.ffmadds test to test_pysvp64dis.py

13 months agoin DCT/FFT 3-in 2-out set had to make RT same source-dest EXTRA
Luke Kenneth Casson Leighton [Mon, 15 May 2023 15:07:04 +0000 (16:07 +0100)]
in DCT/FFT 3-in 2-out set had to make RT same source-dest EXTRA
puzzlingly this frees up 2 bits but still cannot do EXTRA3 due to needing
1 bit for selecting RS=RT+MAXVL or RS=RC

13 months agomove RG bit in CRops to Mode[2] from Mode[3] MSB0-numbering
Luke Kenneth Casson Leighton [Mon, 15 May 2023 12:44:09 +0000 (13:44 +0100)]
move RG bit in CRops to Mode[2] from Mode[3] MSB0-numbering

13 months agogot linked-list-pointer-chasing working
Luke Kenneth Casson Leighton [Mon, 15 May 2023 11:55:20 +0000 (12:55 +0100)]
got linked-list-pointer-chasing working
including with LD/ST-with-update
https://bugs.libre-soc.org/show_bug.cgi?id=1047

13 months agobug in power_insn.py where record.svp64 is None (??)
Luke Kenneth Casson Leighton [Mon, 15 May 2023 11:46:29 +0000 (12:46 +0100)]
bug in power_insn.py where record.svp64 is None (??)

13 months agohave to now add LD/ST-update instructions to list of explicit-allowed
Luke Kenneth Casson Leighton [Mon, 15 May 2023 10:30:18 +0000 (11:30 +0100)]
have to now add LD/ST-update instructions to list of explicit-allowed
(as .long) due to extension of RA/RT with EXTRAs, the test RA!=RT is not
a 5-bit test it is a 7-bit test

13 months agoprevent duplicate EXTRA2/3 in power_insndb when assembling/disassembling
Luke Kenneth Casson Leighton [Mon, 15 May 2023 10:15:48 +0000 (11:15 +0100)]
prevent duplicate EXTRA2/3 in power_insndb when assembling/disassembling
https://bugs.libre-soc.org/show_bug.cgi?id=1084

13 months agopower_insn: filter out empty pcode lines
Dmitry Selyutin [Sun, 14 May 2023 20:25:34 +0000 (20:25 +0000)]
power_insn: filter out empty pcode lines

13 months agopower_insn: fix verbose assembly extra info
Dmitry Selyutin [Sun, 14 May 2023 20:15:09 +0000 (20:15 +0000)]
power_insn: fix verbose assembly extra info

13 months agoattempting to get LD/ST-Update SVP64 EXTRA3 working, getting some
Luke Kenneth Casson Leighton [Sun, 14 May 2023 16:34:10 +0000 (17:34 +0100)]
attempting to get LD/ST-Update SVP64 EXTRA3 working, getting some
interesting behaviour in pysvp64dis
https://bugs.libre-soc.org/show_bug.cgi?id=1084

13 months agoclassify LD/ST-Immediate-Update as EXTRA3.
Luke Kenneth Casson Leighton [Sun, 14 May 2023 15:44:24 +0000 (16:44 +0100)]
classify LD/ST-Immediate-Update as EXTRA3.
this allows continuous range on registers up to 128

13 months agowhitespace cleanup and remove as many PHP-style-formatters as i can stand
Luke Kenneth Casson Leighton [Sun, 14 May 2023 15:35:41 +0000 (16:35 +0100)]
whitespace cleanup and remove as many PHP-style-formatters as i can stand

13 months agoadd rest of bfp_* helpers needed to run fcvt js test
Jacob Lifshay [Sat, 13 May 2023 01:06:47 +0000 (18:06 -0700)]
add rest of bfp_* helpers needed to run fcvt js test

13 months agofix `even` polarity in bfp_ROUND_TO_INTEGER
Jacob Lifshay [Sat, 13 May 2023 01:05:24 +0000 (18:05 -0700)]
fix `even` polarity in bfp_ROUND_TO_INTEGER

13 months agoignore FPSCR in fcvt js test
Jacob Lifshay [Sat, 13 May 2023 01:04:39 +0000 (18:04 -0700)]
ignore FPSCR in fcvt js test

13 months agoallow ignoring FPSCR in tests
Jacob Lifshay [Sat, 13 May 2023 01:03:58 +0000 (18:03 -0700)]
allow ignoring FPSCR in tests

13 months agopow should not become self.pow
Jacob Lifshay [Sat, 13 May 2023 01:02:56 +0000 (18:02 -0700)]
pow should not become self.pow

13 months agofix bugs in fcvt* pseudocode
Jacob Lifshay [Sat, 13 May 2023 00:59:40 +0000 (17:59 -0700)]
fix bugs in fcvt* pseudocode

13 months agocheck expected CR fields in Data-Dependent Fail-First
Luke Kenneth Casson Leighton [Fri, 12 May 2023 20:01:52 +0000 (21:01 +0100)]
check expected CR fields in Data-Dependent Fail-First

13 months agoadd some bfp_* functions -- this isn't yet enough to run fcvt*
Jacob Lifshay [Fri, 12 May 2023 06:48:06 +0000 (23:48 -0700)]
add some bfp_* functions -- this isn't yet enough to run fcvt*

13 months agomake truediv available to pseudocode
Jacob Lifshay [Fri, 12 May 2023 06:44:51 +0000 (23:44 -0700)]
make truediv available to pseudocode

technically `/` in pseudocode is supposed to be real number division,
with `รท` being division with result truncated to integer, however
luke decided to just use `/` for integer division in pseudocode,
so we need a way to work around that.

13 months agoadd bfp classification predicates
Jacob Lifshay [Fri, 12 May 2023 06:43:41 +0000 (23:43 -0700)]
add bfp classification predicates

13 months agoallow assigning BFPState and SelectableMSB0Fraction values in pseudo-code
Jacob Lifshay [Fri, 12 May 2023 06:38:09 +0000 (23:38 -0700)]
allow assigning BFPState and SelectableMSB0Fraction values in pseudo-code

13 months agoadd support for *_flag global variables needed by bfp_* functions
Jacob Lifshay [Fri, 12 May 2023 06:35:41 +0000 (23:35 -0700)]
add support for *_flag global variables needed by bfp_* functions

13 months agomake lexer replace class with class_ since it's a python keyword
Jacob Lifshay [Fri, 12 May 2023 06:32:16 +0000 (23:32 -0700)]
make lexer replace class with class_ since it's a python keyword

13 months agofix SelectableMSB0Fraction's constructor
Jacob Lifshay [Fri, 12 May 2023 06:31:02 +0000 (23:31 -0700)]
fix SelectableMSB0Fraction's constructor

13 months agoundefined is a function that needs to be called
Jacob Lifshay [Fri, 12 May 2023 06:30:12 +0000 (23:30 -0700)]
undefined is a function that needs to be called

13 months agofix broken FPSCR fields
Jacob Lifshay [Fri, 12 May 2023 05:49:34 +0000 (22:49 -0700)]
fix broken FPSCR fields

13 months agoRevert "add stub reset_xflags function"
Jacob Lifshay [Fri, 12 May 2023 01:53:59 +0000 (18:53 -0700)]
Revert "add stub reset_xflags function"

the function actually should be in pseudocode

This reverts commit c44cd164b385a18fb635e7087c2a253c30d9c81c.

13 months agocorrections to dd-ffirst tests when VLi=0, the write to regfile
Luke Kenneth Casson Leighton [Thu, 11 May 2023 20:02:37 +0000 (21:02 +0100)]
corrections to dd-ffirst tests when VLi=0, the write to regfile
is *not* carried out on the failed test. but Rc=1 does (TODO)

13 months agoSelectableMSB0Fraction is now basically complete and correct afaict
Jacob Lifshay [Thu, 11 May 2023 08:05:04 +0000 (01:05 -0700)]
SelectableMSB0Fraction is now basically complete and correct afaict

13 months agoadd very very very basic write-out of instruction log
Luke Kenneth Casson Leighton [Wed, 10 May 2023 22:10:16 +0000 (23:10 +0100)]
add very very very basic write-out of instruction log

13 months agoMerge branch 'support-fields'
Jacob Lifshay [Wed, 10 May 2023 19:54:28 +0000 (12:54 -0700)]
Merge branch 'support-fields'

https://bugs.libre-soc.org/show_bug.cgi?id=1072#c17

13 months agoadd ld/st data-dependent fail-first /vli (inclusive)
Luke Kenneth Casson Leighton [Wed, 10 May 2023 18:30:51 +0000 (19:30 +0100)]
add ld/st data-dependent fail-first /vli (inclusive)

13 months agofix data-dependent fail-first on load
Luke Kenneth Casson Leighton [Wed, 10 May 2023 18:28:27 +0000 (19:28 +0100)]
fix data-dependent fail-first on load

13 months agopower_insn: remove redundant logs
Dmitry Selyutin [Wed, 10 May 2023 17:17:58 +0000 (17:17 +0000)]
power_insn: remove redundant logs

13 months agocyclemodel/inorder: hide set inheritance
Dmitry Selyutin [Wed, 10 May 2023 11:54:23 +0000 (04:54 -0700)]
cyclemodel/inorder: hide set inheritance

13 months agocyclemodel/inorder: fix coding style
Dmitry Selyutin [Wed, 10 May 2023 11:52:49 +0000 (04:52 -0700)]
cyclemodel/inorder: fix coding style

13 months agoextend previous hard-coded magic constant (256) used to indicate
Luke Kenneth Casson Leighton [Wed, 10 May 2023 11:33:26 +0000 (12:33 +0100)]
extend previous hard-coded magic constant (256) used to indicate
"effectively unlimited" (see check_extsign) out to 1024. it would be
better to set this at the bare-minimum limit (257, 258) as it requests
that python runtime create massive-large ints

13 months agoadd WIP fp_working_format.py
Jacob Lifshay [Wed, 10 May 2023 08:21:00 +0000 (01:21 -0700)]
add WIP fp_working_format.py

13 months agochange FPSCR to a required parameter of ISACallerHelper support-fields
Jacob Lifshay [Wed, 10 May 2023 05:17:49 +0000 (22:17 -0700)]
change FPSCR to a required parameter of ISACallerHelper

13 months agoRevert "remove now-unnecessary SO global, since XER[SO] syntax now translates to...
Jacob Lifshay [Wed, 10 May 2023 04:58:02 +0000 (21:58 -0700)]
Revert "remove now-unnecessary SO global, since XER[SO] syntax now translates to XER.SO"

luke wants the SO global to stay even though it's unnecessary

This reverts commit a50eb1eb70ee305ba3091455cf1473abd4a74fb2.

13 months agoswitch to using self.FPSCR
Jacob Lifshay [Wed, 10 May 2023 02:30:03 +0000 (19:30 -0700)]
switch to using self.FPSCR

13 months agoswitch to using FPSCRState for double2single.mdwn
Jacob Lifshay [Wed, 10 May 2023 02:27:41 +0000 (19:27 -0700)]
switch to using FPSCRState for double2single.mdwn

13 months agoadd self.FPSCR
Jacob Lifshay [Wed, 10 May 2023 02:16:37 +0000 (19:16 -0700)]
add self.FPSCR

13 months agoremove now-unnecessary SO global, since XER[SO] syntax now translates to XER.SO
Jacob Lifshay [Wed, 10 May 2023 02:12:01 +0000 (19:12 -0700)]
remove now-unnecessary SO global, since XER[SO] syntax now translates to XER.SO

13 months agosupport FPSCR[RN] syntax that translates to FPSCR.RN
Jacob Lifshay [Wed, 10 May 2023 01:54:26 +0000 (18:54 -0700)]
support FPSCR[RN] syntax that translates to FPSCR.RN

13 months agoadd support for accessing XER using XER.SO syntax -- intended for new pseudocode
Jacob Lifshay [Wed, 10 May 2023 01:48:47 +0000 (18:48 -0700)]
add support for accessing XER using XER.SO syntax -- intended for new pseudocode

13 months agoseparate ISAPages out from inherited ISA Class
Luke Kenneth Casson Leighton [Tue, 9 May 2023 17:26:49 +0000 (18:26 +0100)]
separate ISAPages out from inherited ISA Class

13 months agoSetFX is not a normal function -- it can assign to its input
Jacob Lifshay [Tue, 9 May 2023 07:27:19 +0000 (00:27 -0700)]
SetFX is not a normal function -- it can assign to its input

13 months agoswitch fpcvt over to using FPSCR attributes
Jacob Lifshay [Tue, 9 May 2023 07:25:23 +0000 (00:25 -0700)]
switch fpcvt over to using FPSCR attributes

13 months agoadd parser support for attributes like FPSCR.RN
Jacob Lifshay [Tue, 9 May 2023 07:22:57 +0000 (00:22 -0700)]
add parser support for attributes like FPSCR.RN

13 months agomove apply_trailer into parser class
Jacob Lifshay [Tue, 9 May 2023 07:13:08 +0000 (00:13 -0700)]
move apply_trailer into parser class

13 months agobypass ply's eating SyntaxErrors
Jacob Lifshay [Tue, 9 May 2023 07:10:27 +0000 (00:10 -0700)]
bypass ply's eating SyntaxErrors

13 months agoFPSCR.FPRF can be assigned strings
Jacob Lifshay [Tue, 9 May 2023 07:06:30 +0000 (00:06 -0700)]
FPSCR.FPRF can be assigned strings

13 months agoadd XERState since XER has fields too
Jacob Lifshay [Tue, 9 May 2023 07:05:30 +0000 (00:05 -0700)]
add XERState since XER has fields too

13 months agofix some broken FieldSelectableInt handling
Jacob Lifshay [Tue, 9 May 2023 06:10:29 +0000 (23:10 -0700)]
fix some broken FieldSelectableInt handling

13 months agocomment TODO on Load-Fault in strncpy example
Luke Kenneth Casson Leighton [Sun, 7 May 2023 09:44:36 +0000 (10:44 +0100)]
comment TODO on Load-Fault in strncpy example

13 months agoadd stub reset_xflags function
Luke Kenneth Casson Leighton [Sun, 7 May 2023 09:12:41 +0000 (10:12 +0100)]
add stub reset_xflags function

13 months agominor_19.csv: convert RA to RA0 for minmax
Dmitry Selyutin [Sun, 7 May 2023 08:13:46 +0000 (11:13 +0300)]
minor_19.csv: convert RA to RA0 for minmax

13 months agoadd FPSCR to Test API (ExpectedState, SimState). untested
Luke Kenneth Casson Leighton [Sat, 6 May 2023 13:31:13 +0000 (14:31 +0100)]
add FPSCR to Test API (ExpectedState, SimState). untested

13 months agoadd FPSCR to ISACaller
Luke Kenneth Casson Leighton [Sat, 6 May 2023 13:26:39 +0000 (14:26 +0100)]
add FPSCR to ISACaller

13 months agonotes: make FPSCR definition more like MSR (see openpower/consts.py)
Luke Kenneth Casson Leighton [Sat, 6 May 2023 13:22:44 +0000 (14:22 +0100)]
notes: make FPSCR definition more like MSR (see openpower/consts.py)

13 months agodrastically simplify fpscr.py. extreme overcomplexity introducing
Luke Kenneth Casson Leighton [Sat, 6 May 2023 13:21:04 +0000 (14:21 +0100)]
drastically simplify fpscr.py. extreme overcomplexity introducing
an entirely new paradigm - without discussion - creates a maintenance
headache we cannot afford