[LLVMdev] Need Advice on AVX

David Greene
Tue, 24 Nov 2009 20:19:59 -0000

On Tuesday 24 November 2009 14:12, Anton Korobeynikov
wrote:
> Hello, David
>
> > How does ${dst:subreg32} work?
>
> This is just modifier provided to asmprinting code. Here, it seems, 16
> bit register is passed to asmprinter, but it sees modifier and grabs
> 32-bit superreg.
>
> > Can one do the same for sources?
>
> Yes, this is just modifier for printing, nothing more...
>
> > Is it preferable to use the source modifier or write an EXTRACT_SUBREG
> > pattern explicitly?
>
> It depends what you're want to do. But I guess you need to model
> subreg access properly...

Modeling subregisters isn't hard.  Do you have some guidance as to when
one method is preferable?  I am leaning toward using the modifier since
conceptually, a vector_extract of element zero on a v4i64 makes sense with AVX
(so it is "legal").  You just have to emit the register name as
"xmm" rather
than "ymm."  Why write an additional complicated pattern for this
case?

                                   -Dave