![]() |
![]() |
#61 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
|
Last edited by ross; 27 November 2019 at 16:21. |
![]() |
![]() |
#62 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,033
|
Quote:
Move.w d0,a4 Add.l A2,a4 with Lea (a2,d0.w),a4 and check it will be nice ![]() |
|
![]() |
![]() |
#63 | ||
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Poor cool kids.On the contrary, i have my alternatives.
Quote:
You can download the sources here: http://oscomp.hu/depot/polygon1.c http://oscomp.hu/depot/ClearBlock32.68k http://oscomp.hu/depot/PolygonBitmapToPlanes32.3.68k You may pass the -spacesto compile the assembly sources, because otherwise VAsm chokes on whitespaces. Also, i added the USE_ASMPBTPdefinition as a macro fork, to be able to switch between the C and ASM copying routine. (Do not mind the colour change, it is due the reverse order of the pattern LUT, it is irrelevant in the test.) Quote:
|
||
![]() |
![]() |
#64 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
|
|
![]() |
![]() |
#65 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
![]() |
![]() |
#66 | ||
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Quote:
Quote:
Is it even possible to do something similar in GCC 8? |
||
![]() |
![]() |
#67 | ||
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
Quote:
Edit: If you feel like continuing with GCC 8 yourself, here's how I do my assembly integration - should get you far enough to google the rest. Code:
void ClipAndFillPolygon2D(const UWORD n, const Point2D * polygon, const UWORD colour) { WaitBlit(); { volatile register APTR * _a0 __asm("a0") = display.backBufferBitplanes; volatile register UWORD _d0 __asm("d0") = n; volatile register Point2D * _a1 __asm("a1") = polygon; volatile register UWORD _d1 __asm("d1") = colour; __asm volatile ( " jsr _scanlineFill" : // no outputs : "r" (_d0), "r" (_d1), "r" (_a0), "r" (_a1) // inputs : // no registers clobbered ); } } Last edited by deimos; 27 November 2019 at 18:29. |
||
![]() |
![]() |
#68 | ||
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Quote:
Quote:
Besides, when i measure the time two times with the same setup, the difference can be positive and negative, but it is always in the microsecond interval.Okay, but how? Also, if it is more versatile, then why cannot work this way? Edit: Isn't this approach available in GCC 6 too? (Because i remember it from GCC 4.) Besides this is not what i meant; i was talking about including a VAsm (or whatever) assembled object, and calling it's internal routines. Also, i cannot continue with GCC 8, until it is not ported to macOS, Linux, Solaris, or any BSD. Last edited by TCH; 27 November 2019 at 18:38. Reason: deimos edited his post, before i finished my answer |
||
![]() |
![]() |
#69 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
I really think we should just measure the thing we're trying to measure.
It's useful to know other measurements, so we can know where to put our effort into, but they don't help to measure the improvement that's been made to the function people have been working on. It also doesn't help that there are no direct measurements being taken, only through an external 'amtime' tool. Regarding calling assembly code, of course you can code an assembly routine to accept parameters C style, but if you're trying to optimise a heavily used function that probably isn't what you want to do. You want to give everything possible to gcc and let it inline and optimise - that's its job. |
![]() |
![]() |
#70 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
![]() |
![]() |
#71 | |||
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Quote:
Quote:
Quote:
It may be not perfect and not the most optimized, but i am a newbie regarding these kind of stuff, i am on the learning curve, with time, it will be more optimized.Yeah, i really have to tidy my flat already... Or did you mean porting the GCC 8 crosscompiler to some UNIX? Then guess again, this is way beyond my expertise. |
|||
![]() |
![]() |
#72 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
Regarding your messy flat? I can't help you there, but maybe your time would be better spent installing a copy of Windows so that you have more spare time. |
|
![]() |
![]() |
#73 | |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Quote:
|
|
![]() |
![]() |
#74 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Then why not tell us the improvement in the actual routine that was optimised?
Everyone is allowed their own foibles, however misguided. |
![]() |
![]() |
#75 | |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Quote:
|
|
![]() |
![]() |
#76 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
|
![]() |
![]() |
#77 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
What? Whenever somebody sent in a new iteration of the routine, i did tell, if there was an improvement. Did you read the topic?
|
![]() |
![]() |
#78 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
You've obviously chosen not to hear what I've said. You've said whether or not there were improvements, and given percentage measurements. But the percentage measurements were not of the thing that was changing, i.e. you gave only the time for the entire executable, taken with an outside tool, giving the impression that the assembly optimisations where giving minute 3-4% improvements, when the reality was that they were probably 5 or 10 times that. But we'll never know because you won't measure.
|
![]() |
![]() |
#79 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
No, i just did not understood what are you wanted from me. And i am still not sure. If by "change", you mean the change in the source, that was not done by me, but other forum members. And it is posted here, so you can see for yourself.
Edit: If program with old algorithm runs 100 secs and with the new it runs 95 and everything else is unchanged, then it's a 5% percent speedup. What's your problem? Last edited by TCH; 27 November 2019 at 20:13. Reason: deimos edited his post |
![]() |
![]() |
#80 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
No, not change in source code. Change in time spent in the effected parts of code. But I'm sure you know that. If you really want to know the how the code has improved, you'll measure around that - it's not hard, if your code is O/S friendly it's only few lines.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|