SDL-Hercules-390 / hyperion

The SDL Hercules 4.x Hyperion version of the System/370, ESA/390, and z/Architecture Emulator
Other
240 stars 90 forks source link

add timed statistics to instruction counting #588

Closed 76bav closed 1 year ago

76bav commented 1 year ago

Add timed statistics to instruction counting

sample output:

00:27:00 HHC02292I Inst '47'   count    215794590 (15%) time      4665559 (0.021620)
00:27:00 HHC02292I Inst '58'   count    164770795 (12%) time      3808130 (0.023112)
00:27:00 HHC02292I Inst '91'   count    107608676 ( 7%) time      2167367 (0.020141)
00:27:00 HHC02292I Inst 'A704' count    100009950 ( 7%) time      2807802 (0.028075)
00:27:00 HHC02292I Inst '41'   count     66744429 ( 4%) time      1480319 (0.022179)
00:27:00 HHC02292I Inst '50'   count     66068882 ( 4%) time      1643570 (0.024877)
00:27:00 HHC02292I Inst '18'   count     49057127 ( 3%) time      1091045 (0.022240)
00:27:00 HHC02292I Inst 'D2'   count     32589787 ( 2%) time       876037 (0.026881)
00:27:00 HHC02292I Inst '1F'   count     28897666 ( 2%) time       586237 (0.020287)
00:27:00 HHC02292I Inst '07'   count     28708214 ( 2%) time       833780 (0.029043)
00:27:00 HHC02292I Inst '95'   count     28216550 ( 2%) time       592255 (0.020990)
00:27:00 HHC02292I Inst 'BF'   count     22686289 ( 1%) time       524232 (0.023108)
00:27:00 HHC02292I Inst '98'   count     20248859 ( 1%) time       551115 (0.027217)
00:27:00 HHC02292I Inst '43'   count     19863982 ( 1%) time       389031 (0.019585)
00:27:00 HHC02292I Inst '55'   count     19733596 ( 1%) time       434151 (0.022001)
00:27:00 HHC02292I Inst '45'   count     19700337 ( 1%) time       570025 (0.028935)
00:27:00 HHC02292I Inst 'D5'   count     19028215 ( 1%) time       376478 (0.019785)
00:27:00 HHC02292I Inst '90'   count     18097914 ( 1%) time       408490 (0.022571)
00:27:00 HHC02292I Inst '12'   count     16809393 ( 1%) time       347684 (0.020684)
00:27:00 HHC02292I Inst '59'   count     15475891 ( 1%) time       317297 (0.020503)
...
00:27:00 HHC02292I Inst 'B241' count           12 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'ED24' count           12 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'E30D' count           12 ( 0%) time            1 (0.083333)
00:27:00 HHC02292I Inst '29'   count            8 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst '6E'   count            8 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'E397' count            8 ( 0%) time            2 (0.250000)
00:27:00 HHC02292I Inst 'FD'   count            7 ( 0%) time          102 (14.571428)
00:27:00 HHC02292I Inst 'DE'   count            6 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'B299' count            4 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'B38C' count            4 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'B384' count            4 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'B3B5' count            3 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst '22'   count            3 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst '2C'   count            3 ( 0%) time            1 (0.333333)
00:27:00 HHC02292I Inst 'B277' count            3 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'E8'   count            2 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'E32E' count            2 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'B25D' count            2 ( 0%) time            1 (0.500000)
00:27:00 HHC02292I Inst 'B99F' count            2 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst '97'   count            1 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'B311' count            1 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'DF'   count            1 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'FC'   count            1 ( 0%) time            0 (0.000000)
00:27:00 HHC02292I Inst 'E30C' count            1 ( 0%) time            0 (0.000000)
76bav commented 1 year ago

Hi David, I accept all of your suggestions. I think about sorting option later. For now, I want to play with "SLA", "AP", "SP" and probably "SLDA".

Best regards Andrey

Fish-Git commented 1 year ago

For now, I want to play with "SLA", "AP", "SP" and probably "SLDA".

Are you familiar with Harold Grovesteen's (one of our developes) most excellent SATK/ASMA product?

It allows you to easily construct standalone test programs that you can then easily run in Hercules. The Hercules project itself makes extensive use of it to create the many "QA" Quality Assurance tests we have that are used to verify proper Hercules functionality, including many instructions. It's great!

I only mention it because I have taken an Instruction Timing test program someone wrote a long time ago for MVS (called "MIPS370" I think) and have converted it into a standalone program that can be easily run under Hercules.

I haven't released it yet but it seems to work quite well:

I believe it should provide much more accurate and meaningful instruction timing report that your patched OPTION_INSTR_COUNT_AND_TIME technique currently provides.

Of course, I suppose on the grand scale of things it doesn't really matter which technique you use, as long as it is able to show your changes you want to make actually improve a given instruction's speed and performance.

ANYWAY... good luck to you in your endeavor! I look forward to seeing your proposed improvements to the instructions you listed!

p.s. You should probably include the SLAG and SLAK instruction along with your proposed SLA and SLDA improvements. They're all doing the same thing.