[LLVMdev] Regular Expressions
Chris Lattner
clattner at apple.com
Mon Jun 15 12:35:14 PDT 2009
On Jun 15, 2009, at 11:33 AM, David Greene wrote:
> To reduce redundancy, developers must be able to write generic
> patterns
> like this:
>
> [(set DSTREGCLASS:$dst, // rr, rrr
> (xor (INTSRCTYPE (bitconvert (SRCTYPE SRCREGCLASS:$src1))),
> (INTSRCTYPE (bitconvert (SRCTYPE SRCREGCLASS:$src2)))))],
>
> The substitution then fills in the appropriate types, etc. based
> on which variant (32-bit, 64-bit, AVX, etc.) is being produced.
>
> I suppose you could argue that additional parameters specifying
> the source and dest types could be passed, but why bother when
> it is already encoded in the mnemonic? That would just be
> adding error-prone redundancy.
Why not synthesize the opcode string from the information passed down?
-Chris
More information about the llvm-dev
mailing list