This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/77399] Poor code generation for vector casts and loads
- From: "amonakov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Aug 2016 10:28:59 +0000
- Subject: [Bug tree-optimization/77399] Poor code generation for vector casts and loads
- Auto-submitted: auto-generated
- References: <bug-77399-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77399
--- Comment #8 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
> The extension is closely modeled after openCL
Hm, that doesn't sound right: gcc had vector types long before OpenCL was even
a thing; I believe it's modeled after Altivec actually: the discrepancy between
C-style casts on scalar and vector types definitely comes from Altivec.
> IIRC openCL uses "intrinsics" for these kind of operations?
Yes, in OpenCL there's no implicit casts for vector types, and one has to use
built-in functions like 'convert_float4'.
Also worth mentioning that Clang provides __builtin_convertvector(arg, type)
for casting.