This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Compile AVX libm functions with -mavx


On 10/02/2012 03:53 PM, H.J. Lu wrote:
Hi,

This patch compiles AVX libm functions with -mavx.  It reduces text size
of libm.so by about 1%:

Before

gnu-tools-1:pts/4[17]> size libm.so
    text	   data	    bss	    dec	    hex	filename
1027977	    876	     72	1028925	  fb33d	libm.so

After:

gnu-tools-1:pts/3[25]> size libm.so
    text	   data	    bss	    dec	    hex	filename
1018017	    876	     72	1018965	  f8c55	libm.so

Tested on AVX machine. OK for trunk?

textsize is a good metric but what about performance?




Thanks.

H.J.
---
  sysdeps/x86_64/fpu/multiarch/Makefile | 22 +++++++++++-----------
  2 files changed, 25 insertions(+), 11 deletions(-)
  create mode 100644 ChangeLog.pr14654

2012-10-02 H.J. Lu <hongjiu.lu@intel.com>

	* sysdeps/x86_64/fpu/multiarch/Makefile: Check config-cflags-avx
	instead of config-cflags-sse2avx.
	(CFLAGS-e_atan2-avx.c): Set to -mavx.
	(CFLAGS-e_exp-avx.c): Likewise.
	(CFLAGS-e_log-avx.c): Likewise.
	(CFLAGS-mpa-avx.c): Likewise.
	(CFLAGS-mpexp-avx.c): Likewise.
	(CFLAGS-mplog-avx.c): Likewise.
	(CFLAGS-s_atan-avx.c): Likewise.
	(CFLAGS-s_sin-avx.c): Likewise.
	(CFLAGS-slowexp-avx.c): Likewise.
	(CFLAGS-s_tan-avx.c): Likewise.
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 12b0526..ad09ac4 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -33,21 +33,21 @@ CFLAGS-s_sin-fma4.c = -mfma4
  CFLAGS-s_tan-fma4.c = -mfma4
  endif

-ifeq ($(config-cflags-sse2avx),yes)
+ifeq ($(config-cflags-avx),yes)

I think this is the only usage of config-cflags-sse2avx, so let's remove its definition in this case as well.


  libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \
  			e_atan2-avx s_sin-avx s_tan-avx \
  			mplog-avx mpa-avx slowexp-avx \
  			mpexp-avx

-CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-mpa-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-e_atan2-avx.c = -mavx

You remove the SSE2AVX definition here. Can we now remove it completely from glibc?


+CFLAGS-e_exp-avx.c = -mavx
+CFLAGS-e_log-avx.c = -mavx
+CFLAGS-mpa-avx.c = -mavx
+CFLAGS-mpexp-avx.c = -mavx
+CFLAGS-mplog-avx.c = -mavx
+CFLAGS-s_atan-avx.c = -mavx
+CFLAGS-s_sin-avx.c = -mavx
+CFLAGS-slowexp-avx.c = -mavx
+CFLAGS-s_tan-avx.c = -mavx
  endif
  endif


I'd like to see: * Performance numbers * Cleanup of sse2avx and SSE2AVX variables/macros as additional patch

Andreas
--
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]