program Ymm_Watch; {$APPTYPE CONSOLE} uses SysUtils; type v8=array [1..8] of Cardinal; var _ymm0,_ymm1,_ymm2,_ymm3,_ymm4,_ymm5,_ymm6,_ymm7:v8; begin asm mov eax,$12345678 movd xmm0,eax pshufd xmm0,xmm0,0 call @Watch {**************************} mov eax,$87654321 db $c5,$fc,$77 //vzeroall db $c5,$f9,$6e,$c0 //vmovd xmm0,eax db $c4,$e2,$7d,$58,$c0 //vpbroadcastd ymm0,xmm0 call @Watch jmp @Exit /////////////////////////// @Watch: push esi lea esi,_ymm0 db $c5,$fe,$7f,$06 //vmovdqu [esi],ymm0 call @Perm lea esi,_ymm1 db $c5,$fe,$7f,$0e //vmovdqu [esi],ymm1 call @Perm lea esi,_ymm2 db $c5,$fe,$7f,$16 //vmovdqu [esi],ymm2 call @Perm lea esi,_ymm3 db $c5,$fe,$7f,$1e //vmovdqu [esi],ymm3 call @Perm lea esi,_ymm4 db $c5,$fe,$7f,$26 //vmovdqu [esi],ymm4 call @Perm lea esi,_ymm5 db $c5,$fe,$7f,$2e //vmovdqu [esi],ymm5 call @Perm lea esi,_ymm6 db $c5,$fe,$7f,$36 //vmovdqu [esi],ymm6 call @Perm lea esi,_ymm7 db $c5,$fe,$7f,$3e //vmovdqu [esi],ymm7 call @Perm pop esi ret @Perm: push eax push ecx mov eax,[esi+0*4] mov ecx,[esi+7*4] mov [esi+0*4],ecx mov [esi+7*4],eax mov eax,[esi+1*4] mov ecx,[esi+6*4] mov [esi+1*4],ecx mov [esi+6*4],eax mov eax,[esi+2*4] mov ecx,[esi+5*4] mov [esi+2*4],ecx mov [esi+5*4],eax mov eax,[esi+3*4] mov ecx,[esi+4*4] mov [esi+3*4],ecx mov [esi+4*4],eax pop ecx pop eax ret ///////////////////////// @Exit: end; end. |