openpower-isa.git
17 months agolog no longer raises internal exceptions and has more caching, so is likely faster
Jacob Lifshay [Thu, 1 Jun 2023 04:39:58 +0000 (21:39 -0700)]
log no longer raises internal exceptions and has more caching, so is likely faster

17 months agoformat code
Jacob Lifshay [Thu, 1 Jun 2023 04:12:30 +0000 (21:12 -0700)]
format code

17 months agoincrease ci maxfail to 10
Jacob Lifshay [Thu, 1 Jun 2023 02:57:55 +0000 (19:57 -0700)]
increase ci maxfail to 10

17 months agotest_pysvp64dis.py: add tests for broken extras
Dmitry Selyutin [Wed, 31 May 2023 18:20:28 +0000 (21:20 +0300)]
test_pysvp64dis.py: add tests for broken extras

17 months agofcvtfg works!
Jacob Lifshay [Wed, 31 May 2023 06:08:05 +0000 (23:08 -0700)]
fcvtfg works!

17 months agoadd rest of bfp* functions needed for fcvtfg
Jacob Lifshay [Wed, 31 May 2023 06:07:08 +0000 (23:07 -0700)]
add rest of bfp* functions needed for fcvtfg

17 months agouse raise_syntax_error for `IndentationError`s as well
Jacob Lifshay [Wed, 31 May 2023 05:08:02 +0000 (22:08 -0700)]
use raise_syntax_error for `IndentationError`s as well

17 months agoadd support for checking sprs and msr in unit tests
Jacob Lifshay [Tue, 30 May 2023 08:00:01 +0000 (01:00 -0700)]
add support for checking sprs and msr in unit tests

17 months agouse a different default MSR value for unit tests since 0 isn't a very useful default
Jacob Lifshay [Tue, 30 May 2023 07:50:42 +0000 (00:50 -0700)]
use a different default MSR value for unit tests since 0 isn't a very useful default

17 months agoinorder.py: Typo fixes.
Andrey Miroshnikov [Mon, 29 May 2023 09:51:14 +0000 (09:51 +0000)]
inorder.py: Typo fixes.

17 months agoinorder.py: Added draft get_input/output_regs functions.
Andrey Miroshnikov [Sun, 28 May 2023 20:40:58 +0000 (20:40 +0000)]
inorder.py: Added draft get_input/output_regs functions.

Passing trace (insn and Hazards()) to the fetch phase.
Decoder not yet using Hazard info.

17 months agopower_insn: fix broken extra_idx
Dmitry Selyutin [Sun, 14 May 2023 12:25:37 +0000 (12:25 +0000)]
power_insn: fix broken extra_idx

17 months agopower_enums: fix incorrect naming
Dmitry Selyutin [Sun, 14 May 2023 12:09:22 +0000 (12:09 +0000)]
power_enums: fix incorrect naming

17 months agoadd P2M type - 1P 2P 2PM needed for new LD/ST-Indexed format
Luke Kenneth Casson Leighton [Sat, 27 May 2023 11:56:31 +0000 (12:56 +0100)]
add P2M type - 1P 2P 2PM needed for new LD/ST-Indexed format

17 months agohttps://bugs.libre-soc.org/show_bug.cgi?id=1091
Luke Kenneth Casson Leighton [Sat, 27 May 2023 11:35:37 +0000 (12:35 +0100)]
https://bugs.libre-soc.org/show_bug.cgi?id=1091
* rename shadd to sadd
* rename sm to SH
* update CSV files with instruction definition
* move shadd unit tests to separate class

17 months agoadd .py? gitignore
Luke Kenneth Casson Leighton [Sat, 27 May 2023 11:33:36 +0000 (12:33 +0100)]
add .py? gitignore

17 months agorename sm to SH for shift-and-add instructions
Luke Kenneth Casson Leighton [Sat, 27 May 2023 10:54:57 +0000 (11:54 +0100)]
rename sm to SH for shift-and-add instructions
https://bugs.libre-soc.org/show_bug.cgi?id=1091
in fields.text machine-readable spec

17 months agonote on FP Exception about DDFF VLi=0/1
Luke Kenneth Casson Leighton [Wed, 24 May 2023 12:01:51 +0000 (13:01 +0100)]
note on FP Exception about DDFF VLi=0/1

17 months agotest fcvttgo. with traps enabled
Jacob Lifshay [Wed, 24 May 2023 03:10:58 +0000 (20:10 -0700)]
test fcvttgo. with traps enabled

17 months agoISACaller: generate FP trap
Jacob Lifshay [Wed, 24 May 2023 03:10:18 +0000 (20:10 -0700)]
ISACaller: generate FP trap

17 months agotest fcvttgo. with VE=1 too
Jacob Lifshay [Wed, 24 May 2023 02:34:15 +0000 (19:34 -0700)]
test fcvttgo. with VE=1 too

17 months agofcvttg[s][o][.] needs EXTRA_UNINIT_REGS: RT
Jacob Lifshay [Wed, 24 May 2023 02:33:01 +0000 (19:33 -0700)]
fcvttg[s][o][.] needs EXTRA_UNINIT_REGS: RT

17 months agoadd support for adding extra uninit_regs from html comment
Jacob Lifshay [Wed, 24 May 2023 02:24:34 +0000 (19:24 -0700)]
add support for adding extra uninit_regs from html comment

I chose an html comment since it's not part of the proposed pseudocode

like so:
* blah RT,RA
Pseudo-code:

<!-- EXTRA_UNINIT_REGS: RT -->
    if rand() then
        RT <- 42 + (RA)

17 months agoadd getopt for test and help to inorder.py
Luke Kenneth Casson Leighton [Mon, 22 May 2023 11:39:08 +0000 (12:39 +0100)]
add getopt for test and help to inorder.py

17 months agocomment read_file explaining usage contract
Luke Kenneth Casson Leighton [Mon, 22 May 2023 11:27:47 +0000 (12:27 +0100)]
comment read_file explaining usage contract
convert read_file to yield
explain unit tests

17 months agoyet another namespace hack now that @inject is on
Luke Kenneth Casson Leighton [Mon, 22 May 2023 11:11:11 +0000 (12:11 +0100)]
yet another namespace hack now that @inject is on
ISACallerFnHelper_double2single

17 months agomake style of consts.py consistent with standard python
Luke Kenneth Casson Leighton [Mon, 22 May 2023 11:09:31 +0000 (12:09 +0100)]
make style of consts.py consistent with standard python
practices (and those of this project) - remove underscores in front of
imports. the classes named _Const* however are *NOT* so altered because

17 months agomake style of pysvp64dis.py consistent with standard python
Luke Kenneth Casson Leighton [Mon, 22 May 2023 11:07:46 +0000 (12:07 +0100)]
make style of pysvp64dis.py consistent with standard python
practices (and those of this project) - remove underscores in front of
imports

17 months agomake style of power_fields.py consistent with standard python
Luke Kenneth Casson Leighton [Mon, 22 May 2023 11:04:39 +0000 (12:04 +0100)]
make style of power_fields.py consistent with standard python
practices (and those of this project) - remove underscores in front of
imports

17 months agoeurrrgh, hack in a namespace dict now that @inject() is
Luke Kenneth Casson Leighton [Sun, 21 May 2023 20:35:20 +0000 (21:35 +0100)]
eurrrgh, hack in a namespace dict now that @inject() is
done on ISACallerFnHelper_{pyfnwriterpage}

17 months agoadd /pi to LD/ST, temporarily. lose dz/sz replace with zz to compensate
Luke Kenneth Casson Leighton [Sun, 21 May 2023 20:06:39 +0000 (21:06 +0100)]
add /pi to LD/ST, temporarily. lose dz/sz replace with zz to compensate
this is related to bug #1047 and #1083

17 months agobig set of updates to LD/ST in line with new spec changes
Luke Kenneth Casson Leighton [Sun, 21 May 2023 14:23:19 +0000 (15:23 +0100)]
big set of updates to LD/ST in line with new spec changes
https://bugs.libre-soc.org/show_bug.cgi?id=1083
LD/ST-imm and LD/ST-idx are now pretty similar

17 months agohack-add @inject() into pyfnwriter, also take the
Luke Kenneth Casson Leighton [Sun, 21 May 2023 14:02:44 +0000 (15:02 +0100)]
hack-add @inject() into pyfnwriter, also take the
opportunity to stop doing "import ISACallerFnHelper as something"
by doing a hack-substitute on the class name

17 months agoexplicitly update FPSCR from list of return results
Luke Kenneth Casson Leighton [Sun, 21 May 2023 11:17:39 +0000 (12:17 +0100)]
explicitly update FPSCR from list of return results

17 months agowhitespace - bug in autopep8 which is dreadful
Luke Kenneth Casson Leighton [Sun, 21 May 2023 11:17:20 +0000 (12:17 +0100)]
whitespace - bug in autopep8 which is dreadful

17 months agocode-comment spelling
Luke Kenneth Casson Leighton [Sun, 21 May 2023 11:01:55 +0000 (12:01 +0100)]
code-comment spelling

17 months agoFPSCR should never have been added to "bypass" the incoming
Luke Kenneth Casson Leighton [Sun, 21 May 2023 11:01:45 +0000 (12:01 +0100)]
FPSCR should never have been added to "bypass" the incoming
local parameter or its return result

17 months agomust test fcvtfgs not fcvtfg for f32 test case
Jacob Lifshay [Sat, 20 May 2023 02:53:36 +0000 (19:53 -0700)]
must test fcvtfgs not fcvtfg for f32 test case

17 months agoformat code
Jacob Lifshay [Sat, 20 May 2023 02:52:43 +0000 (19:52 -0700)]
format code

17 months agoadd more bfp_* functions
Jacob Lifshay [Sat, 20 May 2023 02:51:39 +0000 (19:51 -0700)]
add more bfp_* functions

17 months agofix bfp compare
Jacob Lifshay [Sat, 20 May 2023 02:50:38 +0000 (19:50 -0700)]
fix bfp compare

17 months agofix typo
Jacob Lifshay [Sat, 20 May 2023 02:50:17 +0000 (19:50 -0700)]
fix typo

17 months agofix using python int instead of SelectableInt
Jacob Lifshay [Sat, 20 May 2023 02:49:12 +0000 (19:49 -0700)]
fix using python int instead of SelectableInt

17 months agofix fptrans unit tests' CR1 expected values since we calculate them from FPSCR now
Jacob Lifshay [Fri, 19 May 2023 06:51:21 +0000 (23:51 -0700)]
fix fptrans unit tests' CR1 expected values since we calculate them from FPSCR now

17 months agoadd WIP fcvtfg unit tests
Jacob Lifshay [Fri, 19 May 2023 06:40:45 +0000 (23:40 -0700)]
add WIP fcvtfg unit tests

17 months agoadd WIP bfp_* function
Jacob Lifshay [Fri, 19 May 2023 06:39:29 +0000 (23:39 -0700)]
add WIP bfp_* function

17 months agofix: bfp_ROUND_TO_BFP64 takes 3 arguments
Jacob Lifshay [Fri, 19 May 2023 06:36:15 +0000 (23:36 -0700)]
fix: bfp_ROUND_TO_BFP64 takes 3 arguments

17 months agoadd more bfp_* functions
Jacob Lifshay [Fri, 19 May 2023 06:35:50 +0000 (23:35 -0700)]
add more bfp_* functions

17 months agofix bfp_COMPARE_* when given denormal inputs
Jacob Lifshay [Fri, 19 May 2023 06:32:58 +0000 (23:32 -0700)]
fix bfp_COMPARE_* when given denormal inputs

17 months agocompute CR1 for non-compare fp Rc=1 instructions
Jacob Lifshay [Fri, 19 May 2023 06:28:06 +0000 (23:28 -0700)]
compute CR1 for non-compare fp Rc=1 instructions

17 months agosupport binary literals with embedded _ (e.g. 0b10_01)
Jacob Lifshay [Fri, 19 May 2023 06:26:51 +0000 (23:26 -0700)]
support binary literals with embedded _ (e.g. 0b10_01)

17 months agofix fcvttg FPSCR.FR computation
Jacob Lifshay [Fri, 19 May 2023 03:53:23 +0000 (20:53 -0700)]
fix fcvttg FPSCR.FR computation

the unit test previously assumed the rounding mode is truncate,
but when I switched it to allow dynamic rounding modes,
I forgot to no longer hard-code FPSCR.FR = 0

17 months agoonly retrieve stack frames we need -- ~2x speed up of test_caller_fmv_fcvt
Jacob Lifshay [Fri, 19 May 2023 01:46:57 +0000 (18:46 -0700)]
only retrieve stack frames we need -- ~2x speed up of test_caller_fmv_fcvt

17 months agoparallelize fmv/fcvt unit tests
Jacob Lifshay [Fri, 19 May 2023 01:01:08 +0000 (18:01 -0700)]
parallelize fmv/fcvt unit tests

17 months agotest fcvttgo. instead of fcvttg
Jacob Lifshay [Thu, 18 May 2023 04:26:23 +0000 (21:26 -0700)]
test fcvttgo. instead of fcvttg

17 months agofix CR0 output for fmvtg*/fcvttg*
Jacob Lifshay [Thu, 18 May 2023 04:25:16 +0000 (21:25 -0700)]
fix CR0 output for fmvtg*/fcvttg*

17 months agoadd fmv*/fcvt* to sv_analysis.py
Jacob Lifshay [Thu, 18 May 2023 04:24:35 +0000 (21:24 -0700)]
add fmv*/fcvt* to sv_analysis.py

17 months agosmall whitespace cleanup
Luke Kenneth Casson Leighton [Wed, 17 May 2023 16:00:02 +0000 (17:00 +0100)]
small whitespace cleanup

17 months agoupdate the tables in power_svp64_rm.py
Luke Kenneth Casson Leighton [Wed, 17 May 2023 15:56:55 +0000 (16:56 +0100)]
update the tables in power_svp64_rm.py
these get copied around a lot but hey this is better than mistakes

17 months agosorted SVP64RMModeDecode to properly match the new spec
Luke Kenneth Casson Leighton [Wed, 17 May 2023 15:41:21 +0000 (16:41 +0100)]
sorted SVP64RMModeDecode to properly match the new spec

17 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

17 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

17 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

17 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__

17 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

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

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

17 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

17 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

17 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

17 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

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

17 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

17 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

17 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

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

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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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)

17 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

17 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

17 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)

17 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

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

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

17 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

17 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)

17 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

17 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

17 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

17 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