[llvm-commits] [llvm] r171140 - /llvm/trunk/lib/TableGen/TGParser.cpp
Craig Topper
craig.topper at gmail.com
Sun Jan 6 17:37:29 PST 2013
Can you tell me how to do what I need to do in X86InstrSSE.td then? See the
example below. Without using #NAME# I get weird "anonymous" things added to
the instruction names.
multiclass PDI_binop_all<bits<8> opc, string OpcodeStr, SDNode Opcode,
ValueType OpVT128, ValueType OpVT256,
OpndItins itins, bit IsCommutable = 0> {
let Predicates = [HasAVX] in
defm V#NAME# : PDI_binop_rm<opc, !strconcat("v", OpcodeStr), Opcode,
OpVT128,
VR128, memopv2i64, i128mem, itins, IsCommutable, 0>,
VEX_4V;
let Constraints = "$src1 = $dst" in
defm #NAME# : PDI_binop_rm<opc, OpcodeStr, Opcode, OpVT128, VR128,
memopv2i64, i128mem, itins, IsCommutable, 1>;
let Predicates = [HasAVX2] in
defm V#NAME#Y : PDI_binop_rm<opc, !strconcat("v", OpcodeStr), Opcode,
OpVT256, VR256, memopv4i64, i256mem, itins,
IsCommutable, 0>, VEX_4V, VEX_L;
}
On Sun, Jan 6, 2013 at 5:10 PM, Sean Silva <silvas at purdue.edu> wrote:
> Ping. I think this ought to be reverted.
>
> -- Sean Silva
>
> On Mon, Dec 31, 2012 at 6:35 AM, Sean Silva <silvas at purdue.edu> wrote:
> > According to a comment in TGParser.cpp:ParseSimpleValue, this behavior
> > is deprecated:
> >
> > Init *TGParser::ParseSimpleValue(Record *CurRec, RecTy *ItemType,
> > IDParseMode Mode) {
> > Init *R = 0;
> > switch (Lex.getCode()) {
> > default: TokError("Unknown token when parsing a value"); break;
> > case tgtok::paste:
> > // This is a leading paste operation. This is deprecated but
> > // still exists in some .td files. Ignore it.
> > Lex.Lex(); // Skip '#'.
> > return ParseSimpleValue(CurRec, ItemType, Mode);
> >
> >
> > From the behavior of this code, it looks like the leading `#` has no
> > effect anyway, and so we shouldn't encourage its use.
> >
> > -- Sean Silva
> >
> > On Wed, Dec 26, 2012 at 11:32 PM, Craig Topper <craig.topper at gmail.com>
> wrote:
> >> Author: ctopper
> >> Date: Thu Dec 27 00:32:52 2012
> >> New Revision: 171140
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=171140&view=rev
> >> Log:
> >> Update tablegen parser to allow defm names to start with #NAME.
> >>
> >> Modified:
> >> llvm/trunk/lib/TableGen/TGParser.cpp
> >>
> >> Modified: llvm/trunk/lib/TableGen/TGParser.cpp
> >> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/TGParser.cpp?rev=171140&r1=171139&r2=171140&view=diff
> >>
> ==============================================================================
> >> --- llvm/trunk/lib/TableGen/TGParser.cpp (original)
> >> +++ llvm/trunk/lib/TableGen/TGParser.cpp Thu Dec 27 00:32:52 2012
> >> @@ -2406,7 +2406,11 @@
> >>
> >> Init *DefmPrefix = 0;
> >>
> >> - if (Lex.Lex() == tgtok::Id) { // eat the defm.
> >> + Lex.Lex(); // eat the defm.
> >> +
> >> + // Note that tgtok::paste is here to allow starting with #NAME.
> >> + if (Lex.getCode() == tgtok::Id ||
> >> + Lex.getCode() == tgtok::paste) {
> >> DefmPrefix = ParseObjectName(CurMultiClass);
> >> }
> >>
> >>
> >>
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at cs.uiuc.edu
> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
--
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130106/df7c434a/attachment.html>
More information about the llvm-commits
mailing list