[cfe-commits] r156630 - in /cfe/trunk: include/clang/Basic/BuiltinsHexagon.def lib/CodeGen/CGBuiltin.cpp

Sirish Pande spande at codeaurora.org
Mon May 21 14:12:18 PDT 2012


Thanks Bob. 

I will look into this.

Sirish

-----Original Message-----
From: Bob Wilson [mailto:bob.wilson at apple.com] 
Sent: Tuesday, May 15, 2012 6:41 PM
To: John McCall
Cc: Sirish Pande; Jordy Rose; cfe-commits at cs.uiuc.edu cfe
Subject: Re: [cfe-commits] r156630 - in /cfe/trunk:
include/clang/Basic/BuiltinsHexagon.def lib/CodeGen/CGBuiltin.cpp


On May 11, 2012, at 11:13 PM, John McCall <rjmccall at apple.com> wrote:

> On May 11, 2012, at 8:57 PM, Sirish Pande wrote:
>> I would love to have a macro-generated switch statement - but that 
>> would require a target dependent file - which I don't think clang 
>> folks would like in lib/CodeGen. Since most of the architectures are 
>> doing the same thing, I adopted the style. But it's a pain for me as 
>> well. The whole switch block is auto-generated by my other script, 
>> and I have to copy/paste. So yes, I would love to have macro 
>> generated switch case. Clang folks, can I have a target dependent file
there?
> 
> I have nothing against macro metaprogramming and would much prefer a 
> macro-generated switch over this enormous blob of code.
> 
> Bob, you had some experience doing this with the Neon intrinsics;  is 
> there reusable infrastructure there, or at least useful lessons that
apply?

This should really be handled with TableGen, especially because the Hexagon
builtins look simpler than Neon, at least in the sense that they appear to
be mapped one-to-one to LLVM intrinsics without a lot of special cases.

It might need a custom TableGen backend, but it should be a very simple one.
Look at the include/clang/Basic/arm_neon.td file and
utils/TableGen/NeonEmitter.* files.  You can see some examples of how the
results are used in lib/Sema/SemaChecking.cpp -- look for the includes of
clang/Basic/arm_neon.inc.






More information about the cfe-commits mailing list