[LLVMdev] Need Advice on AVX

Chris Lattner
Thu, 26 Nov 2009 20:25:33 -0000

On Nov 24, 2009, at 12:19 PM, David Greene wrote:

> 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?

Please don't use asmprinter modifiers.  I'm trying to remove them as
part of the MCization code.  Please use the SUBREG machine instr and (subreg)
tblgen node as appropriate.

-Chris