‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Friday, August 7, 2020 4:59 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Fri, Aug 07, 2020 at 08:35:52PM +0000, Bert Tenjy via Gcc-patches wrote: > > > The document describing POWER Architecture Vector Function interface is > > tentatively at: > > https://sourceware.org/glibc/wiki/Homepage?action=AttachFile&do=view&target=powerarchvectfuncabi.html > > Doesn't exist. I can't tell what the issue is with the link as given above. But the one below does actually open the page for me. https://sourceware.org/glibc/wiki/HomePage?action=AttachFile&do=view&target=powerarchvectfuncabi.html > > > - if (TARGET_VSX) > > - { > > - clonei->vecsize_mangle = 'b'; > > > > > > - ret = 1; > > > > > > - } > > - clonei->mask_mode = VOIDmode; > > - switch (clonei->vecsize_mangle) > > - { > > - case 'b': > > - clonei->vecsize_int = 128; > > > > > > - clonei->vecsize_float = 128; > > > > > > - break; > > > > > > - case 'c': > > - clonei->vecsize_int = 128; > > > > > > - clonei->vecsize_float = 128; > > > > > > So what is this 'c' case here for? > I should have removed it. It will be deleted in the next version. > > - break; > > > > > > - default: > > - gcc_unreachable (); > > > > > > If (!TARGET_VSX), this will abort (as you only set vecsize_mangle to 'b' > if TARGET_VSX, otherwise nothing sets it (so it remains 0). > > The way this works is that the caller calls the target hook with 0 > as last argument, and the hook either returns 0 (means not supported at > all), or returns number of supported variants and provides the first one. > If more than one are supported, the caller will keep iterating on those. > E.g. on x86, we support 4 modes (b, c, d, e) for exported functions and > for non-exported ones just choose a single one based on the ISA, because in > that case it is not a matter of ABI. > > For PowerPC, if all you want to support is b which requires VSX, then the > right thing is for !TREE_PUBLIC functions return 0 if !TARGET_VSX and > otherwise set vecsize_mangle to 'b' and in the end return 1, for exported > functions always set it to 'b' (and in the end return 1). > Then ensure that the 'b' variants of function definitions get target ("vsx") > attribute added if !TARGET_VSX. > So setting attribute "vsx" for 'b' variants of function definitions is what should go in function rs6000_simd_clone_usable? Bert.