Makefile.in
author Steve Snyder <swsnyder@snydernet.net>
Thu, 01 Oct 2009 14:19:41 -0400
changeset 33346 8a43f01f1d6478ad072c1f4a41fb633f8a5e3a32
parent 33293 07837dc569c632cc49214aad902a0d7857082f0f
child 33355 8cbc47eee6593699d684026ddb0a670a0154cc81
permissions -rw-r--r--
Bug 512865. qcms: Improve SSE2 performance, add SSE support. r=jrmuizel This patch greatly improves the performance of QCMS transformations on x86 & x86_64 systems. Some notes: 0. On 32-bit x86 systems it does runtime selection between non-SIMD, SSE, and SSE2 code paths. 1. On x86_64 systems the SSE2 code path is always taken. The non-SIMD and SSE code paths are left intact, but contemporary versions of the GCC and MSVC compilers will see that they cannot be reached and optimize them away. 2. The execution of the SSE2 code path is reduced by 67%, relative to the original Intel/Microsoft formatted ASM code. The relative performance is seen on a Pentium4 (Northwood) 2.4GHz CPU with DDR1 RAM. 3. The SSE code path provides a 80% reduction in execution time, relative to the non-SIMD code path. The relative performance is seen on a Pentium3 (Coppermine) 1.26GHz CPU with SDRAM. 4. The code has been split out into separate files so that it can be built with different cflags (-msse, and -msse2) when using gcc. 5. Try to land again, this time with __attribute__((__force_align_arg_pointer__)) to avoid crashes on linux.

#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****

DEPTH		= .
topsrcdir	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

ifndef .PYMAKE
ifeq (,$(MAKE_VERSION))
$(error GNU Make is required)
endif
ifeq (,$(filter-out 3.78 3.79,$(MAKE_VERSION)))
$(error GNU Make 3.80 or higher is required)
endif
endif

include $(DEPTH)/config/autoconf.mk

default::

TIERS += base

#
# tier "base" - basic setup
#
tier_base_dirs = \
	config \
	build \
	probes \
	$(NULL)

ifdef MOZ_MEMORY
tier_base_dirs += memory/jemalloc
endif

ifdef COMPILE_ENVIRONMENT
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
endif

TIERS += testharness

# test harnesses
ifdef ENABLE_TESTS
tier_testharness_dirs += testing/xpcshell
endif

include $(topsrcdir)/config/config.mk

GARBAGE_DIRS += dist _javagen _profile _tests staticlib
DIST_GARBAGE = config.cache config.log config.status config-defs.h \
   dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
   unallmakefiles mozilla-config.h \
   netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
   $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out

default alldep all::
	$(RM) -rf $(DIST)/sdk
	$(RM) -rf $(DIST)/include
	$(RM) -rf $(DIST)/private
	$(RM) -rf $(DIST)/public
	$(RM) -rf $(DIST)/bin/components
	$(RM) -rf _tests

# Build pseudo-external modules first when export is explicitly called
export::
	$(RM) -rf $(DIST)/sdk
	$(MAKE) -C config export
	$(MAKE) tier_nspr

ifdef ENABLE_TESTS
# Additional makefile targets to call automated test suites
include $(topsrcdir)/testing/testsuite-targets.mk
else
# OS X Universal builds will want to call this, so stub it out
package-tests:
endif

include $(topsrcdir)/config/rules.mk

# After we build tier toolkit, go back and build the tools from previous dirs
tier_toolkit::
	$(MAKE) tools_tier_js
	$(MAKE) tools_tier_xpcom
	$(MAKE) tools_tier_necko
	$(MAKE) tools_tier_gecko
	$(MAKE) tools_tier_toolkit

ifeq (netwerk,$(MOZ_BUILD_APP))
tier_necko::
	$(EXIT_ON_ERROR) \
	$(foreach tier,$(TIERS),$(MAKE) tools_tier_$(tier); )
endif

distclean::
	cat unallmakefiles | $(XARGS) rm -f
	rm -f unallmakefiles $(DIST_GARBAGE)

ifeq ($(OS_ARCH),WINNT)
rebase:
ifdef MOZILLA_OFFICIAL
	echo rebasing $(DIST)
	/bin/find $(DIST) -name "*.dll" -a -not -name "msvc*" > rebase.lst
	rebase -b 60000000 -R . -G rebase.lst
	rm rebase.lst
endif
endif # WINNT

ifeq ($(OS_ARCH),WINNT)
# we want to copy PDB files on Windows
MAKE_SYM_STORE_ARGS := -c
ifdef PDBSTR_PATH
MAKE_SYM_STORE_ARGS += -i
endif
ifeq (,$(CYGWIN_WRAPPER))
# this doesn't work with Cygwin Python
MAKE_SYM_STORE_ARGS += --vcs-info
endif
DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms.exe
# PDB files don't get moved to dist, so we need to scan the whole objdir
MAKE_SYM_STORE_PATH := .
endif
ifeq ($(OS_ARCH),Darwin)
# need to pass arch flags for universal builds
ifdef UNIVERSAL_BINARY
MAKE_SYM_STORE_ARGS := -c -a "ppc i386" --vcs-info
MAKE_SYM_STORE_PATH := $(DIST)/universal
else
MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
MAKE_SYM_STORE_PATH := $(DIST)/bin
endif
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
endif
ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
MAKE_SYM_STORE_ARGS := -c --vcs-info
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
MAKE_SYM_STORE_PATH := $(DIST)/bin
endif

SYM_STORE_SOURCE_DIRS := $(topsrcdir)

include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk

ifdef MOZ_SYMBOLS_EXTRA_BUILDID
EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
endif

SYMBOL_INDEX_NAME = \
  $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_ARCH)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt

buildsymbols:
ifdef MOZ_CRASHREPORTER
	echo building symbol store
	$(RM) -rf $(DIST)/crashreporter-symbols
	$(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
	$(NSINSTALL) -D $(DIST)/crashreporter-symbols
	$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
	  $(MAKE_SYM_STORE_ARGS)                                          \
	  $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir))               \
	  $(DUMP_SYMS_BIN)                                                \
	  $(DIST)/crashreporter-symbols                                   \
	  $(MAKE_SYM_STORE_PATH) >                                        \
	  $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
	echo packing symbols
	cd $(DIST)/crashreporter-symbols && \
          zip -r9D ../"$(SYMBOL_ARCHIVE_BASENAME).zip" .
endif # MOZ_CRASHREPORTER

uploadsymbols:
ifdef MOZ_CRASHREPORTER
	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
endif

ifeq ($(OS_ARCH),WINNT)
signnss:
ifdef MOZILLA_OFFICIAL
	echo signing NSS libs
	cd $(DIST)/bin; ./shlibsign.exe -v -i softokn3.dll
	cd $(DIST)/bin; ./shlibsign.exe -v -i freebl3.dll
	cd $(DIST)/bin; ./shlibsign.exe -v -i nssdbm3.dll
endif # MOZILLA_OFFICIAL

deliver: rebase signnss

endif # WINNT

ifneq (,$(wildcard $(DIST)/bin/application.ini))
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)
else
BUILDID = $(shell $(PYTHON) $(srcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
endif

#XXX: this is a hack, since we don't want to clobber for MSVC
# PGO support, but we can't do this test in client.mk
ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
# No point in clobbering if PGO has been explicitly disabled.
ifndef NO_PROFILE_GUIDED_OPTIMIZE
maybe_clobber_profiledbuild: clobber_all
else
maybe_clobber_profiledbuild:
endif
else
maybe_clobber_profiledbuild:
endif

.PHONY: maybe_clobber_profiledbuild