FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian GCC

 
 
LinkBack Thread Tools
 
Old 01-17-2009, 06:40 PM
"tbm at cyrius dot com"
 
Default pessimizes function without SSE intrinsics

------- Comment #1 from tbm at cyrius dot com 2009-01-17 19:40 -------
Testcase:


#include <stdio.h>
#include <xmmintrin.h>

#ifndef MUL
#define MUL mul
#endif

void mul(float in1[4], float in2[4], float out[4])
{
int i;
for (i = 0; i < 4; i++)
out[i] = in1[i] * in2[i];
}

void mul2(float in1[4], float in2[4], float out[4])
{
__m128 a, b, c;
a = _mm_load_ps(in1);
b = _mm_load_ps(in2);
c = _mm_mul_ps(a, b);
_mm_store_ps(out, c);
}

int main(void)
{
float inp1[] = {
1.2, 3.5, 1.7, 2.8
};
float inp2[] = {
-0.7, 2.6, 3.3, -4.0
};
float outp[4];
MUL(inp1, inp2, outp);
printf("%f %f %f %f
", outp[0], outp[1], outp[2], outp[3]);
return 0;
}


--


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-18-2009, 03:49 PM
"hjl dot tools at gmail dot com"
 
Default pessimizes function without SSE intrinsics

--

hjl dot tools at gmail dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl dot tools at gmail dot
| |com, Joey dot ye at intel
| |dot com, xuepeng dot guo at
| |intel dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-21-2009, 01:40 AM
"Joey dot ye at intel dot com"
 
Default pessimizes function without SSE intrinsics

------- Comment #2 from Joey dot ye at intel dot com 2009-01-21 02:40 -------
Following case isn't vecterized with -O3 on x86_64 either, although arrays are
aligned:
#include <stdio.h>

float __attribute__((aligned(16))) in1[] = {
1.2, 3.5, 1.7, 2.8
};
float __attribute__((aligned(16))) in2[] = {
-0.7, 2.6, 3.3, -4.0
};
float __attribute__((aligned(16))) out[4];
void __attribute__((noinline)) mul()
{
int i;
for (i = 0; i < 4; i++)
out[i] = in1[i] * in2[i];
}

int main(void)
{
mul();
printf("%f %f %f %f
", out[0], out[1], out[2], out[3]);
return 0;
}


--


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-21-2009, 01:44 AM
"pinskia at gcc dot gnu dot org"
 
Default pessimizes function without SSE intrinsics

------- Comment #3 from pinskia at gcc dot gnu dot org 2009-01-21 02:44 -------
>void mul(float in1[4], float in2[4], float out[4])

Those arrays are not known to be aligned ....

The other one I have to look into.


--


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-21-2009, 02:00 AM
"pinskia at gcc dot gnu dot org"
 
Default pessimizes function without SSE intrinsics

------- Comment #4 from pinskia at gcc dot gnu dot org 2009-01-21 03:00 -------
(In reply to comment #2)
That is because the early complete unrolling comes and unrolls the loop so the
autovectorizer does not have a loop to work on anymore. If I increase it to be
16 instead of 4, the loop is vectorizer.

So the original testcase is invalid as two things: aliasing and alignment.
Aliasing because out could overlap with in1/in2, restrict fixes that. And then
the alignment comes into play because there is no way to say the incoming
arguments are 16 byte aligned.


--

pinskia at gcc dot gnu dot org changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 01-21-2009, 02:04 AM
"pinskia at gcc dot gnu dot org"
 
Default pessimizes function without SSE intrinsics

------- Comment #5 from pinskia at gcc dot gnu dot org 2009-01-21 03:04 -------
t.c:11: note: cost model: Adding cost of checks for loop versioning to treat
misalignment.

t.c:11: note: cost model: Adding cost of checks for loop versioning aliasing.


--


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38899

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


--
To UNSUBSCRIBE, email to debian-gcc-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 01:27 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org