[LLVMdev] TableGen related question for the Hexagon backend

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Aug 20 13:41:42 PDT 2012


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