Jyotsna Verma
2012-Aug-20 20:58 UTC
[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
Jyotsna Verma
2012-Aug-21 04:22 UTC
[LLVMdev] TableGen related question for the Hexagon backend
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 http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Jakob Stoklund Olesen
2012-Aug-21 16:28 UTC
[LLVMdev] TableGen related question for the Hexagon backend
On Aug 20, 2012, at 9:22 PM, Jyotsna Verma <jverma at codeaurora.org> wrote:> 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.You just start from getValueAsListInit() and go from there. /jakob
Seemingly Similar Threads
- [LLVMdev] TableGen related question for the Hexagon backend
- [LLVMdev] TableGen backend support to express relations between instruction
- [LLVMdev] TableGen backend support to express relations between instruction
- [LLVMdev] TableGen related question for the Hexagon backend
- [LLVMdev] TableGen backend support to express relations between instruction