public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/55266] vector expansion: 24 movs for 4 adds Date: Sun, 03 Mar 2013 11:58:00 -0000 [thread overview] Message-ID: <bug-55266-4-eIVW7WmMye@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-55266-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55266 --- Comment #4 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2013-03-03 11:58:24 UTC --- I see still problems when calling inline functions. It seems that the code to satisfy the "calling ABI" is generated anyhow. take the example below and compare the code generated for "dotd1" wrt "dotd2" dotd2 has a "storm" of move before the reduction c++ -std=c++11 -Ofast -march=corei7 -S conversions.cc -fabi-version=0 the avx version is better but for dotd4 (actually dotd1 is lelf see like) typedef float __attribute__( ( vector_size( 16 ) ) ) float32x4_t; typedef double __attribute__( ( vector_size( 32 ) ) ) float64x4_t; inline float64x4_t convert(float32x4_t f) { return float64x4_t{f[0],f[1],f[2],f[3]}; } float dotf(float32x4_t x, float32x4_t y) { float ret=0; for (int i=0;i!=4;++i) ret+=x[i]*y[i]; return ret; } inline double dotd(float64x4_t x, float64x4_t y) { double ret=0; for (int i=0;i!=4;++i) ret+=x[i]*y[i]; return ret; } float dotd1(float32x4_t x, float32x4_t y) { float64x4_t dx,dy; for (int i=0;i!=4;++i) { dx[i]=x[i]; dy[i]=y[i]; } double ret=0; for (int i=0;i!=4;++i) ret+=dx[i]*dy[i]; return ret; } float dotd2(float32x4_t x, float32x4_t y) { float64x4_t dx=convert(x); float64x4_t dy=convert(y); return dotd(dx,dy); } float dotd3(float32x4_t x, float32x4_t y) { float64x4_t dx{x[0],x[1],x[2],x[3]}; float64x4_t dy{y[0],y[1],y[2],y[3]}; double ret=0; for (int i=0;i!=4;++i) ret+=dx[i]*dy[i]; return ret; } float dotd4(float32x4_t x, float32x4_t y) { float64x4_t dx,dy; for (int i=0;i!=4;++i) { dx[i]=x[i]; dy[i]=y[i]; } return dotd(dx,dy); }
next prev parent reply other threads:[~2013-03-03 11:58 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-11-10 15:10 [Bug middle-end/55266] New: vector expansion: 36 " glisse at gcc dot gnu.org 2012-11-13 10:23 ` [Bug middle-end/55266] " glisse at gcc dot gnu.org 2012-11-28 10:11 ` glisse at gcc dot gnu.org 2012-12-09 2:08 ` [Bug middle-end/55266] vector expansion: 24 " pinskia at gcc dot gnu.org 2013-03-03 11:58 ` vincenzo.innocente at cern dot ch [this message] 2023-07-21 12:12 ` rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-55266-4-eIVW7WmMye@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).