[cfe-commits] r47850 - /cfe/trunk/Headers/mmintrin.h
Chris Lattner
clattner at apple.com
Tue Mar 4 13:39:35 PST 2008
On Mar 3, 2008, at 7:41 PM, Eli Friedman wrote:
>>> Actually, I just realized an issue with the current implementation:
>>> shouldn't the functions in mmintrin.h actually be static inline?
>>
>> No, that won't work for C99+, as that then prevents these routines
>> from being used in inline functions. :-( For non-c99 languages,
>> yes,
>> I'd argue that static inline is the right choice.
>
> Ah, I forgot... yeah, that sucks. Then I guess we should mark them
> "extern inline __attribute__((weak))"? Just plain inline means that
> we can't in general generate the right thing. Or we could cheat and
> add a "ignore_c99_6_7_4_3_restrictions" attribute.
Wouldn't something like this be fine:
__inline __m64 __attribute__((__always_inline__, __nodebug__))
_mm_cvtsi32_si64 (int __i) { ... }
? Using __inline covers C90, this has both attributes, and isn't
static.
>>> We don't ever want to depend on an external definition.
>>
>> :-) If they are always inline, it wouldn't be much of a
>> problem. :-) As I recall, the docs give us the latitude to reject
>> when someone wants the address of one of them.
>
> Where does that put us here? Should we attach some sort of
> "address_not_allowed" attribute to these functions?
We don't need to enforce this.
-Chris
More information about the cfe-commits
mailing list