Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-26 Thread Emil Velikov
On 21/11/14 09:02, Siavash Eliasi wrote:
 
 On 11/10/2014 04:28 AM, Emil Velikov wrote:
 I'm not sure did you just said that you've checked it, or that's what
 it ought to do ? There is a reason why I'm so picky - this bizarre (as
 one might call it) setup is just the tip of the iceberg when it comes
 to people building mesa themselves. Would be nice to get your patch in
 as long as it does not break stuff :) -Emil
 
 Hello Emil, David Heidelberg kindly tested the patch on his machines and
 it was okay. Please consider pushing the patch upstream if it looks good
 to you guys too.
 
Considering Ian's supporting comment and confirming that it does not
break the unique builds I've added David's r-b and pushed this to master.

Thanks
-Emil


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-21 Thread Siavash Eliasi


On 11/10/2014 04:28 AM, Emil Velikov wrote:
I'm not sure did you just said that you've checked it, or that's what 
it ought to do ? There is a reason why I'm so picky - this bizarre (as 
one might call it) setup is just the tip of the iceberg when it comes 
to people building mesa themselves. Would be nice to get your patch in 
as long as it does not break stuff :) -Emil


Hello Emil, David Heidelberg kindly tested the patch on his machines and 
it was okay. Please consider pushing the patch upstream if it looks good 
to you guys too.


Best regards,
Siavash Eliasi.



On 11/15/2014 08:58 PM, David Heidelberg wrote:

Hello,

I tested it directly on TK-55 laptop, crosscompiled (from my AMD 
A3870 to TK-55) and on my computer (A3870).


Everything worked ok.

Tested-by: David Heidelberg da...@ixit.cz

On 11/10/2014 04:53 AM, Siavash Eliasi wrote:

Hello sir,

I've sent a patch to mesa-dev which removes the runtime checks for 
CPU features which are known to be supported by that target at 
compile time. Just to make sure that this patch won't break your 
machine (Athlon TK-55?) with your usual build flags, can you please 
try this patch and see if that's ok for you?


Patch:
http://patchwork.freedesktop.org/patch/36488/

Related bug:
https://bugs.freedesktop.org/show_bug.cgi?id=71547#c3

Best regards,
Siavash Eliasi.






___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-14 Thread Siavash Eliasi


On 11/10/2014 04:28 AM, Emil Velikov wrote:

On 09/11/14 04:37, Siavash Eliasi wrote:

On 11/08/2014 09:55 PM, Emil Velikov wrote:

[...]

Can you confirm that it does not cause issues with interesting setups
such as https://bugs.freedesktop.org/show_bug.cgi?id=71547

Challenge accepted! What my patch is doing is to check for provided
compile flags (-msse, ...) on compile time (__SSE__, ...) and set
cpu_has_sse macro to 1 which allows any sane compiler to turn this
pieces of code:

I'm not sure did you just said that you've checked it, or that's what it
ought to do ? There is a reason why I'm so picky - this bizarre (as one
might call it) setup is just the tip of the iceberg when it comes to
people building mesa themselves.
Would be nice to get your patch in as long as it does not break stuff :)

-Emil


I tried building with same CFLAGS in that bug report, no build failures; 
ofcourse after applying this patch:

http://patchwork.freedesktop.org/patch/36869/

Best regards,
Siavash Eliasi.


Best regards,
Siavash Eliasi.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-09 Thread Bruno Jimenez
On Sun, 2014-11-09 at 14:24 +1100, Timothy Arceri wrote:
 On Sat, 2014-11-08 at 18:25 +, Emil Velikov wrote:
  On 08/11/14 08:35, Siavash Eliasi wrote:
   This will remove the need for unnecessary runtime checks for CPU features 
   if
   already supported by target CPU, resulting in smaller and less branchy 
   code.
   
  A comment I could not withheld based on your earlier post - We require
  micro-benchmark for this code. It will take me hours to find why mesa is
  so slow now :P
 
 Hehe, you are technically correct, the best kind of correct.
 
   
  Ideally mesa should have an infrastructure/farm that handles regressions
  - be that performance or otherwise. Pretty sure some companies have such
  features but those seem to be hidden behind locked doors :'(
 
 I considered trying to work on a solution for this where anyone could
 volunteer their machine to run such tests and send the results back to a
 central server. But in the end its a pretty big project to get something
 like this working correctly, and making it easy to setup thus
 participate in.
 
 I guess you could leverage something like the oibaf ppa to start with
 rather than pulling down each commit and building. Anyway a much bigger
 project than what I have time for at the moment.

Maybe it isn't needed for every commit. Depending on the architecture
you are testing you would focus on some commits. For example, I have a
radeon with the r600 driver, so I don't need to check all the intel and
nvidia related commits.

Even if it's not feasible for every commit, we may try to do it for
individual series. Or even, we may send some commits with some kind of
'request for test for performance'.

But we would need to have some kind of standarized benchmark/tests for
this, à la piglit.

Just my opinion :)
- Bruno
 
  
  But on a more mature note, currently only cpu_has_xmm
  (_tnl_generate_sse_emit) and cpu_has_sse4_1(vbo_get_minmax_index) are
  actually useful, with the former of questionable amount :P
  
  Can you confirm that it does not cause issues with interesting setups
  such as https://bugs.freedesktop.org/show_bug.cgi?id=71547
  
 
 I think this patch should be find in this case as the solution there was
 to wrap the code with #ifdef __SSE4_1__ which is what makes this patch
 work. 
 
  
  Thanks
  Emil
  
   V2:
   - Removed the SSSE3 related part for the not yet merged patch.
   - Avoiding redefinition of macros.
   ---
src/mesa/x86/common_x86_features.h | 26 ++
1 file changed, 26 insertions(+)
   
   diff --git a/src/mesa/x86/common_x86_features.h 
   b/src/mesa/x86/common_x86_features.h
   index 66f2cf6..65634aa 100644
   --- a/src/mesa/x86/common_x86_features.h
   +++ b/src/mesa/x86/common_x86_features.h
   @@ -59,13 +59,39 @@
#define X86_CPUEXT_3DNOW_EXT (130)
#define X86_CPUEXT_3DNOW (131)

   +#ifdef __MMX__
   +#define cpu_has_mmx  1
   +#else
#define cpu_has_mmx  (_mesa_x86_cpu_features  
   X86_FEATURE_MMX)
   +#endif
   +
#define cpu_has_mmxext   (_mesa_x86_cpu_features  
   X86_FEATURE_MMXEXT)
   +
   +#ifdef __SSE__
   +#define cpu_has_xmm  1
   +#else
#define cpu_has_xmm  (_mesa_x86_cpu_features  
   X86_FEATURE_XMM)
   +#endif
   +
   +#ifdef __SSE2__
   +#define cpu_has_xmm2 1
   +#else
#define cpu_has_xmm2 (_mesa_x86_cpu_features  
   X86_FEATURE_XMM2)
   +#endif
   +
   +#ifdef __3dNOW__
   +#define cpu_has_3dnow1
   +#else
#define cpu_has_3dnow(_mesa_x86_cpu_features  
   X86_FEATURE_3DNOW)
   +#endif
   +
#define cpu_has_3dnowext (_mesa_x86_cpu_features  X86_FEATURE_3DNOWEXT)
   +
   +#ifdef __SSE4_1__
   +#define cpu_has_sse4_1   1
   +#else
#define cpu_has_sse4_1   (_mesa_x86_cpu_features  
   X86_FEATURE_SSE4_1)
   +#endif

#endif

   
  
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-09 Thread Emil Velikov
On 09/11/14 04:37, Siavash Eliasi wrote:
 
 On 11/08/2014 09:55 PM, Emil Velikov wrote:
[...]
 Can you confirm that it does not cause issues with interesting setups
 such as https://bugs.freedesktop.org/show_bug.cgi?id=71547
 
 Challenge accepted! What my patch is doing is to check for provided
 compile flags (-msse, ...) on compile time (__SSE__, ...) and set
 cpu_has_sse macro to 1 which allows any sane compiler to turn this
 pieces of code:

I'm not sure did you just said that you've checked it, or that's what it
ought to do ? There is a reason why I'm so picky - this bizarre (as one
might call it) setup is just the tip of the iceberg when it comes to
people building mesa themselves.
Would be nice to get your patch in as long as it does not break stuff :)

-Emil
 Best regards,
 Siavash Eliasi.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-08 Thread Emil Velikov
On 08/11/14 08:35, Siavash Eliasi wrote:
 This will remove the need for unnecessary runtime checks for CPU features if
 already supported by target CPU, resulting in smaller and less branchy code.
 
A comment I could not withheld based on your earlier post - We require
micro-benchmark for this code. It will take me hours to find why mesa is
so slow now :P

Ideally mesa should have an infrastructure/farm that handles regressions
- be that performance or otherwise. Pretty sure some companies have such
features but those seem to be hidden behind locked doors :'(

But on a more mature note, currently only cpu_has_xmm
(_tnl_generate_sse_emit) and cpu_has_sse4_1(vbo_get_minmax_index) are
actually useful, with the former of questionable amount :P

Can you confirm that it does not cause issues with interesting setups
such as https://bugs.freedesktop.org/show_bug.cgi?id=71547


Thanks
Emil

 V2:
 - Removed the SSSE3 related part for the not yet merged patch.
 - Avoiding redefinition of macros.
 ---
  src/mesa/x86/common_x86_features.h | 26 ++
  1 file changed, 26 insertions(+)
 
 diff --git a/src/mesa/x86/common_x86_features.h 
 b/src/mesa/x86/common_x86_features.h
 index 66f2cf6..65634aa 100644
 --- a/src/mesa/x86/common_x86_features.h
 +++ b/src/mesa/x86/common_x86_features.h
 @@ -59,13 +59,39 @@
  #define X86_CPUEXT_3DNOW_EXT (130)
  #define X86_CPUEXT_3DNOW (131)
  
 +#ifdef __MMX__
 +#define cpu_has_mmx  1
 +#else
  #define cpu_has_mmx  (_mesa_x86_cpu_features  X86_FEATURE_MMX)
 +#endif
 +
  #define cpu_has_mmxext   (_mesa_x86_cpu_features  
 X86_FEATURE_MMXEXT)
 +
 +#ifdef __SSE__
 +#define cpu_has_xmm  1
 +#else
  #define cpu_has_xmm  (_mesa_x86_cpu_features  X86_FEATURE_XMM)
 +#endif
 +
 +#ifdef __SSE2__
 +#define cpu_has_xmm2 1
 +#else
  #define cpu_has_xmm2 (_mesa_x86_cpu_features  X86_FEATURE_XMM2)
 +#endif
 +
 +#ifdef __3dNOW__
 +#define cpu_has_3dnow1
 +#else
  #define cpu_has_3dnow(_mesa_x86_cpu_features  
 X86_FEATURE_3DNOW)
 +#endif
 +
  #define cpu_has_3dnowext (_mesa_x86_cpu_features  X86_FEATURE_3DNOWEXT)
 +
 +#ifdef __SSE4_1__
 +#define cpu_has_sse4_1   1
 +#else
  #define cpu_has_sse4_1   (_mesa_x86_cpu_features  
 X86_FEATURE_SSE4_1)
 +#endif
  
  #endif
  
 

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-08 Thread Timothy Arceri
On Sat, 2014-11-08 at 18:25 +, Emil Velikov wrote:
 On 08/11/14 08:35, Siavash Eliasi wrote:
  This will remove the need for unnecessary runtime checks for CPU features if
  already supported by target CPU, resulting in smaller and less branchy code.
  
 A comment I could not withheld based on your earlier post - We require
 micro-benchmark for this code. It will take me hours to find why mesa is
 so slow now :P

Hehe, you are technically correct, the best kind of correct.

  
 Ideally mesa should have an infrastructure/farm that handles regressions
 - be that performance or otherwise. Pretty sure some companies have such
 features but those seem to be hidden behind locked doors :'(

I considered trying to work on a solution for this where anyone could
volunteer their machine to run such tests and send the results back to a
central server. But in the end its a pretty big project to get something
like this working correctly, and making it easy to setup thus
participate in.

I guess you could leverage something like the oibaf ppa to start with
rather than pulling down each commit and building. Anyway a much bigger
project than what I have time for at the moment.

 
 But on a more mature note, currently only cpu_has_xmm
 (_tnl_generate_sse_emit) and cpu_has_sse4_1(vbo_get_minmax_index) are
 actually useful, with the former of questionable amount :P
 
 Can you confirm that it does not cause issues with interesting setups
 such as https://bugs.freedesktop.org/show_bug.cgi?id=71547
 

I think this patch should be find in this case as the solution there was
to wrap the code with #ifdef __SSE4_1__ which is what makes this patch
work. 

 
 Thanks
 Emil
 
  V2:
  - Removed the SSSE3 related part for the not yet merged patch.
  - Avoiding redefinition of macros.
  ---
   src/mesa/x86/common_x86_features.h | 26 ++
   1 file changed, 26 insertions(+)
  
  diff --git a/src/mesa/x86/common_x86_features.h 
  b/src/mesa/x86/common_x86_features.h
  index 66f2cf6..65634aa 100644
  --- a/src/mesa/x86/common_x86_features.h
  +++ b/src/mesa/x86/common_x86_features.h
  @@ -59,13 +59,39 @@
   #define X86_CPUEXT_3DNOW_EXT   (130)
   #define X86_CPUEXT_3DNOW   (131)
   
  +#ifdef __MMX__
  +#define cpu_has_mmx1
  +#else
   #define cpu_has_mmx(_mesa_x86_cpu_features  
  X86_FEATURE_MMX)
  +#endif
  +
   #define cpu_has_mmxext (_mesa_x86_cpu_features  
  X86_FEATURE_MMXEXT)
  +
  +#ifdef __SSE__
  +#define cpu_has_xmm1
  +#else
   #define cpu_has_xmm(_mesa_x86_cpu_features  
  X86_FEATURE_XMM)
  +#endif
  +
  +#ifdef __SSE2__
  +#define cpu_has_xmm2   1
  +#else
   #define cpu_has_xmm2   (_mesa_x86_cpu_features  
  X86_FEATURE_XMM2)
  +#endif
  +
  +#ifdef __3dNOW__
  +#define cpu_has_3dnow  1
  +#else
   #define cpu_has_3dnow  (_mesa_x86_cpu_features  
  X86_FEATURE_3DNOW)
  +#endif
  +
   #define cpu_has_3dnowext   (_mesa_x86_cpu_features  X86_FEATURE_3DNOWEXT)
  +
  +#ifdef __SSE4_1__
  +#define cpu_has_sse4_1 1
  +#else
   #define cpu_has_sse4_1 (_mesa_x86_cpu_features  
  X86_FEATURE_SSE4_1)
  +#endif
   
   #endif
   
  
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V2] mesa: Permanently enable features supported by target CPU at compile time.

2014-11-08 Thread Siavash Eliasi


On 11/08/2014 09:55 PM, Emil Velikov wrote:

A comment I could not withheld based on your earlier post - We require
micro-benchmark for this code. It will take me hours to find why mesa is
so slow now :P


Which brings the question why didn't you post to that thread/topic in 
first place instead :P



Ideally mesa should have an infrastructure/farm that handles regressions
- be that performance or otherwise. Pretty sure some companies have such
features but those seem to be hidden behind locked doors :'(


Yes, that's unfortunate. But atleast we have Phoronix :)


Can you confirm that it does not cause issues with interesting setups
such as https://bugs.freedesktop.org/show_bug.cgi?id=71547


Challenge accepted! What my patch is doing is to check for provided 
compile flags (-msse, ...) on compile time (__SSE__, ...) and set 
cpu_has_sse macro to 1 which allows any sane compiler to turn this 
pieces of code:


#ifdef USE_SSE
if (cpu_has_sse)
{
/* SSE code path */
}
else
#endif
{
/* C fallback */
}

into this:

/* SSE code path */

by using compile time information by target CPU.

Best regards,
Siavash Eliasi.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev