View Single Post
Old 22 August 2015, 12:37   #241
Registered User

Megol's Avatar
Join Date: May 2014
Location: inside the emulator
Posts: 304
Originally Posted by meynaf View Post
So once MOVEM.L is done, doing MOVEM.W is peanuts ? (As the special format is what's tough here, when you have it, you can reuse it, right ?)
Yes it is easy. The only complication is the sign extension but that is required elsewhere.

But many instructions are in this case. They require a special handling that's not reused elsewhere, e.g. DIV is in this case.
Others like LINK need to use several µops.
DIV doesn't touch any critical part of the pipeline so that isn't a problem. In my design it was actually handled a lot like a load missing the cache, this means there is no extra hardware needed for the variable latency operation and starting the execution would be a "store-data" operation in the integer unit.

I never started implementing LINK.

Of course if the problem comes from the total number of subops you have (i.e. the total for all instructions), i can understand it becomes a big problem.
If one have proper microcode support MOVEP isn't hard to execute without extra hardware but it would be slow. Unlike x86 the 68k doesn't really need full microcode support and adding it complicates a critical part - the decoder.

MOVEM needs to be reasonably fast, while MOVEP does not. Isn't it easier when it can be slow ?
Basically it's just a bunch of shift + move.b, and these already exist in the cpu. It's not like if we want it to run in 1 clock.
IIRC the byte store/load starts with the MSB so one either have to do a BSWAP (x86 instruction - translates between little endian and big endian formats) or a rotate to place the data in the right position.
Or one could extend the ld/st unit to support byte operations targeting the MSB of a register. Even further the ld/st unit could be extended to support loading/storing an arbitrary byte of a register.

In a speed demon design changing the ld/st unit could lead to lower clock frequency as it touches a time critical part of the pipeline.
If the same design then doesn't have proper microcode support then it is very hard to execute MOVEP at all. Not because it is really hard per se but because it is a very bad fit for the design.
Megol is offline  
AdSense AdSense  
Page generated in 0.04320 seconds with 10 queries