[cfe-dev] atomic intrinsics

Sebastian Redl sebastian.redl at getdesigned.at
Wed Oct 6 06:34:53 PDT 2010


On 06.10.2010 02:26, Howard Hinnant wrote:
> On Oct 5, 2010, at 8:16 PM, Eric Christopher wrote:
>    
>> How about something like this:
>>
>> __atomic_load_seq_cst(__obj)
>>
>> that is processed by the front end into the llvm IR intrinsic (unless it has special knowledge) and then either emitted by the backend as a call to that function or inlined as atomic code if the backend knows how to do that.  That way the compiler can make the choice, but we also don't get people using the "intrinsics" in a non-portable way thinking that it's the actual api, and just use the API - and the front end knows what to do.
>>      
> <nod>  Thanks Eric.  I should state right up front that I'm fine with this direction.  But it appears to me to need much more support from the front end (which is why I didn't propose it).  If we go this direction, there are no optional intrinsics for the front end.  The front end has to implement essentially everything specified in<atomic>.
>    
Why isn't automatic fallback in case of an unsupported intrinsic for a 
particular size possible in this case?

Sebastian



More information about the cfe-dev mailing list