[LLVMdev] TableGen related question for the Hexagon backend

Jyotsna Verma
Tue, 21 Aug 2012 04:22:10 -0000

Jakob,

One more question. You had suggested 'ValueCols' as of type
list<list<string> >. Does the TableGen know how to extract it? It
appears to
me that we may have to add support for that.

Thanks,
Jyotsna
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum.


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Jyotsna Verma
Sent: Monday, August 20, 2012 3:59 PM
To: 'Jakob Stoklund Olesen'
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] TableGen related question for the Hexagon backend

You're right. I can have use RowFields for that purpose.

Thanks,
Jyotsna

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum.


-----Original Message-----
From: Jakob Stoklund Olesen [mailto:stoklund at 2pi.dk]
Sent: Monday, August 20, 2012 3:42 PM
To: Jyotsna Verma
Cc: 'Tony Linthicum'; llvmdev at cs.uiuc.edu
Subject: Re: TableGen related question for the Hexagon backend


On Aug 20, 2012, at 1:32 PM, "Jyotsna Verma" <jverma at
codeaurora.org> wrote:

> In the Hexagon backend, a predicated instruction can translate into
> another form called 'predicate new'. So, in our example of
'ADD', we
> can have another transformation like this -
>
> ADD--- ---> ADDtrue  -----> ADDtru_new (predicate new form of true)
>          \-----> ADDfalse -----> ADDfalse_new (predicate new form of
> false)
>
> // Define Predicate New relation
> def getPredNewOpcode : InstrMapping {
>  let FilterClass = "PredNewRel";
>
>  let RowFields = ["BaseOpcode"];
>
> // ColFields is a list of flags/attributes of the instructions.
>  let ColFields = ["DotNewType", "PredSense"];
>
> // Here 'DotNewType' of the KeyCol is "" and Predsense
can be either
'true'
> or 'false'
>  let KeyCol = ["", "-"];
>
> // Value Column has DotNewType= "new" and predsense same as
KeyCol.
> //  '-' is used to indicate the "PredSense" value to be
same as KeyCol.
>  let ValueCols = ["new", "-"];
> }
>
> def ADDtrue_new {
>  let BaseOpcode = "ADD";
>  let PredSense = "true";
>  let DotNewType = "new";
> }
>
> This allows me to list all the attributes that must remain same
> between the Key column and the related instructions. Let me know what
> you think about this.

I am not sure I understand what you are suggesting. What would your table
look like?

If you have multiple fields that must be identical in a row, you can add
multiple RowFields entries.

/jakob


_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu