This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR gas/16488: Add test for incorrect memory operand for gather/scatter instructions.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Zolotukhin <michael dot v dot zolotukhin at gmail dot com>
- Cc: Jan Beulich <JBeulich at suse dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 31 Jan 2014 06:53:26 -0800
- Subject: Re: [PATCH] PR gas/16488: Add test for incorrect memory operand for gather/scatter instructions.
- Authentication-results: sourceware.org; auth=none
- References: <20140131100941 dot GA24910 at msticlxl57 dot ims dot intel dot com> <CAMe9rOrQToFnaazvWCfoyXhEdfOS=F-r=qfHYp57ivTGjjALGg at mail dot gmail dot com> <CANtU079oJ6oPsQkjn7i4YWuXTcALVYe_WKvDYyMouXePbMOsQw at mail dot gmail dot com>
On Fri, Jan 31, 2014 at 6:38 AM, Michael Zolotukhin
<michael.v.zolotukhin@gmail.com> wrote:
>> You added 2 tests for AT&T syntax, but only 1 for
>> Intel syntax. Any particular reason for this?
> Yes, the following test doesn't give an error:
> vgatherqpd zmm6{k1}, ZMMWORD PTR [zmm3]
> I think it's because it is equivalent to something like vgatherqpd
> (,%zmm2,),%zmm6{%k1} (please note commas around zmm2), which also
> doesn't lead to an error. I assume that in Intel syntax this test is
> regarded as a rich addressing mode, which is acceptable for
> gather/scatters. However, I'm not sure about this - please correct me
> if I'm wrong.
You can use "zmm3+riz" to force zmm as base register:
[hjl@gnu-6 tmp]$ cat sib.s
.text
.allow_index_reg
vgatherqpd (%zmm2),%zmm6{%k1}
.intel_syntax noprefix
vgatherqpd zmm6{k1}, ZMMWORD PTR [zmm3+riz]
vgatherqpd zmm6{k1}, ZMMWORD PTR [zmm3+rax]
[hjl@gnu-6 tmp]$ gcc -c sib.s
sib.s: Assembler messages:
sib.s:3: Error: `(%zmm2)' is not a valid base/index expression
sib.s:5: Error: `ZMMWORD PTR [zmm3+riz]' is not a valid base/index expression
[hjl@gnu-6 tmp]$
--
H.J.