[PATCH] R600: Add intrinsics for math helper instructions

Matt Arsenault Matthew.Arsenault at amd.com
Mon Jun 23 10:59:54 PDT 2014


On 06/23/2014 09:04 AM, Tom Stellard wrote:
> On Sun, Jun 22, 2014 at 04:17:16PM -0700, Matt Arsenault wrote:
>> On Jun 17, 2014, at 7:10 AM, Tom Stellard <tom at stellard.net> wrote:
>>
>>> I think we should replace the r600 in the builtin name with amdgpu, this will
>>> prevent some confusion about what hardware is supported on.
>> I found a problem with this. getIntrinsicForGCCBuiltin / Clang uses Triple::getArchTypePrefix(), which is “r600” when looking for the GCCBuiltin. It never finds the ones with AMDGPU as the target prefix, so to support both of these prefixes clang would need to specially handle these to support both __builtin prefixes
> I normally don't care so much about naming, but in this case I would really
> like the builtins to use the amdgpu prefix, because r600 is really confusing.
> What other options do we have.  Could we add an amdgpu triple?  Can we
> change the getArchTypePrefix() function to return "amdgpu"?
The other problem is TargetPrefix also needs to be changed from "AMDGPU" 
to "amdgpu"
I think we could do a combination of these things:

1. Rename the "AMDGPU" target prefixed intrinsics to "amdgpu"
2. Change the triple, and rename all r600 intrinsics to be amdgpu, and 
move them under the amdgpu target prefix
3. Refactor the code in clang handling GCCBuiltin lookups into a 
function, so in the special case R600 intrinsics function can also 
lookup GCCBuiltins with the second prefix




More information about the llvm-commits mailing list