Add intrinsic pragmas to builtin functions#1366
Add intrinsic pragmas to builtin functions#1366yebblies wants to merge 1 commit intodlang:masterfrom
Conversation
There was a problem hiding this comment.
Need a better name than "ind" ?
There was a problem hiding this comment.
These are the dmd backend op names. Do you have any ideas on a good namespacing scheme for builtins? Does it make sense to have some common ones?
Something like digitalmars.* gcc.* llvm.* d.*?
There was a problem hiding this comment.
Having a namespace for them could be a possibility. But I would consider volatileLoad and volatileStore common between all compilers - unlike y2lx or cmpxchg - and so will need a meaningful name.
There was a problem hiding this comment.
Has this been taken to the NG? I might need a few days to think it over, but maybe we should talk it out there.
There was a problem hiding this comment.
Hmm, so dmd.yl2x and d.volatileLoad or something...
With the current PR I have it's possible to do this:
version (GDC)
{
pragma(intrinsic, "gdc.volatileLoad", ...);
}
else version (DMD)
{
pragma(intrinsic, "dmd.volatileLoad", ...);
}There was a problem hiding this comment.
Yep. But we should only deviate when we strictly need to. :-)
There was a problem hiding this comment.
How about d.* for intrinsics available on all compilers (e.g. d.volatileLoad) and dmd.*, gdc.*, ldc.*, etc. for the ones that are not portable across compilers?
Requires: dlang/dmd#4984