Finding candidates to replace their microcode

By: Anonymous (nospam.delete@this.nospam.com), August 21, 2004 4:45 pm
Room: Moderated Discussions
Dresdenboy (mw212@informatik.uni-rostock.de) on 8/21/04 wrote:
---------------------------
>Anonymous (nospam@nospam.com) on 8/20/04 wrote:
>---------------------------
>>>BTW, the code contains ~30% register copying MOV instructions. I'd like to see
>>>x86 MPUs address this wasting of execution units in the future.
>>
>>Opteron already does this, by eliminating moves as part of the register renaming
>>process. I think it was discussed in the Chip Architect article on the K8 core.
>>This is also trivial to do in binary translation systems (Transmeta does it extensively).
>>As far as I know, the only chip that doesn't is Intel.
>
>I think the only benefit is then, that the execution unit has nothing to do and
>thus saves power. However, the MOVs take away decode bandwidth and space in the
>scheduler queues and the ROB. If K9 will have the lookahead and operand collapse
>units as described in many patents, this situation could improve. Then the negative
>effect of the MOVs, which are mostly necessary because of the 2 operand format (except for LEA), could be eliminated.
>

I thought this was already implemented in K8, for cases like mov eax,edx; op eax,ecx => add eax = edx op ecx (i.e., the target register is overwritten again immediately after the move.)

>That's why I'm interested in creating some custom K8 microcode. AFAIK the RISC86
>ops have Src1, Src2 and Dest1 fields - so they have a 3 operand format.

K7 and K8 cores have *many* changes from RISC86; they are only inspired by its design, but do not use similar encodings or capabilities. For instance, many uops specify three source operands plus various flag forwarding paths and more. It isn't a simple RISC like ISA any more.

>And if I'd know the microinstructions I need for my optimization, I won't spend more than 2 days for implementation.

Hopefully you don't really think rewriting key microcode sequences like this would take only two days! Even if you knew every detail of the uop encoding and meaning, it could take much longer to verify the microcode works correctly in every possible pipeline state and retirement order. Microcoding is not something even a seasoned assembly language programmer should assume is easy. I've done it and it can often be just as complicated as gate level hardware design, since microcode typically controls gates and mux inputs directly. Presumably K8 microcode is somewhere in between true horizontal microcode and three-operand assembly language, but it would still be very hard even for those within AMD.

This is why I haven't attempted any further analysis of the K8 microcode format. It would be a very boring and lengthy reverse engineering task and at the end there is very little practical payoff. Creating entirely new instructions is unlikely unless the capability is already supported by the hardwired ALUs.

>I'm speaking about a key algorithm/function with just 20-30 uOps. BTW the temporal registers would offer another possibility since 16 GPRs/SSE2 regs are still not enough :)

Micro-ops from the microcode ROM or patch area are encoded in terms of logical registers, not renamed registers! Therefore you would still be limited to 16 GPRs + 8 reserved registers (in the case of K8), although the non destructive three operand format would help somewhat. Also keep in mind that the hardware still schedules internal uops just like any other x86 instruction uop, so you're still limited by the scheduler window, etc.

I'm therefore not convinced coding directly in micro-ops would help performance that much, unless your program is decode bandwidth limited. I'd suggest translating your program into a microcode like ISA such as IA-64 or Crusoe (see my Crusoe Exposed article), since these would be similar to the level of K8 microcode prior to register renaming.
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Opteron Exposed: Reverse Engineering AMD K8 Microcode UpdatesAnonymous2004/07/22 01:39 AM
  Opteron Exposed: Reverse Engineering AMD K8 MicrocDresdenboy2004/07/22 05:13 AM
    Opteron Exposed: Reverse Engineering AMD K8 MicrocAK2004/07/22 08:49 AM
      Opteron Exposed: Reverse Engineering AMD K8 MicrocDresdenboy2004/07/22 10:26 AM
        the former posting has no new text, continue hereDresdenboy2004/07/22 10:32 AM
  An additionDresdenboy2004/07/22 08:04 AM
    An additionAnonymous2004/07/22 02:32 PM
      An additionDresdenboy2004/07/22 02:55 PM
  Opteron Exposed: Reverse Engineering AMD K8 Microctom vier2004/07/22 08:38 AM
    Opteron Exposed: Reverse Engineering AMD K8 MicrocWouter Tinus2004/07/22 08:56 AM
    Opteron Exposed: Reverse Engineering AMD K8 MicrocIgor2004/07/23 10:00 PM
      Opteron Exposed: Reverse Engineering AMD K8 MicrocKronos2004/07/24 02:04 PM
  Opteron Exposed: Reverse Engineering AMD K8 Microcode UpdatesMax2004/07/22 01:01 PM
    Opteron Exposed: Reverse Engineering AMD K8 Microcode UpdatesAnonymous2004/07/22 05:26 PM
  Does that means..._Arthur2004/07/22 10:01 PM
    Does that means...Dresdenboy2004/07/23 03:27 AM
    Does that means...Jan2004/07/23 07:51 AM
      Does that means...Anonymous2004/07/23 03:10 PM
        Does that means...Igor2004/07/23 10:42 PM
          Does that means...Anonymous2004/07/24 09:53 PM
            Does that means...Igor2004/07/25 12:08 AM
            Does that means...Anonymous2004/07/25 12:17 AM
              Does that means...anonymous2004/07/25 04:31 PM
                Does that means...Igor2004/07/26 08:42 PM
  Permanent virusess.chauhan2004/07/27 12:25 AM
    Permanent virusesAnonymous2004/07/27 10:42 AM
  Finding candidates to replace their microcodeDresdenboy2004/08/19 02:06 AM
    Finding candidates to replace their microcodePaul DeMone2004/08/19 06:22 AM
      Finding candidates to replace their microcodeDavid Kanter2004/08/19 06:53 AM
        Finding candidates to replace their microcodefoobar2004/08/19 09:55 AM
          Finding candidates to replace their microcodeDavid Kanter2004/08/19 10:58 AM
          Finding candidates to replace their microcodeAnonymous2004/08/20 01:56 PM
            Finding candidates to replace their microcodehobold2004/08/23 03:14 PM
      Finding candidates to replace their microcodeDresdenboy2004/08/19 10:59 AM
        Finding candidates to replace their microcodeanonymous2004/08/19 03:35 PM
        Finding candidates to replace their microcodeAnonymous2004/08/20 02:23 PM
          Finding candidates to replace their microcodeGroo2004/08/20 09:25 PM
          Finding candidates to replace their microcodeDresdenboy2004/08/21 05:01 AM
            Finding candidates to replace their microcodeAnonymous2004/08/21 04:45 PM
              Finding candidates to replace their microcodeanonymous2004/08/21 09:45 PM
      Finding candidates to replace their microcodeMatt Craighead2004/08/19 01:18 PM
      Finding candidates to replace their microcodeRick C. Hodgin2004/08/21 04:58 AM
        Finding candidates to replace their microcodeanonymous2004/08/21 09:41 PM
          Finding candidates to replace their microcodeRick C. Hodgin2004/08/22 08:31 AM
            Finding candidates to replace their microcodeanonymous2004/08/23 08:56 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell green?