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

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

问题描述

该指令的英特尔 ISA 参考文档很清楚:

VPBLENDVB xmm1, xmm2, xmm3/m128, xmm4

<块引用>

使用指定掩码寄存器xmm4中的掩码位从xmm2xmm3/m128中选择字节值,并将这些值存储到<代码>xmm1.

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

那么使用 AT&T 语法会变成什么?我们知道目的寄存器必须在最后,但是源操作数的顺序是什么?

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

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

还是别的什么?

解决方案

组装(注意 GAS 使用 % 而不是 $ 来表示寄存器)以下内容:

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

使用 GNU 汇编器(x86_64 2.6.38 linux 上的版本 2.21.0.20110327)然后反汇编产量:

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

intel 语法(如手册所示):

$ objdump -d -M intel a.out0: 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.

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

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