[PATCH] x86: Add {load}/{store} tests for apx instructions.
Cui, Lili
lili.cui@intel.com
Wed Jul 3 02:41:06 GMT 2024
> > On 02.07.2024 12:29, Cui, Lili wrote:
> > >>>>>> Having reached the end of the file: What about CTESTcc and
> CCMPcc?
> > >>>>>>
> > >>>>>
> > >>>
> > >>> When adding swap test cases for CTESTcc, I found that it does not
> > >>> support
> > >> swapping operands, but test, {evex} test and ctest template insns
> > >> all have D, which does not match the SDM/APX spec, I want to remove
> > >> D for them. I'm a bit unsure if there's any particular reason why
> > >> the legacy test
> > added D ?
> > >>
> > >> Did you look at the commit doing so?
> > >>
> > >
> > > Ok, I found the commit this time, but I'm even more confused because
> > > I
> > didn't find the basis for the second test from SDM.
> > >
> > > -test, 0x84, None, 0, W|CheckRegSize|Modrm|No_sSuf, {
> > > Reg8|Reg16|Reg32|Reg64,
> > >
> >
> Reg8|Reg16|Reg32|Reg64|Unspecified|Byte|Word|Dword|Qword|BaseInde
> > x }
> > > -test, 0x84, None, 0, W|CheckRegSize|Modrm|No_sSuf, {
> > > Byte|Word|Dword|Qword|Unspecified|BaseIndex,
> > Reg8|Reg16|Reg32|Reg64 }
> > > +test, 0x84, None, 0, D|W|C|CheckRegSize|Modrm|No_sSuf, {
> > > +Reg8|Reg16|Reg32|Reg64,
> > Reg8|Reg16|Reg32|Reg64|Unspecified|BaseIndex
> > > +}
> >
> > "basis for the second test"? What do you mean? Are you referring to
> > the SDM spelling out only one operand order? That's surely a (very
> > minor) shortcoming there. TEST is commutative, and hence whatever
> > order the programmer likes should be accepted by an assembler.
>
> Yes, I only found "test %ax, (%bx)" and didn't find "test (%bx), %ax" in the
> SDM. And APX spec also doesn’t say " ctest {def=} (%bx), %ax " is supported.
> Anyway, their assemblers are same.
> I will support "ctestb(%rax),%ecx" and "{evex} test(%rax),%ecx" in assembler,
> currently "ctestb(%rax),%ecx" does not work, I need to fix it first.
>
$ cat test.s
test (%edx), %eax
test %eax, (%edx)
$ as --64 test.s -o test.o
$ objdump -dw -Msuffix test.o
0000000000000000 <_start>:
0: 67 85 02 testl %eax,(%edx)
3: 67 85 02 testl %eax,(%edx)
Hi HJ,
Do you remember why we supported "test (%edx), %eax" in the original version? I'm curious about it.
Thanks,
Lili.
More information about the Binutils
mailing list