[PATCH] x86: Add {load}/{store} tests for apx instructions.
Cui, Lili
lili.cui@intel.com
Mon Jul 1 13:42:53 GMT 2024
> > --- /dev/null
> > +++ b/gas/testsuite/gas/i386/x86-64-pseudos-apx.s
> > @@ -0,0 +1,43 @@
> > +# Check 64bit APX instructions with pseudo prefixes for encoding
> > +
> > +.text
> > +_start:
> > + #APX REX2
> > + .irp m, mov, adc, add, and, cmp, or, sbb, sub, test, xor, xchg
> > + \m %ecx, %r31d
> > + {load} \m %ecx, %r31d
> > + {store} \m %ecx, %r31d
> > + {load} \m (%ecx), %r31d
> > + {store} \m %r31d, (%ecx)
> > + .endr
> > +
> > + movaps (%r31),%xmm2
> > + {load} movaps (%r31),%xmm2
> > + {store} movaps %xmm2, (%r31)
> > +
> > + #APX EVEX promoted from legacy
> > + .irp m, adc, add, and, or, sbb, sub, xor
> > + {evex} \m %ecx, %r31d
> > + {evex} {load} \m %ecx, %r31d
> > + {evex} {store} \m %ecx, %r31d
> > + {evex} {load} \m (%ecx), %r31d
> > + {evex} {store} \m %r31d, (%ecx)
> > + .endr
>
> Like you have it here, imo the other sets would also benefit from having an
> instance with neither {load} nor {store}.
>
Done.
> > + #APX NDD
> > + .irp m, add, or, adc, sbb, and, sub, xor
> > + {load} \m %ecx, %r31d, %eax
> > + {store} \m %ecx, %r31d, %eax
> > + {load} \m %r31,(%r8),%r16
> > + {load} \m (%r8),%r31,%r16
> > + {store} \m %r31,(%r8),%r16
> > + {store} \m (%r8),%r31,%r16
> > + .endr
> > +
> > + #APX NF
> > + .irp m, add, or, and, sub, xor
> > + {nf} {load} \m %ecx, %r31d
> > + {nf} {store} \m %ecx, %r31d
> > + {nf} {load} \m (%r8d), %r31d
> > + {nf} {store} \m %r31d, (%r8d)
> > + .endr
>
> I'm not convinced this last set is particularly useful. If it's being kept, question
> would be why NF and NDD together aren't tested.
>
> Having reached the end of the file: What about CTESTcc and CCMPcc?
>
I met some issues when adding CTESTcc and CCMPcc.
For example, the disassembler for "{load} ccmpbl %edx, %eax" now looks a bit weird.
"ccmpbl {dfv=}.s %edx,%eax"
Thanks,
Lili.
More information about the Binutils
mailing list