English Amiga Board Amiga Lore


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

 
 
Thread Tools
Old 29 August 2017, 20:19   #161
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by ross View Post
Attached a 54 byte version (with the potential bugs corrected).
Like NorthWay said the real turning would be to avoid using the 1k buffer.
The stream format is really unfriendly.
I converted your LZSS code from Motorola syntax to AT&T and inserted into the source needed by Vince Weaver (attached). I noticed that line 49 of your source is using an op.l while you converted most of this variable to op.w.

Code:
   addq.l    #(THRESHOLD+1),d4    ; +1 for the former dbf result
Is there a reason why you did not convert to addq.w (overflow possible)? Should I change this to addq.w? Do you see any other errors?
Attached Files
File Type: s ll.m68k_2.s (16.9 KB, 10 views)

Last edited by matthey; 29 August 2017 at 21:03.
matthey is offline  
AdSense AdSense  
Old 29 August 2017, 22:15   #162
ross
Vae victis!

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Posts: 492
Quote:
Originally Posted by matthey View Post
I converted your LZSS code from Motorola syntax to AT&T and inserted into the source needed by Vince Weaver (attached). I noticed that line 49 of your source is using an op.l while you converted most of this variable to op.w.

Code:
   addq.l    #(THRESHOLD+1),d4    ; +1 for the former dbf result
Is there a reason why you did not convert to addq.w (overflow possible)? Should I change this to addq.w? Do you see any other errors?
Hi matthey, is a simple refusal from the old code, it makes no difference whether .w or .l, no overflow possible.
But to be more consistent I made the decision to make all operations 32bit where possible (anyhow word access at odd locations requires 020+..) and note in braces the minimum required specifier (see attach).

I also corrected a bug that you have reintroduced inserting the original A registers initialization.
If LZSS packed data bound is used in final check you need to cmp.l a4,a3.
See my previous message why i had changed comparison.


Best regards,
ross
Attached Files
File Type: s ll.m68k_2_bis.s (16.9 KB, 12 views)
ross is offline  
Old 29 August 2017, 23:24   #163
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
Quote:
Originally Posted by ross View Post
Hi matthey, is a simple refusal from the old code, it makes no difference whether .w or .l, no overflow possible.
But to be more consistent I made the decision to make all operations 32bit where possible (anyhow word access at odd locations requires 020+..) and note in braces the minimum required specifier (see attach).
Right. The code is for 020+ so 32 bit operations are sometimes better performance, especially for 68060. Some programmers may use the code as a reference and it is nice to have it easy to understand and not just optimized for size to the point of being useless. Overall, it is still readable even though the average instruction length is down to ~2.5 bytes/instruction where most compiled code is over 3. This shows the key to improving 68k code density is improving the ISA to make it easier for compilers. If compilers could consistently generate this kind of code density then there would already be an ASIC in the 68k future which would be a game changer for the Amiga. There should be some other interesting ISA comparisons if I can get Vince Weaver in gear. Doing most of the work for him helped last time.

Quote:
Originally Posted by ross View Post
I also corrected a bug that you have reintroduced inserting the original A registers initialization.
If LZSS packed data bound is used in final check you need to cmp.l a4,a3.
See my previous message why i had changed comparison.
Doh! How did I miss that. Thanks.

Last edited by matthey; 29 August 2017 at 23:56.
matthey is offline  
Old 30 August 2017, 00:23   #164
ross
Vae victis!

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Posts: 492
wait!
With the bound check of the compressed data we can have the same problem of original code.
The only properly check is the unpacked data bound.
But if it was acceptable before..

EDIT: in fact is not the case as original code, the check is at the loop end,
so if the stream is not corrupted last byte/word is ever a byte/word_match copy
(a good collateral effect -> no out of buffer read/write)

Code checked and works


ross

Last edited by ross; 30 August 2017 at 01:19. Reason: []
ross is offline  
Old 30 August 2017, 01:21   #165
matthey
Banned
 
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
@ross
Good. I already sent an e-mail to Vince today but I linked to this thread in case any late changes were necessary.

Update: Vince e-mailed me but he is busy with school starting.

Last edited by matthey; 03 September 2017 at 00:56.
matthey is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Generated code and CPU Instruction Cache Mrs Beanbag Coders. Asm / Hardware 11 23 May 2014 11:05
EAB Christmas Song-writing Contest mr_a500 project.EAB 64 24 May 2009 02:44
AmigaSYS Wallpaper Contest Calo Nord News 10 22 April 2005 09:33
Landover's Amiga Arcade Conversion Contest Frog News 1 28 January 2005 23:41
Battlechess Contest (EAB vs A500) Bloodwych Nostalgia & memories 67 14 August 2003 14:37

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 02:31.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.23343 seconds with 14 queries