mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 10:15:41 +00:00
726ac89b07
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.
48 lines
1.1 KiB
Makefile
48 lines
1.1 KiB
Makefile
DEPTH = ../..
|
|
topsrcdir = @top_srcdir@
|
|
srcdir = @srcdir@
|
|
VPATH = @srcdir@
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
MODULE = qcms
|
|
LIBRARY_NAME = mozqcms
|
|
LIBXUL_LIBRARY = 1
|
|
GRE_MODULE = 1
|
|
DIST_INSTALL = 1
|
|
|
|
EXPORTS = qcms.h qcmstypes.h
|
|
|
|
CSRCS = iccread.c transform.c
|
|
|
|
ifeq (86,$(findstring 86,$(OS_TEST)))
|
|
CSRCS += transform-sse2.c transform-sse1.c
|
|
ifdef GNU_CC
|
|
SSE1_FLAGS=-msse
|
|
SSE2_FLAGS=-msse2
|
|
else
|
|
SSE1_FLAGS=
|
|
SSE2_FLAGS=
|
|
endif
|
|
endif
|
|
|
|
FORCE_STATIC_LIB = 1
|
|
# This library is used by other shared libs
|
|
FORCE_USE_PIC = 1
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
CFLAGS += -DMOZ_QCMS
|
|
|
|
|
|
# special rules for transform-sse*.c to get the right cflags. (taken from pixman/src/Makefile.in)
|
|
transform-sse1.$(OBJ_SUFFIX): transform-sse1.c Makefile Makefile.in
|
|
$(REPORT_BUILD)
|
|
@$(MAKE_DEPS_AUTO_CC)
|
|
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(SSE1_FLAGS) $(_VPATH_SRCS)
|
|
|
|
transform-sse2.$(OBJ_SUFFIX): transform-sse2.c Makefile Makefile.in
|
|
$(REPORT_BUILD)
|
|
@$(MAKE_DEPS_AUTO_CC)
|
|
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(SSE2_FLAGS) $(_VPATH_SRCS)
|