MMX



  • Hi,

    Ich habe da ein kleines verstaendnissproblem mit den MMX registern. Es sind ja 64 bit register aber wie kann ich dort 4 16bit integer in einen register unterbringen um sie dann alle miteinander zu multiplizieren und wie kann ich sie dann nach der multiplekation wieder da rausholen ???

    also so sollte es etwa aussehen:

    void Irgendwas()
    {
       short Test[ 8 ];
       _asm
       {
          // Test[ 0 ] - Test[ 3 ] in mm0 
          // Test[ 4 ] - Test[ 7 ] in mm1
    
          paddw mm0,mm1 ; Inhalte addieren
    
          // Inhalte von mm0 in Test[ 0 ] - Test [ 4 ] copieren;
        }
    }
    

    Koennte mir da jemand helfen ???

    Danke



  • B.4.241 PMULHW, PMULLW: Multiply Packed 16−bit Integers, and Store
    PMULHW mm1,mm2/m64 ; 0F E5 /r [PENT,MMX]
    PMULLW mm1,mm2/m64 ; 0F D5 /r [PENT,MMX]
    PMULHW xmm1,xmm2/m128 ; 66 0F E5 /r [WILLAMETTE,SSE2]
    PMULLW xmm1,xmm2/m128 ; 66 0F D5 /r [WILLAMETTE,SSE2]
    PMULxW takes two packed unsigned 16−bit integer inputs, and multiplies the values in the inputs,
    forming doubleword results.
    • PMULHW then stores the top 16 bits of each doubleword in the destination (first) operand;
    • PMULLW stores the bottom 16 bits of each doubleword in the destination operand.

    Ich denke das sollte helfen. Entnommen aus der Dokumentation für NASM.

    mfg
    -bg-


Anmelden zum Antworten