[LLVMdev] Need Advice on AVX

David Greene dag at cray.com
Tue Nov 24 12:19:59 PST 2009


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




More information about the llvm-dev mailing list