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: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Aug 2016 10:32:53 +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 #9 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 30 Aug 2016, amonakov at gcc dot gnu.org wrote:
> 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.
Sure, but for later enhancements we decided to follow openCL
> > 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.
Ah, might be useful to support as well.
Of course that's all moot if the optimization possibility results
from other optimization.