English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 26 October 2021, 23:12   #41
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
The web version has some strange output, looks like some debug or something?

PHP Code:
{"statement":{"type":"","text":";============================================================================","loc":{"start":0,"end":77},"operands":[],"comment":{"type":"Comment","text":";============================================================================","loc":{"start":0,"end":77}}},"bytes":0,"bss":false
KONEY is offline  
Old 27 October 2021, 14:53   #42
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
that's JSON
DanScott is offline  
Old 27 October 2021, 15:56   #43
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
Of course, but looks like a debugging output. Is it supposed to be like this?
KONEY is offline  
Old 28 October 2021, 00:33   #44
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by KONEY View Post
Of course, but looks like a debugging output. Is it supposed to be like this?

No it's not! I accidentally committed some debugging code. Should be sorted now.
gigabates is offline  
Old 28 October 2021, 09:36   #45
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
it works, thanks! And thanks for the useful tool!
KONEY is offline  
Old 28 October 2021, 09:39   #46
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
This is a very cool tool - extremely useful.
It can save me a lot of work for the optimisation phase!

In fact, the only possible major improvement I can see would be to be able to select CPU type (000/020/etc) as well
roondar is offline  
Old 28 October 2021, 11:28   #47
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Quote:
Originally Posted by roondar View Post
This is a very cool tool - extremely useful.
It can save me a lot of work for the optimisation phase!

In fact, the only possible major improvement I can see would be to be able to select CPU type (000/020/etc) as well
Thanks, I'm glad it's useful! I did look into other processor types and it would definitely be possible, but things do get more complicated.

From the MC68020UM:
Quote:
The advanced architecture of the MC68020/EC020 makes exact instruction timing calculations difficult due to the effects of:
1. An On-Chip Instruction Cache and Instruction Prefetch
2. Operand Misalignment
3. Bus Controller/Sequence Concurrency
4. Instruction Execution Overlap
These factors make MC68020/EC020 instruction set timing difficult to calculate on a single instruction basis since instructions vary in execution time from one context to another.
It then goes on to list 3 values for each operation and address lookup: Best Case, Cache Case and Worst Case. The tool would ideally need to display all three. I'm also wondering if the misalignment and execution overlap factors could be determined from the context in the program.
gigabates is offline  
Old 28 October 2021, 11:33   #48
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 666
As a minor improvment I'd suggest some integration with github, like an url field which loads a piece of code from a repository

Quote:
Originally Posted by roondar View Post
In fact, the only possible major improvement I can see would be to be able to select CPU type (000/020/etc) as well
KONEY is offline  
Old 28 October 2021, 17:57   #49
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,408
Quote:
Originally Posted by gigabates View Post
Thanks, I'm glad it's useful! I did look into other processor types and it would definitely be possible, but things do get more complicated.

From the MC68020UM:
It then goes on to list 3 values for each operation and address lookup: Best Case, Cache Case and Worst Case. The tool would ideally need to display all three. I'm also wondering if the misalignment and execution overlap factors could be determined from the context in the program.
The difficulty regarding misalignment is that you'd need to know exactly how the 68020 treats the various cases that can happen given that it prefetches 32 bits at a time. Determining starting alignment/misalignment is probably easy enough, but I'm not too sure what happens when you start looking at full instruction streams. My guess is that an initially aligned instruction, linear (no branching) instruction stream stays aligned even if parts of it might technically not be - due to the 32 bit prefetch. But that's just a guess and I'm not so sure what happens when you jump/branch to non-aligned words.

To me, this all sounds tricky, but perhaps you or someone else here has some shortcuts/methods that make it easier.

Instruction overlap is even more tricky, as the initial workings of the 68020 regarding this are not properly/fully documented by Motorola or anyone else (there is something in the user manual, but I'm pretty sure those examples are just the tip of the iceberg in terms of what can and can't happen). I'd personally suggest leaving this out altogether, getting a reasonable baseline count is worthwhile on it's own even if it may miss out on the overlap advantages.


Anyway, I'd honestly already be very happy with a cycle counter that shows best/cache/worst cases for 68020+. I'd be even happier with one that allows me to specify the worst case cycle speed penalty (as this is fully dependent on memory speed and A1200 chip memory is quite slow)
roondar is offline  
Old 28 October 2021, 21:23   #50
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 183
very good tool, but if I want find an optimization for a mulu, muls
I get a range of cycles. It could be optimized.
(thats only a suggestion for improvement)

70 is max time. Motorola documentation only list max time for any instruction that has variable timing.

Code:
MULS, MULU — The multiply algorithm requires 38+2n clocks where n is defined as:
MULU: n = the number of ones in the <ea>
MULS: n=concatenate the <ea> with a zero as the LSB; n is the resultant number of 10
or 01 patterns in the 17-bit source; i.e., worst case happens when the source is $5555.

Code:
mul:			cycles		n
	move.l  #0,d0					12(3/0)
	move.l  #0,d1					12(3/0)
	mulu	d0,d1	; 38		 0		38(1/0) 70(1/0)
	move.l  #1,d0
	move.l  #0,d1	
	mulu	d0,d1	; 40		 1
	move.l  #2,d0
	move.l  #0,d1	
	mulu	d0,d1	; 40		 10
	move.l  #3,d0
	move.l  #0,d1	
	mulu	d0,d1	; 42		 11
Total cycles:
248(28/0) – 376(28/0)
Rock'n Roll is offline  
Old 29 October 2021, 01:45   #51
gigabates
Registered User
 
Join Date: Jan 2021
Location: Watford, UK
Posts: 57
Yeah it does give exact cycle counts using the correct algorithm when multiplying by immediate values. What it can't currently do is know what value is in a given register like in your example. It would essentially have to execute the code to know this. For now it gives a range in this case.
Attached Thumbnails
Click image for larger version

Name:	muls.png
Views:	70
Size:	59.8 KB
ID:	73616  
gigabates is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
horiz. size & vert. size greyed out in some configurations honx support.WinUAE 3 15 August 2020 21:14
ASM: Asm-ONE or AsmPro - how to set a Hello amiga coders, I hope it is ok to hijack ? Fireball Coders. Asm / Hardware 2 24 April 2020 21:16
Hex2 - my little calculator ALB42 News 0 11 November 2018 11:46
Amiga calculator cla Coders. Releases 35 30 December 2017 15:00
Speccy on Ti-89 calculator Fred the Fop Retrogaming General Discussion 3 27 January 2007 02:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11029 seconds with 16 queries