English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 November 2019, 22:41   #101
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
Quote:
Originally Posted by a/b View Post
Code:
    asl.w    #2,d7        ; longwords to bytes
....

    lsr.w    #1,d3

Replace the above with this

Code:
    add.w    d7,d7        ; longwords to bytes
    add.w    d7,d7        ; Saves two cycles

....

    add.w    d3,d3        ; Saves four cycles

This works only for word operands though. Long operands are slower.
sparhawk is offline  
Old 30 November 2019, 22:42   #102
Hedeon
Semi-Retired
 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 2,006
I am not an expert, but add.w d3,d3 doesn't replace lsr.w #1 d3 i think
Hedeon is offline  
Old 30 November 2019, 22:49   #103
sparhawk
Registered User
 
sparhawk's Avatar
 
Join Date: Sep 2019
Location: Essen/Germany
Age: 55
Posts: 463
You are right. I missed the "right" shift part. Works only for the left shift.
sparhawk is offline  
Old 01 December 2019, 00:40   #104
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,979
Quote:
Originally Posted by TCH View Post
No, at least i did not. But maybe i was in error. Now i am not sure if this approach is really that reliable:



It shows ~3-~3% differences for the very same routines. With the external measure, the difference between runs was under 0.1%.I agree with this. But this experience is entirely independent of the discussion about the measure methods.
You tested speed on WinUAE. Better test on real A500. Im not 100% sure that WinUAE timing is OK for all 68000 commands.
Don_Adan is offline  
Old 01 December 2019, 12:51   #105
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
@roondar:
Perhaps the problem lies in that i run only once the measured code, instead running it in a cycle. But to do that, i'll have to rewrite the C part, either to be encapsulated in a subroutine, or restore the variables it is trashing during work. (Intentionally, last part of the function, none of the variables are needed anymore.) However, this means an overhead, which will degrade the C part's performance, which is not fair, as it not's there without the measuring...

@sparhawk:
Thanks for the tip, i've put it into the algorithm.

@Don_Adan:
Even if we assume, that WinUAE's timings are not close enough to perfect (i'm running this in cycle-exact mode though, which is able to run demos which needs perfect timing), the difference would be appear between the results in emulator and on a real A500 and not between two results in the emulator. Unless WinUAE's timings are really "sliding" and the VM has "hiccups".

Regardless of this, i would agree with you about testing it on real hardware, but for that i would need a handler which is able to mount the PC on the Amiga. I have no ethernet on my Amigas and i still did not had the time and mood to write my parallel port "network drive" handler. Of course, i could just use my old LPT filetransfer program between them, but that would be much more inconvenient. So, it's WinUAE now. I'll do the first option eventually...
TCH is offline  
Old 01 December 2019, 17:38   #106
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,979
Quote:
Originally Posted by TCH View Post
@roondar:
Perhaps the problem lies in that i run only once the measured code, instead running it in a cycle. But to do that, i'll have to rewrite the C part, either to be encapsulated in a subroutine, or restore the variables it is trashing during work. (Intentionally, last part of the function, none of the variables are needed anymore.) However, this means an overhead, which will degrade the C part's performance, which is not fair, as it not's there without the measuring...

@sparhawk:
Thanks for the tip, i've put it into the algorithm.

@Don_Adan:
Even if we assume, that WinUAE's timings are not close enough to perfect (i'm running this in cycle-exact mode though, which is able to run demos which needs perfect timing), the difference would be appear between the results in emulator and on a real A500 and not between two results in the emulator. Unless WinUAE's timings are really "sliding" and the VM has "hiccups".

Regardless of this, i would agree with you about testing it on real hardware, but for that i would need a handler which is able to mount the PC on the Amiga. I have no ethernet on my Amigas and i still did not had the time and mood to write my parallel port "network drive" handler. Of course, i could just use my old LPT filetransfer program between them, but that would be much more inconvenient. So, it's WinUAE now. I'll do the first option eventually...
Ok, anyway it will be interesting if you can test latest 5 versions on real A500 too. You need access to PC with disk drive, this is the easiest method to share files between PC and Amiga 500.
Don_Adan is offline  
Old 01 December 2019, 18:24   #107
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
Why would i do floppy swaping between them, when i have a simple transfer program for parallel port? Besides i do not have a PC with floppy anymore.
TCH 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
Optimizing HAM8 renderer. Thorham Coders. Asm / Hardware 5 22 June 2017 18:29
NetSurf AGA optimizing arti Coders. Asm / Hardware 199 10 November 2013 14:36
Layered tile engine optimizing. Thorham Coders. General 0 30 September 2011 20:43
Benching and optimizing CF-IDE speed Photon support.Hardware 12 15 July 2009 01:48
For people who like optimizing 680x0 code. Thorham Coders. General 5 28 May 2008 11:48

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 01:21.

Top

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