[cfe-commits] r47850 - /cfe/trunk/Headers/mmintrin.h

Chris Lattner clattner at apple.com
Tue Mar 4 13:34:30 PST 2008


On Mar 3, 2008, at 4:43 PM, Eli Friedman wrote:

> On Mon, Mar 3, 2008 at 4:11 PM, Mike Stump <mrs at apple.com> wrote:
>> On Mar 3, 2008, at 11:29 AM, Anders Carlsson wrote:
>>> +inline void _mm_empty()
>>> +{
>>> +    __builtin_ia32_emms();
>>> +}
>>
>> Do we have an always_inline attr yet?  :-)  Also, a nodebug style
>> attribute is useful to avoid having a debugger show us that we are in
>> this file...
>
> A nodebug-style attribute might be useful once clang actually starts
> supporting emitting debug info; why does always_inline matter, though?

We need to support always_inline in clang.  This is an important GCC  
feature, even though I really dislike it.  This is required by some  
code in the linux kernel for example, which won't build properly if  
always_inline isn't respected.  Also, always_inline has to be  
respected at -O0.

However, though the parser should accept it, I don't think it's a high  
priority for the code generator to actually honor it (at least to  
me).  Since the header is being hacked on now, adding the attributes  
makes sense, and we can worry about the codegen side later.

I don't have a strong opinion about nodebug, I guess we should do it  
as well.

> always_inline would probably need to be implemented in an
> end-of-translation-unit hook, and I don't think one exists at the
> moment.  Besides that, though, there's nothing especially difficult
> about it: all that would need to happen is that CodeGen would need to
> loop over all the always_inline functions and inline the callsites.

Right.

> Actually, I just realized an issue with the current implementation:
> shouldn't the functions in mmintrin.h actually be static inline?  We
> don't ever want to depend on an external definition.

Yep.

-Chris



More information about the cfe-commits mailing list