开发者

Does Delphi support all MMX/SSE instructions?

I have this snippet of code:

@combinerows:
    mov esi,eax
    and edi,Row1Mask
    and ebx,Row2Mask
    or ebx,edi
    //NewQ:= (Row1 and Row1Mask) or (Row2 and Row2Mask);

  //Result:= NewQ xor q;
  PUNPCKDQ mm4,mm5   <-- I get an error here
  //mov eax,[eax].q
  movd eax,mm4

  //q:= NewQ;
  mov [esi].q,ebx
  xor eax,ebx  //Return difference.

I get this error:

[Pascal Error] SDIMAIN.pas(718): E2003 Undeclared identifier: 'PUNPCKDQ'

Am I doing something wrong, or does Delph开发者_如何学Goi 2007 not support a full set of MMX/SSE instructions?


Delphi 2007 supports the MMX and SSE instruction sets. Certainly, Delphi 2010 and XE support up to the SSE4.2 instruction sets (but so far no support for AVX).

However, Delphi is correct to complain about your "PUNPCKDQ" instruction: If you search the Intel® 64 and IA-32 Architectures Software Developer’s Manual (especially Volumes 2A and 2B would be relevant), you will NOT find an instruction by that name. I.e., it is your mistake, not Delphi's lack of support for this instruction.


A quick Google gives information on a PUNPCKLDQ rather than PUNPCKDQ.

D2007 accepts PUNPCKLDQ
and even better it also supports PUNPCKHDQ, which lets you transfer a high order dword to a low dword enabling you to load it into a general purpose register.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜