Delphi支持所有MMX/SSE指令吗?
我有这段代码:
@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.
我收到此错误:
[Pascal 错误] SDIMAIN.pas(718): E2003 未声明的标识符:'PUNPCKDQ'
我做错了什么吗,或者 Delphi 2007 不支持全套 MMX/SSE 指令吗?
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 Delphi 2007 not support a full set of MMX/SSE instructions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Delphi 2007支持MMX和SSE指令集。当然,Delphi 2010和XE最高支持SSE4.2指令集(但目前还不支持AVX)。
但是,Delphi 抱怨您的“
PUNPCKDQ
”指令是正确的:如果您搜索 英特尔® 64 和 IA-32 架构软件开发人员手册(特别是第 2A 卷和第 2B 卷相关),您将找不到该名称的指令。也就是说,这是你的错误,而不是Delphi缺乏对该指令的支持。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.快速的 Google 会提供有关
PUNPCKLDQ
而不是 PUNPCKDQ 的信息。D2007 接受
PUNPCKLDQ
更好的是,它还支持
PUNPCKHDQ
,它可以让您将高位双字传输到低位双字,从而将其加载到通用寄存器中。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.