[LLVMdev] TableGen related question for the Hexagon backend
Jyotsna Verma
jverma at codeaurora.org
Mon Aug 20 13:58:52 PDT 2012
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
More information about the llvm-dev
mailing list