与英特尔语法相比,AT& T语法中源操作数的顺序是什么? [英] what is the order of source operands in AT&T syntax compared to Intel syntax?

查看:221
本文介绍了与英特尔语法相比,AT& T语法中源操作数的顺序是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此指令的英特尔ISA参考文档很明确:

  VPBLENDVB xmm1,xmm2,xmm3 / m128,xmm4 




xmm2 xmm4 中的掩码位,并将值存储到<$ c>和 xmm3 / m128 c $ c> xmm1 。



xmm1 是目的地, xmm2 / 3/4 是源操作数

那么这是怎么使用AT& T语法?我们知道目标寄存器必须是最后一个,但源操作数的顺序是什么?

  vpblendvb $ xmm2,$ xmm3, $ xmm4,$ xmm1 

  vpblendvb $ xmm4,$ xmm3,$ xmm2,$ xmm1 

或者别的什么东西?

解决方案

组装(注意GAS使用 $ 来表示寄存器):

  vpblendvb%xmm4,% xmm3,%xmm2,%xmm1 

与GNU汇编器(版本2.21.0.20110327在x86_64 2.6.38然后分解产量:

$ $ $ $ $ $ $ $ $ objdump -d a.out
0:c4 e3 69 4c cb 40 vpblendvb%xmm4,%xmm3,%xmm2,%xmm1

在intel语法中(如手册所示) :

  $ objdump -d -M intel a.out 
0:c4 e3 69 4c cb 40 vpblendvb xmm1, xmm2,xmm3,xmm4

所以看起来所有参数的顺序都是相反的。


The Intel ISA reference documentation for this instruction is clear:

VPBLENDVB xmm1, xmm2, xmm3/m128, xmm4

Select byte values from xmm2 and xmm3/m128 using mask bits in the specified mask register, xmm4, and store the values into xmm1.

xmm1 is the destination, xmm2/3/4 are source operands

So what does this become using AT&T syntax? We know that the destination register must be last, but what is the order of source operands?

vpblendvb $xmm2, $xmm3, $xmm4, $xmm1

or

vpblendvb $xmm4, $xmm3, $xmm2, $xmm1

or something else?

解决方案

Assembling (note GAS uses % instead of $ to denote registers) the following:

vpblendvb %xmm4, %xmm3, %xmm2, %xmm1

with the GNU assembler (version 2.21.0.20110327 on x86_64 2.6.38 linux) and then disassembling yields:

$ objdump -d a.out
    0:    c4 e3 69 4c cb 40     vpblendvb %xmm4,%xmm3,%xmm2,%xmm1

in intel syntax (as the manual shows):

$ objdump -d -M intel a.out
    0:    c4 e3 69 4c cb 40     vpblendvb xmm1,xmm2,xmm3,xmm4

So it looks like the order of all the arguments is reversed.

这篇关于与英特尔语法相比,AT&amp; T语法中源操作数的顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆