Missing vector intrinsic vec_xxpermdi
#4
Closed
opened 5 years ago by everton1984
·
4 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
As we can see here https://gcc.gnu.org/onlinedocs/gcc/PowerPC-AltiVec-Built-in-Functions-Available-on-ISA-2_002e06.html there is an intrinsic vec_xxpermdi which is not present here.
Hi Everton,
There are a lot of intrinsics that are available in GCC that are not
listed in the intrisics guide (or in the ELFv2 ABI Appendix A). These
intrinsics are the ones that are agreed upon as required to be provided
by all compliant compilers, not just GCC.
Thanks,
Bill
On 9/6/19 11:03 AM, Everton Constantino wrote:
Thanks Bill, and the link I sent is the only place where I can find some documentation on that particular intrinsic? I like the way the docs list the asm translations for all intrinsics and the nice descriptions. What's the rule to have one intrinsic listed here then?
Yes, that extremely limited documentation is all there is for
vec_xxpermdi, unfortunately.
Intrinsics to be included are agreed upon between the LTC folks that
support GCC and the Toronto folks that support LLVM and XL/Wyvern. This
particular intrinsic is not included for a couple of reasons. First,
the naming convention doesn't match what we traditionally support (the
"xx" in xxpermdi indicates a VSX-specific instruction, and we don't make
a distinction between VMX and VSX flavors in our naming; we also don't
include size/type information like the "d" in xxpermdi). Second, there
are ways of getting what you want from xxpermdi without using a
built-in. For example, if you have a vector double "vd" and you want to
use xxpermdi to swap it, you can simply write
vector double swapped = (vector double){ vd[1], vd[0] };
and you should get an xxpermdi instruction out of the compiler. (I
haven't tested this lately, but it ought to work. :-) If you want to
use xxpermdi to splat the first element of "vd", you can use
vector double splatted = vec_splat (vd, 0);
So vec_xxpermdi is both redundant and badly named, and thus isn't
included in the required set of intrinsics. If we did choose to add it
someday, it would need to be renamed to something like vec_permi to meet
our naming standards.
Thanks,
Bill
On 9/10/19 7:08 AM, Everton Constantino wrote:
Awesome, thanks a lot Bill, this definitely helps!