English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 01 May 2022, 17:38   #1
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 40
ANDI.L #imm,Dn cycle count

M68000 User's Guide (page 121) says 14 cycles, but WinUAE and https://www.atari-forum.com/viewtopic.php?t=16240 say 16 cycles.
I'm very much inclined to believe WinUAE and that Atari CPU-Tester are accurate, however that means that there may be more mistakes in Motorola's User's Manual.
There have probably already been discussions about Motorola's cycle tables but my google-fu eluded me this time.
Any thoughts?
Bartman is offline  
Old 01 May 2022, 18:03   #2
paraj
Registered User

 
Join Date: Feb 2017
Location: Denmark
Posts: 253
Quote:
.M68000UM is probably wrong with instruction timming for ANDI.L #<data>,Dn
instruction. It reads "14(3/0)" but, according to USP4325121, this
instruction is based on the same microwords than EORI.L #<data>,Dn and
ORI.L #<data>,Dn that have a "16(3/0)" timming. In addition, evaluation on
real hardware confirms the 16 cycles timing.
From ye olde Yacht
paraj is offline  
Old 01 May 2022, 18:25   #3
Jobbo
Registered User

Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 263
I always use EASy68k for checking cycle times and that is reporting 16 cycles.
Jobbo is offline  
Old 01 May 2022, 19:05   #4
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 40
Thumbs up

Quote:
Originally Posted by paraj View Post
From ye olde Yacht
Thanks!
However, that brings me to my next "exception". CMPI.L #imm, Dn also being shown as 14 in M68000UM and Yacht, but as 16 in the Atari CPU-Tester.
Bartman is offline  
Old 01 May 2022, 19:17   #5
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 53
Posts: 1,469
I will say 14 cycles is best case, 16 cycles is for other cases.
Don_Adan is offline  
Old 01 May 2022, 19:49   #6
paraj
Registered User

 
Join Date: Feb 2017
Location: Denmark
Posts: 253
Quote:
Originally Posted by Bartman View Post
Thanks!
However, that brings me to my next "exception". CMPI.L #imm, Dn also being shown as 14 in M68000UM and Yacht, but as 16 in the Atari CPU-Tester.
Pretty sure 14 is right, and WinUAE seems to agree. Do you have a link to the Atari CPU-tester?


If you have suitable machine hooked up you can use Toni's cputester to verify the results as it has a timing test mode (but in all likelihood this was already done).
paraj is offline  
Old 01 May 2022, 20:05   #7
deimos
It's coming back!

deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by Don_Adan View Post
I will say 14 cycles is best case, 16 cycles is for other cases.
Is there any way that an AND like that would not be a constant number of cycles though?
deimos is offline  
Old 02 May 2022, 09:58   #8
hooverphonique
ex. demoscener "Bigmama"

 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,336
Quote:
Originally Posted by deimos View Post
Is there any way that an AND like that would not be a constant number of cycles though?
The AND instruction is constant, the CMP could be variable depending on the result of the comparison
hooverphonique is offline  
Old 02 May 2022, 11:08   #9
npomarede
Registered User

 
Join Date: Nov 2017
Location: Paris
Posts: 4
Quote:
Originally Posted by Bartman View Post
M68000 User's Guide (page 121) says 14 cycles, but WinUAE and https://www.atari-forum.com/viewtopic.php?t=16240 say 16 cycles.
I'm very much inclined to believe WinUAE and that Atari CPU-Tester are accurate, however that means that there may be more mistakes in Motorola's User's Manual.
There have probably already been discussions about Motorola's cycle tables but my google-fu eluded me this time.
Any thoughts?
Hi, Hatari dev here

wow, this is such an old thread from 2009 in atari-forum ...
Don't trust fully Atari cycles counting when coding on Amiga, because on Atari all cycles are rounded to the next 4 cycles.
So it's certainly 14 cycles as reported by motorola doc and winuae, which is rounded to 16 cycles under Atari, but that's specific to how Atari allocate memory access between cpu and video.


Nicolas
npomarede is offline  
Old 02 May 2022, 11:41   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,364
Only 68000 instructions (if I didn't miss anything) that have variable cycle usage are:

- register shift instructions
- mul/div
- bset/bclr/bchg #/dn,dn that add 2 extra cycles if source bit number is >= 16.
- bcc (branch taken/not taken difference)
- dbcc (branch taken/not taken/counter expired difference)
- stop
Toni Wilen is offline  
Old 02 May 2022, 14:52   #11
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 591
Arrow

Page 121 (this is what I pressume you're referring to):
Code:
Instruction	Size		op #,Dn		op #,An		op #,M
ANDI		Byte, Word	8(2/0)		—		12(2/1)+
		Long		14(3/0)		—		20(3/2)+
But also on page 120 (table 8-4), for ADD/AND/OR/SUB with Long and op <ea>,Dn:
6(1/0)+**
+ Add effective address calculation time.
** The base time of six clock periods is increased to eight if the effective address mode is register direct or immediate (effective address time should also be added).

Which should then translate to 8+8=16 (and not 6+8) for those instructions, but on page 121 (table 8-5) some are listed as 14 (ANDI) and some as 16 (ADDI, ORI, SUBI). For ADD and SUB I'd understand why (carry over between words), but AND and OR being listed as different is weird.
a/b 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
Count Duckula II ungi request.Old Rare Games 2 03 August 2006 20:47
Body Count Bitmap Brother Retrogaming General Discussion 3 20 September 2005 15:23
Confusion with post count MethodGit project.EAB 13 12 August 2001 20:58

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 04:39.


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