Compare commits

..

No commits in common. "debian-unstable" and "pixman-0.40.0-1" have entirely different histories.

167 changed files with 29400 additions and 10760 deletions

View File

@ -6,6 +6,9 @@ root = true
[*] [*]
tab_width = 8 tab_width = 8
[Makefile.*]
indent_style = tab
[meson.build,meson_options.txt] [meson.build,meson_options.txt]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

View File

@ -1,80 +0,0 @@
# Docker build stage
#
# It builds a multi-arch image for all required architectures. Each image can be
# later easily used with properly configured Docker (which uses binfmt and QEMU
# underneath).
docker:
stage: docker
image: quay.io/buildah/stable
rules:
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event' && $TARGET =~ $ACTIVE_TARGET_PATTERN"
changes:
paths:
- .gitlab-ci.d/01-docker.yml
- .gitlab-ci.d/01-docker/**/*
variables:
DOCKER_TAG: $CI_COMMIT_REF_SLUG
DOCKER_IMAGE_NAME: ${CI_REGISTRY_IMAGE}/pixman:${DOCKER_TAG}
- if: "$CI_PIPELINE_SOURCE == 'schedule' && $TARGET =~ $ACTIVE_TARGET_PATTERN"
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $TARGET =~ $ACTIVE_TARGET_PATTERN"
- if: "$CI_COMMIT_TAG && $TARGET =~ $ACTIVE_TARGET_PATTERN"
variables:
# Use vfs with buildah. Docker offers overlayfs as a default, but Buildah
# cannot stack overlayfs on top of another overlayfs filesystem.
STORAGE_DRIVER: vfs
# Write all image metadata in the docker format, not the standard OCI
# format. Newer versions of docker can handle the OCI format, but older
# versions, like the one shipped with Fedora 30, cannot handle the format.
BUILDAH_FORMAT: docker
BUILDAH_ISOLATION: chroot
CACHE_IMAGE: ${CI_REGISTRY_IMAGE}/cache
CACHE_ARGS: --cache-from ${CACHE_IMAGE} --cache-to ${CACHE_IMAGE}
before_script:
# Login to the target registry.
- echo "${CI_REGISTRY_PASSWORD}" |
buildah login -u "${CI_REGISTRY_USER}" --password-stdin ${CI_REGISTRY}
# Docker Hub login is optional, and can be used to circumvent image pull
# quota for anonymous pulls for base images.
- echo "${DOCKERHUB_PASSWORD}" |
buildah login -u "${DOCKERHUB_USER}" --password-stdin docker.io ||
echo "Failed to login to Docker Hub."
parallel:
matrix:
- TARGET:
- linux-386
- linux-amd64
- linux-arm-v5
- linux-arm-v7
- linux-arm64-v8
- linux-mips
- linux-mips64el
- linux-mipsel
- linux-ppc
- linux-ppc64
- linux-ppc64le
- linux-riscv64
- windows-686
- windows-amd64
- windows-arm64-v8
script:
# Prepare environment.
- ${LOAD_TARGET_ENV}
- FULL_IMAGE_NAME=${DOCKER_IMAGE_NAME}-${TARGET}
# Build and push the image.
- buildah bud
--tag ${FULL_IMAGE_NAME}
--layers ${CACHE_ARGS}
--target ${TARGET}
--platform=${DOCKER_PLATFORM}
--build-arg BASE_IMAGE=${BASE_IMAGE}
--build-arg BASE_IMAGE_TAG=${BASE_IMAGE_TAG}
--build-arg LLVM_VERSION=${LLVM_VERSION}
-f Dockerfile .gitlab-ci.d/01-docker/
- buildah images
- buildah push ${FULL_IMAGE_NAME}

View File

@ -1,150 +0,0 @@
ARG BASE_IMAGE=docker.io/debian
ARG BASE_IMAGE_TAG=bookworm-slim
FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} AS base
LABEL org.opencontainers.image.title="Pixman build environment for platform coverage" \
org.opencontainers.image.authors="Marek Pikuła <m.pikula@partner.samsung.com>"
ARG DEBIAN_FRONTEND=noninteractive
ENV APT_UPDATE="apt-get update" \
APT_INSTALL="apt-get install -y --no-install-recommends" \
APT_CLEANUP="rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*"
ARG GCOVR_VERSION="~=7.2"
ARG MESON_VERSION="~=1.6"
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} \
# Build dependencies.
build-essential \
ninja-build \
pkg-config \
qemu-user \
# pipx dependencies.
python3-argcomplete \
python3-packaging \
python3-pip \
python3-platformdirs \
python3-userpath \
python3-venv \
# gcovr dependencies.
libxml2-dev \
libxslt-dev \
python3-dev \
&& ${APT_CLEANUP} \
# Install pipx using pip to have a more recent version of pipx, which
# supports the `--global` flag.
&& pip install pipx --break-system-packages \
# Install a recent version of meson and gcovr using pipx to have the same
# version across all variants regardless of base.
&& pipx install --global \
gcovr${GCOVR_VERSION} \
meson${MESON_VERSION} \
&& gcovr --version \
&& echo Meson version: \
&& meson --version
FROM base AS llvm-base
# LLVM 16 is the highest available in Bookworm. Preferably, we should use the
# same version for all platforms, but it's not possible at the moment.
ARG LLVM_VERSION=16
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} \
clang-${LLVM_VERSION} \
libclang-rt-${LLVM_VERSION}-dev \
lld-${LLVM_VERSION} \
llvm-${LLVM_VERSION} \
&& ${APT_CLEANUP} \
&& ln -f /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang \
&& ln -f /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld \
&& ln -f /usr/bin/llvm-ar-${LLVM_VERSION} /usr/bin/llvm-ar \
&& ln -f /usr/bin/llvm-strip-${LLVM_VERSION} /usr/bin/llvm-strip
FROM llvm-base AS native-base
ARG LLVM_VERSION=16
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} \
# Runtime library dependencies.
libglib2.0-dev \
libgtk-3-dev \
libpng-dev \
# Install libomp-dev if available (OpenMP support for LLVM). It's done only
# for the native images, as OpenMP support in cross-build environment is
# tricky for LLVM.
&& (${APT_INSTALL} libomp-${LLVM_VERSION}-dev \
|| echo "OpenMP not available on this platform.") \
&& ${APT_CLEANUP}
# The following targets differ in BASE_IMAGE.
FROM native-base AS linux-386
FROM native-base AS linux-amd64
FROM native-base AS linux-arm-v5
FROM native-base AS linux-arm-v7
FROM native-base AS linux-arm64-v8
FROM native-base AS linux-mips64el
FROM native-base AS linux-mipsel
FROM native-base AS linux-ppc64le
FROM native-base AS linux-riscv64
# The following targets should have a common BASE_IMAGE.
FROM llvm-base AS linux-mips
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} gcc-multilib-mips-linux-gnu \
&& ${APT_CLEANUP}
FROM llvm-base AS linux-ppc
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} gcc-multilib-powerpc-linux-gnu \
&& ${APT_CLEANUP}
FROM llvm-base AS linux-ppc64
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} gcc-multilib-powerpc64-linux-gnu \
&& ${APT_CLEANUP}
# We use a common image for Windows i686 and amd64, as it doesn't make sense to
# make them separate in terms of build time and image size. After two runs they
# should use the same cache layers, so in the end it makes the collective image
# size smaller.
FROM base AS windows-base
ARG LLVM_MINGW_RELEASE=20240619
ARG LLVM_MINGW_VARIANT=llvm-mingw-${LLVM_MINGW_RELEASE}-msvcrt-ubuntu-20.04-x86_64
RUN ${APT_UPDATE} \
&& ${APT_INSTALL} wget \
&& ${APT_CLEANUP} \
&& cd /opt \
&& wget https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_RELEASE}/${LLVM_MINGW_VARIANT}.tar.xz \
&& tar -xf ${LLVM_MINGW_VARIANT}.tar.xz \
&& rm -f ${LLVM_MINGW_VARIANT}.tar.xz
ENV PATH=${PATH}:/opt/${LLVM_MINGW_VARIANT}/bin
FROM windows-base AS windows-x86-base
RUN dpkg --add-architecture i386 \
&& ${APT_UPDATE} \
&& ${APT_INSTALL} \
gcc-mingw-w64-i686 \
gcc-mingw-w64-x86-64 \
mingw-w64-tools \
procps \
wine \
wine32 \
wine64 \
&& ${APT_CLEANUP} \
# Inspired by https://code.videolan.org/videolan/docker-images
&& wine wineboot --init \
&& while pgrep wineserver > /dev/null; do \
echo "waiting ..."; \
sleep 1; \
done \
&& rm -rf /tmp/wine-*
FROM windows-x86-base AS windows-686
FROM windows-x86-base AS windows-amd64
# aarch64 image requires linaro/wine-arm64 as a base.
FROM windows-base AS windows-arm64-v8
RUN wine-arm64 wineboot --init \
&& while pgrep wineserver > /dev/null; do \
echo "waiting ..."; \
sleep 1; \
done \
&& rm -rf /tmp/wine-*

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/386
BASE_IMAGE=docker.io/i386/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/amd64
BASE_IMAGE=docker.io/amd64/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/arm/v5
BASE_IMAGE=docker.io/arm32v5/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/arm/v7
BASE_IMAGE=docker.io/arm32v7/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/arm64/v8
BASE_IMAGE=docker.io/arm64v8/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/amd64
BASE_IMAGE=docker.io/amd64/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/mips64el
BASE_IMAGE=docker.io/mips64le/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/mipsel
BASE_IMAGE=docker.io/serenitycode/debian-debootstrap
BASE_IMAGE_TAG=mipsel-bookworm-slim
LLVM_VERSION=14

View File

@ -1 +0,0 @@
linux-amd64.env

View File

@ -1 +0,0 @@
linux-amd64.env

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/ppc64le
BASE_IMAGE=docker.io/ppc64le/debian
BASE_IMAGE_TAG=bookworm-slim
LLVM_VERSION=16

View File

@ -1,4 +0,0 @@
DOCKER_PLATFORM=linux/riscv64
BASE_IMAGE=docker.io/riscv64/debian
BASE_IMAGE_TAG=sid-slim
LLVM_VERSION=18

View File

@ -1 +0,0 @@
linux-amd64.env

View File

@ -1 +0,0 @@
linux-amd64.env

View File

@ -1,3 +0,0 @@
DOCKER_PLATFORM=linux/amd64
BASE_IMAGE=docker.io/linaro/wine-arm64
BASE_IMAGE_TAG=latest

View File

@ -1,107 +0,0 @@
# Build stage
#
# This stage builds pixman with enabled coverage for all supported
# architectures.
#
# Some targets don't support atomic profile update, so to decrease the number of
# gcov errors, they need to be built without OpenMP (single threaded) by adding
# `-Dopenmp=disabled` Meson argument.
variables:
# Used in test stage as well.
BUILD_DIR: build-${TOOLCHAIN}
# Applicable to all build targets.
include:
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-386
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-amd64
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-arm-v5
qemu_cpu: arm1136
# Disable coverage, as the tests take too long to run with a single thread.
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-arm-v7
qemu_cpu: max
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-arm64-v8
qemu_cpu: max
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mips
toolchain: [gnu]
qemu_cpu: 74Kf
enable_gnu_coverage: false
# TODO: Merge with the one above once the following issue is resolved:
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/105).
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mips
toolchain: [llvm]
qemu_cpu: 74Kf
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mips64el
qemu_cpu: Loongson-3A4000
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mipsel
toolchain: [gnu]
qemu_cpu: 74Kf
# Disable coverage, as the tests take too long to run with a single thread.
enable_gnu_coverage: false
# TODO: Merge with the one above once the following issue is resolved:
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/105).
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-mipsel
toolchain: [llvm]
qemu_cpu: 74Kf
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-ppc
qemu_cpu: g4
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-ppc64
qemu_cpu: ppc64
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-ppc64le
qemu_cpu: power10
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: linux-riscv64
qemu_cpu: rv64
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: windows-686
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: windows-amd64
enable_gnu_coverage: false
- local: .gitlab-ci.d/templates/build.yml
inputs:
target: windows-arm64-v8
toolchain: [llvm] # GNU toolchain doesn't seem to support Windows on ARM.
qemu_cpu: max
enable_gnu_coverage: false

View File

@ -1,175 +0,0 @@
# Test stage
#
# This stage executes the test suite for pixman for all architectures in
# different configurations. Build and test is split, as some architectures can
# have different QEMU configuration or have multiple supported pixman backends,
# which are executed as job matrix.
#
# Mind that `PIXMAN_ENABLE` variable in matrix runs does nothing, but it looks
# better in CI to indicate what is actually being tested.
#
# Some emulated targets are really slow or cannot be run in multithreaded mode
# (mipsel, arm-v5). Thus coverage reporting is disabled for them.
variables:
# Used in summary stage as well.
COVERAGE_BASE_DIR: coverage
COVERAGE_OUT: ${COVERAGE_BASE_DIR}/${CI_JOB_ID}
TEST_NAME: "" # Allow to specify a set of tests to run with run variables.
include:
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-386
toolchain: [gnu]
pixman_disable:
- "sse2 ssse3" # Testing "mmx"
- "mmx ssse3" # Testing "sse2"
- "mmx sse2" # Testing "ssse3"
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/106
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-386
toolchain: [llvm]
pixman_disable:
# Same as above.
- "sse2 ssse3"
- "mmx ssse3"
- "mmx sse2"
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-amd64
pixman_disable:
- ""
- "fast"
- "wholeops"
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm-v5
toolchain: [gnu]
qemu_cpu: [arm1136]
pixman_disable: ["arm-neon"] # Test only arm-simd.
timeout: 3h
test_timeout_multiplier: 40
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/107
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm-v5
toolchain: [llvm]
qemu_cpu: [arm1136]
pixman_disable: ["arm-neon"] # Test only arm-simd.
timeout: 3h
test_timeout_multiplier: 40
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm-v7
qemu_cpu: [max]
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-arm64-v8
qemu_cpu: [max]
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mips
toolchain: [gnu] # TODO: Add llvm once the build is fixed.
qemu_cpu: [74Kf]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true # Some tests seem to fail.
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mips64el
toolchain: [gnu]
qemu_cpu: [Loongson-3A4000]
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/108
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mips64el
toolchain: [llvm]
qemu_cpu: [Loongson-3A4000]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-mipsel
toolchain: [gnu] # TODO: Add llvm once the build is fixed.
qemu_cpu: [74Kf]
timeout: 2h
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc
qemu_cpu: [g4]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true # SIGILL for some tests
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc64
qemu_cpu: [ppc64]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true # SIGSEGV for some tests
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc64le
toolchain: [gnu]
qemu_cpu: [power10]
# TODO: Merge up after resolving
# https://gitlab.freedesktop.org/pixman/pixman/-/issues/109
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-ppc64le
toolchain: [llvm]
qemu_cpu: [power10]
job_name_prefix: "."
job_name_suffix: ":failing"
allow_failure: true
retry: 0
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: linux-riscv64
qemu_cpu:
# Test on target without RVV (verify no autovectorization).
- rv64,v=false
# Test correctness for different VLENs.
- rv64,v=true,vext_spec=v1.0,vlen=128,elen=64
- rv64,v=true,vext_spec=v1.0,vlen=256,elen=64
- rv64,v=true,vext_spec=v1.0,vlen=512,elen=64
- rv64,v=true,vext_spec=v1.0,vlen=1024,elen=64
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: windows-686
pixman_disable:
# The same as for linux-386.
- "sse2 ssse3"
- "mmx ssse3"
- "mmx sse2"
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: windows-amd64
pixman_disable:
# The same as for linux-amd64.
- ""
- "fast"
- "wholeops"
- local: .gitlab-ci.d/templates/test.yml
inputs:
target: windows-arm64-v8
toolchain: [llvm]
qemu_cpu: [max]

View File

@ -1,47 +0,0 @@
# Summary stage
#
# This stage takes coverage reports from test runs for all architectures, and
# merges it into a single report, with GitLab visualization. There is also an
# HTML report generated as a separate artifact.
summary:
extends: .target:all
stage: summary
variables:
TARGET: linux-amd64
COVERAGE_SUMMARY_DIR: ${COVERAGE_BASE_DIR}/summary
needs:
- job: test:linux-386
optional: true
- job: test:linux-amd64
optional: true
- job: test:linux-arm-v7
optional: true
- job: test:linux-arm64-v8
optional: true
- job: test:linux-mips64el
optional: true
- job: test:linux-ppc64le
optional: true
- job: test:linux-riscv64
optional: true
script:
- echo "Input coverage reports:" && ls ${COVERAGE_BASE_DIR}/*.json || (echo "No coverage reports available." && exit)
- |
args=( )
for f in ${COVERAGE_BASE_DIR}/*.json; do
args+=( "-a" "$f" )
done
- mkdir -p ${COVERAGE_SUMMARY_DIR}
- gcovr "${args[@]}"
--cobertura-pretty --cobertura ${COVERAGE_SUMMARY_DIR}/coverage.xml
--html-details ${COVERAGE_SUMMARY_DIR}/coverage.html
--txt --print-summary
coverage: '/^TOTAL.*\s+(\d+\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: ${COVERAGE_SUMMARY_DIR}/coverage.xml
paths:
- ${COVERAGE_SUMMARY_DIR}/

View File

@ -1 +0,0 @@
native-gnu.meson

View File

@ -1 +0,0 @@
native-llvm.meson

View File

@ -1 +0,0 @@
native-gnu.meson

View File

@ -1 +0,0 @@
native-llvm.meson

View File

@ -1 +0,0 @@
native-gnu-noopenmp.meson

View File

@ -1 +0,0 @@
native-llvm-noopenmp.meson

View File

@ -1 +0,0 @@
native-gnu.meson

View File

@ -1 +0,0 @@
native-llvm.meson

View File

@ -1 +0,0 @@
native-gnu.meson

View File

@ -1 +0,0 @@
native-llvm.meson

View File

@ -1,11 +0,0 @@
[binaries]
c = ['mips-linux-gnu-gcc', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'mips-linux-gnu-ar'
strip = 'mips-linux-gnu-strip'
exe_wrapper = ['qemu-mips', '-L', '/usr/mips-linux-gnu/']
[host_machine]
system = 'linux'
cpu_family = 'mips32'
cpu = 'mips32'
endian = 'big'

View File

@ -1,14 +0,0 @@
[binaries]
c = ['clang', '-target', 'mips-linux-gnu', '-fPIC', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'llvm-ar'
strip = 'llvm-strip'
exe_wrapper = ['qemu-mips', '-L', '/usr/mips-linux-gnu/']
[built-in options]
c_link_args = ['-target', 'mips-linux-gnu', '-fuse-ld=lld']
[host_machine]
system = 'linux'
cpu_family = 'mips32'
cpu = 'mips32'
endian = 'big'

View File

@ -1,8 +0,0 @@
[binaries]
c = ['gcc', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'ar'
strip = 'strip'
pkg-config = 'pkg-config'
[project options]
mips-dspr2 = 'disabled'

View File

@ -1,8 +0,0 @@
[binaries]
c = ['clang', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'llvm-ar'
strip = 'llvm-strip'
pkg-config = 'pkg-config'
[project options]
mips-dspr2 = 'disabled'

View File

@ -1 +0,0 @@
native-gnu-noopenmp.meson

View File

@ -1 +0,0 @@
native-llvm-noopenmp.meson

View File

@ -1,11 +0,0 @@
[binaries]
c = 'powerpc-linux-gnu-gcc'
ar = 'powerpc-linux-gnu-ar'
strip = 'powerpc-linux-gnu-strip'
exe_wrapper = ['qemu-ppc', '-L', '/usr/powerpc-linux-gnu']
[host_machine]
system = 'linux'
cpu_family = 'ppc'
cpu = 'ppc'
endian = 'big'

View File

@ -1,15 +0,0 @@
[binaries]
c = ['clang', '-target', 'powerpc-linux-gnu']
ar = 'llvm-ar'
strip = 'llvm-strip'
exe_wrapper = ['qemu-ppc', '-L', '/usr/powerpc-linux-gnu/']
[built-in options]
# We cannot use LLD, as it doesn't support big-endian PPC.
c_link_args = ['-target', 'powerpc-linux-gnu']
[host_machine]
system = 'linux'
cpu_family = 'ppc'
cpu = 'ppc'
endian = 'big'

View File

@ -1,11 +0,0 @@
[binaries]
c = 'powerpc64-linux-gnu-gcc'
ar = 'powerpc64-linux-gnu-ar'
strip = 'powerpc64-linux-gnu-strip'
exe_wrapper = ['qemu-ppc64', '-L', '/usr/powerpc64-linux-gnu/']
[host_machine]
system = 'linux'
cpu_family = 'ppc64'
cpu = 'ppc64'
endian = 'big'

View File

@ -1,15 +0,0 @@
[binaries]
c = ['clang', '-target', 'powerpc64-linux-gnu']
ar = 'llvm-ar'
strip = 'llvm-strip'
exe_wrapper = ['qemu-ppc64', '-L', '/usr/powerpc64-linux-gnu/']
[built-in options]
# We cannot use LLD, as it doesn't support big-endian PPC.
c_link_args = ['-target', 'powerpc64-linux-gnu']
[host_machine]
system = 'linux'
cpu_family = 'ppc64'
cpu = 'ppc64'
endian = 'big'

View File

@ -1 +0,0 @@
native-gnu.meson

View File

@ -1 +0,0 @@
native-llvm.meson

View File

@ -1 +0,0 @@
native-gnu.meson

View File

@ -1 +0,0 @@
native-llvm.meson

View File

@ -1,8 +0,0 @@
[binaries]
c = ['gcc', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'ar'
strip = 'strip'
pkg-config = 'pkg-config'
[project options]
openmp = 'disabled'

View File

@ -1,5 +0,0 @@
[binaries]
c = 'gcc'
ar = 'ar'
strip = 'strip'
pkg-config = 'pkg-config'

View File

@ -1,8 +0,0 @@
[binaries]
c = ['clang', '-DCI_HAS_ALL_MIPS_CPU_FEATURES']
ar = 'llvm-ar'
strip = 'llvm-strip'
pkg-config = 'pkg-config'
[project options]
openmp = 'disabled'

View File

@ -1,5 +0,0 @@
[binaries]
c = 'clang'
ar = 'llvm-ar'
strip = 'llvm-strip'
pkg-config = 'pkg-config'

View File

@ -1,18 +0,0 @@
[binaries]
c = 'i686-w64-mingw32-gcc'
ar = 'i686-w64-mingw32-ar'
strip = 'i686-w64-mingw32-strip'
windres = 'i686-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
c_link_args = ['-static-libgcc']
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'
[project options]
openmp = 'disabled'

View File

@ -1,18 +0,0 @@
[binaries]
c = 'i686-w64-mingw32-clang'
ar = 'i686-w64-mingw32-llvm-ar'
strip = 'i686-w64-mingw32-strip'
windres = 'i686-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
c_link_args = ['-static']
[project options]
openmp = 'disabled'
[host_machine]
system = 'windows'
cpu_family = 'x86'
cpu = 'i686'
endian = 'little'

View File

@ -1,15 +0,0 @@
[binaries]
c = 'x86_64-w64-mingw32-gcc'
ar = 'x86_64-w64-mingw32-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
c_link_args = ['-static-libgcc']
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

View File

@ -1,20 +0,0 @@
[binaries]
c = 'x86_64-w64-mingw32-clang'
ar = 'x86_64-w64-mingw32-llvm-ar'
strip = 'x86_64-w64-mingw32-strip'
windres = 'x86_64-w64-mingw32-windres'
exe_wrapper = 'wine'
[built-in options]
# Static linking is a workaround around `libwinpthread-1` not being discovered correctly.
c_link_args = ['-static']
[project options]
# OpenMP is disabled as it is not being discovered correctly during tests.
openmp = 'disabled'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

View File

@ -1,18 +0,0 @@
[binaries]
c = 'aarch64-w64-mingw32-clang'
ar = 'aarch64-w64-mingw32-llvm-ar'
strip = 'aarch64-w64-mingw32-strip'
windres = 'aarch64-w64-mingw32-windres'
exe_wrapper = 'wine-arm64'
[built-in options]
c_link_args = ['-static']
[project options]
openmp = 'disabled'
[host_machine]
system = 'windows'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

View File

@ -1,65 +0,0 @@
# This file contains the set of jobs run by the pixman project:
# https://gitlab.freedesktop.org/pixman/pixman/-/pipelines
stages:
- docker
- build
- test
- summary
variables:
# Make it possible to change RUNNER_TAG from GitLab variables. The default
# `kvm` tag has been tested with FDO infrastructure.
RUNNER_TAG: kvm
# Docker image global configuration.
DOCKER_TAG: latest
DOCKER_IMAGE_NAME: registry.freedesktop.org/pixman/pixman/pixman:${DOCKER_TAG}
# Execute to load a target-specific environment.
LOAD_TARGET_ENV: source .gitlab-ci.d/01-docker/target-env/${TARGET}.env
# Enable/disable specific targets for code and platform coverage targets.
ACTIVE_TARGET_PATTERN: '/linux-386|linux-amd64|linux-arm-v5|linux-arm-v7|linux-arm64-v8|linux-mips|linux-mips64el|linux-mipsel|linux-ppc|linux-ppc64|linux-ppc64le|linux-riscv64|windows-686|windows-amd64|windows-arm64-v8/i'
workflow:
rules:
# Use modified Docker image if building in MR and Docker image is affected
# by the MR.
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
paths:
- .gitlab-ci.d/01-docker.yml
- .gitlab-ci.d/01-docker/**/*
variables:
DOCKER_TAG: $CI_COMMIT_REF_SLUG
DOCKER_IMAGE_NAME: ${CI_REGISTRY_IMAGE}/pixman:${DOCKER_TAG}
# A standard set of GitLab CI triggers (i.e., MR, schedule, default branch,
# and tag).
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
auto_cancel:
on_new_commit: conservative
on_job_failure: all
default:
tags:
- $RUNNER_TAG
# Retry in case the runner is misconfigured for multi-arch builds or some
# random unexpected runner error occurs (it happened during testing).
retry: 1
include:
- local: "/.gitlab-ci.d/templates/targets.yml"
- local: "/.gitlab-ci.d/01-docker.yml"
- local: "/.gitlab-ci.d/02-build.yml"
- local: "/.gitlab-ci.d/03-test.yml"
- local: "/.gitlab-ci.d/04-summary.yml"

View File

@ -1,80 +0,0 @@
spec:
inputs:
target:
description:
Build target in form of "OS-ARCH" pair (e.g., linux-amd64). Mostly the
same as platform string for Docker but with a hyphen instead of slash.
toolchain:
description:
An array of toolchains to test with. Each toolchain should have an
appropriate Meson cross file.
type: array
default: [gnu, llvm]
qemu_cpu:
description:
QEMU_CPU environmental variable used by Docker (which uses QEMU
underneath). It is not used by x86 targets, as they are executed
natively on the host.
default: ""
enable_gnu_coverage:
description:
Enable coverage build flags. It can be later used to compile a coverage
report for all the jobs. Should be enabled only for native build
environments as they have all the optional dependencies, and are the
most reliable and uniform (so disable for cross environments).
type: boolean
default: true
job_name_prefix:
description:
Additional prefix for the job name. Can be used to disable a job with a
"." prefix.
default: ""
job_name_suffix:
description:
Additional suffix for the job name. Can be used to prevent job
duplication for jobs for the same target.
default: ""
allow_failure:
description:
Set the `allow_failure` flag for jobs that are expected to fail.
Remember to set `retry` argument to 0 to prevent unnecessary retries.
type: boolean
default: false
retry:
description:
Set the `retry` flag for a job. Usually used together with
`allow_failure`.
type: number
default: 1
---
"$[[ inputs.job_name_prefix ]]build:$[[ inputs.target ]]$[[ inputs.job_name_suffix ]]":
extends: .target:all
stage: build
allow_failure: $[[ inputs.allow_failure ]]
retry: $[[ inputs.retry ]]
needs:
- job: docker
optional: true
parallel:
matrix:
- TARGET: $[[ inputs.target ]]
variables:
TARGET: $[[ inputs.target ]]
QEMU_CPU: $[[ inputs.qemu_cpu ]]
parallel:
matrix:
- TOOLCHAIN: $[[ inputs.toolchain ]]
script:
- |
if [ "$[[ inputs.enable_gnu_coverage ]]" == "true" ] && [ "${TOOLCHAIN}" == "gnu" ]; then
COV_C_ARGS=-fprofile-update=atomic
COV_MESON_BUILD_ARGS=-Db_coverage=true
fi
- meson setup ${BUILD_DIR}
--cross-file .gitlab-ci.d/meson-cross/${TARGET}-${TOOLCHAIN}.meson
-Dc_args="${COV_C_ARGS}" ${COV_MESON_BUILD_ARGS}
- meson compile -C ${BUILD_DIR}
artifacts:
paths:
- ${BUILD_DIR}/

View File

@ -1,9 +0,0 @@
# General target templates.
.target:all:
image:
name: $DOCKER_IMAGE_NAME-$TARGET
rules:
- if: "$TARGET =~ $ACTIVE_TARGET_PATTERN"
before_script:
- ${LOAD_TARGET_ENV}

View File

@ -1,112 +0,0 @@
spec:
inputs:
target:
description:
Build target in form of "OS-ARCH" pair (e.g., linux-amd64). Mostly the
same as platform string for Docker but with a hyphen instead of slash.
toolchain:
description:
An array of toolchains to test with. Each toolchain should have an
appropriate Meson cross file.
type: array
default: [gnu, llvm]
qemu_cpu:
description:
An array of QEMU_CPU environmental variables used as a job matrix
variable, and in turn by Docker (which uses QEMU underneath). It is not
used by x86 targets, as they are executed natively on the host.
type: array
default: [""]
pixman_disable:
description:
An array of PIXMAN_DISABLE targets used as a job matrix variable.
type: array
default: [""]
timeout:
description:
GitLab job timeout property. May need to be increased for slow
targets.
default: 1h
test_timeout_multiplier:
description:
Test timeout multiplier flag used for Meson test execution. May need to
be increased for slow targets.
type: number
default: 20
meson_testthreads:
description:
Sets MESON_TESTTHREADS environmental variable. For some platforms, the
tests should be executed one by one (without multithreading) to prevent
gcovr errors.
type: number
default: 0
gcovr_flags:
description:
Additional flags passed to gcovr tool.
default: ""
job_name_prefix:
description:
Additional prefix for the job name. Can be used to disable a job with a
"." prefix.
default: ""
job_name_suffix:
description:
Additional suffix for the job name. Can be used to prevent job
duplication for jobs for the same target.
default: ""
allow_failure:
description:
Set the `allow_failure` flag for jobs that are expected to fail.
Remember to set `retry` argument to 0 to prevent unnecessary retries.
type: boolean
default: false
retry:
description:
Set the `retry` flag for a job. Usually used together with
`allow_failure`.
type: number
default: 1
---
"$[[ inputs.job_name_prefix ]]test:$[[ inputs.target ]]$[[ inputs.job_name_suffix ]]":
extends: .target:all
stage: test
allow_failure: $[[ inputs.allow_failure ]]
retry: $[[ inputs.retry ]]
timeout: $[[ inputs.timeout ]]
needs:
- job: docker
optional: true
parallel:
matrix:
- TARGET: $[[ inputs.target ]]
- job: build:$[[ inputs.target ]]
parallel:
matrix:
- TOOLCHAIN: $[[ inputs.toolchain ]]
variables:
TARGET: $[[ inputs.target ]]
TEST_TIMEOUT_MULTIPLIER: $[[ inputs.test_timeout_multiplier ]]
GCOVR_FLAGS: $[[ inputs.gcovr_flags ]]
MESON_ARGS: -t ${TEST_TIMEOUT_MULTIPLIER} --no-rebuild -v ${TEST_NAME}
MESON_TESTTHREADS: $[[ inputs.meson_testthreads ]]
parallel:
matrix:
- TOOLCHAIN: $[[ inputs.toolchain ]]
PIXMAN_DISABLE: $[[ inputs.pixman_disable ]]
QEMU_CPU: $[[ inputs.qemu_cpu ]]
script:
- meson test -C ${BUILD_DIR} ${MESON_ARGS}
after_script:
- mkdir -p ${COVERAGE_OUT}
- gcovr ${GCOVR_FLAGS} -r ./ ${BUILD_DIR} -e ./subprojects
--json ${COVERAGE_OUT}.json
--html-details ${COVERAGE_OUT}/coverage.html
--print-summary || echo "No coverage data available."
artifacts:
paths:
- ${BUILD_DIR}/meson-logs/testlog.txt
- ${COVERAGE_BASE_DIR}/
reports:
junit:
- ${BUILD_DIR}/meson-logs/testlog.junit.xml

View File

@ -1,16 +1,19 @@
# image: fedora:28
# This is the GitLab CI configuration file for the mainstream pixman project:
# https://gitlab.freedesktop.org/pixman/pixman/-/pipelines
#
# !!! DO NOT ADD ANY NEW CONFIGURATION TO THIS FILE !!!
#
# Only documentation or comments is accepted.
#
# To use a different set of jobs than the mainstream project, you need to set
# the location of your custom yml file at "custom CI/CD configuration path", on
# your GitLab CI namespace:
# https://docs.gitlab.com/ee/ci/pipelines/settings.html#custom-cicd-configuration-path
#
include: autotools-build:
- local: '/.gitlab-ci.d/pixman-project.yml' script:
- dnf -y install dnf-plugins-core
- dnf -y groupinstall buildsys-build
- dnf -y builddep pixman
- ./autogen.sh
- make -sj4 check
meson-build:
script:
- dnf -y install dnf-plugins-core
- dnf -y groupinstall buildsys-build
- dnf -y builddep pixman
- dnf -y install ninja-build
- python3 -m pip install meson>=0.47.2
- meson build
- ninja -C build test

25687
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

142
Makefile.am Normal file
View File

@ -0,0 +1,142 @@
SUBDIRS = pixman demos test
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA=pixman-1.pc
$(pkgconfig_DATA): pixman-1.pc.in
snapshot:
distdir="$(distdir)-`date '+%Y%m%d'`"; \
test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git rev-parse HEAD | cut -c 1-6`; \
$(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" dist
GPGKEY=3892336E
USERNAME=$$USER
RELEASE_OR_SNAPSHOT = $$(if test "x$(PIXMAN_VERSION_MINOR)" = "x$$(echo "$(PIXMAN_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi)
RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org
RELEASE_CAIRO_DIR = /srv/cairo.freedesktop.org/www/$(RELEASE_OR_SNAPSHOT)s
RELEASE_CAIRO_URL = https://cairographics.org/$(RELEASE_OR_SNAPSHOT)s
RELEASE_XORG_URL = https://www.x.org/releases/individual/lib
RELEASE_XORG_HOST = $(USERNAME)@xorg.freedesktop.org
RELEASE_XORG_DIR = /srv/xorg.freedesktop.org/archive/individual/lib
RELEASE_ANNOUNCE_LIST = cairo-announce@cairographics.org, xorg-announce@lists.freedesktop.org, pixman@lists.freedesktop.org
EXTRA_DIST = \
Makefile.win32 \
Makefile.win32.common \
meson.build \
meson_options.txt \
neon-test.S \
arm-simd-test.S \
$(NULL)
tar_gz = $(PACKAGE)-$(VERSION).tar.gz
tar_xz = $(PACKAGE)-$(VERSION).tar.xz
sha512_tgz = $(tar_gz).sha512
sha256_tgz = $(tar_gz).sha256
sha512_txz = $(tar_xz).sha512
sha256_txz = $(tar_xz).sha256
gpg_file = $(sha512_tgz).asc
$(sha512_tgz): $(tar_gz)
sha512sum $^ > $@
$(sha256_tgz): $(tar_gz)
sha256sum $^ > $@
$(sha512_txz): $(tar_xz)
sha512sum $^ > $@
$(sha256_txz): $(tar_xz)
sha256sum $^ > $@
$(gpg_file): $(sha512_tgz)
@echo "Please enter your GPG password to sign the checksum."
gpg --armor --sign $^
HASHFILES = $(sha512_tgz) $(sha512_txz) $(sha256_tgz) $(sha256_txz)
release-verify-newer:
@echo -n "Checking that no $(VERSION) release already exists at $(RELEASE_XORG_HOST)..."
@ssh $(RELEASE_XORG_HOST) test ! -e $(RELEASE_XORG_DIR)/$(tar_gz) \
|| (echo "Ouch." && echo "Found: $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)/$(tar_gz)" \
&& echo "Refusing to try to generate a new release of the same name." \
&& false)
@ssh $(RELEASE_CAIRO_HOST) test ! -e $(RELEASE_CAIRO_DIR)/$(tar_gz) \
|| (echo "Ouch." && echo "Found: $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)/$(tar_gz)" \
&& echo "Refusing to try to generate a new release of the same name." \
&& false)
@echo "Good."
release-remove-old:
$(RM) $(tar_gz) $(tar_xz) $(HASHFILES) $(gpg_file)
ensure-prev:
@if [[ "$(PREV)" == "" ]]; then \
echo "" && \
echo "You must set the PREV variable on the make command line to" && \
echo "the last version." && \
echo "" && \
echo "For example:" && \
echo " make PREV=0.7.3" && \
echo "" && \
false; \
fi
release-check: ensure-prev release-verify-newer release-remove-old distcheck
release-tag:
git tag -u $(GPGKEY) -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION)
release-upload: release-check $(tar_gz) $(tar_xz) $(sha512_tgz) $(sha512_txz) $(sha256_tgz) $(gpg_file)
scp $(tar_gz) $(sha512_tgz) $(gpg_file) $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)
scp $(tar_gz) $(tar_xz) $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)
ssh $(RELEASE_CAIRO_HOST) "rm -f $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_gz) $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
RELEASE_TYPE = $$(if test "x$(PIXMAN_VERSION_MINOR)" = "x$$(echo "$(PIXMAN_VERSION_MINOR)/2*2" | bc)" ; then echo "stable release in the" ; else echo "development snapshot leading up to a stable"; fi)
release-publish-message: $(HASHFILES) ensure-prev
@echo "Please follow the instructions in RELEASING to push stuff out and"
@echo "send out the announcement mails. Here is the excerpt you need:"
@echo ""
@echo "Lists: $(RELEASE_ANNOUNCE_LIST)"
@echo "Subject: [ANNOUNCE] $(PACKAGE) release $(VERSION) now available"
@echo "============================== CUT HERE =============================="
@echo "A new $(PACKAGE) release $(VERSION) is now available. This is a $(RELEASE_TYPE)"
@echo ""
@echo "tar.gz:"
@echo " $(RELEASE_CAIRO_URL)/$(tar_gz)"
@echo " $(RELEASE_XORG_URL)/$(tar_gz)"
@echo ""
@echo "tar.xz:"
@echo " $(RELEASE_XORG_URL)/$(tar_xz)"
@echo ""
@echo "Hashes:"
@echo -n " SHA256: "
@cat $(sha256_tgz)
@echo -n " SHA256: "
@cat $(sha256_txz)
@echo -n " SHA512: "
@cat $(sha512_tgz)
@echo -n " SHA512: "
@cat $(sha512_txz)
@echo ""
@echo "GPG signature:"
@echo " $(RELEASE_CAIRO_URL)/$(gpg_file)"
@echo " (signed by`gpg --list-keys $(GPGKEY) | grep uid | cut -b4- | tr -s " "`)"
@echo ""
@echo "Git:"
@echo " https://gitlab.freedesktop.org/pixman/pixman.git"
@echo " tag: $(PACKAGE)-$(VERSION)"
@echo ""
@echo "Log:"
@git log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b1-80
@echo "============================== CUT HERE =============================="
@echo ""
release-publish: release-upload release-tag release-publish-message
.PHONY: release-upload release-publish release-publish-message release-tag

25
Makefile.win32 Normal file
View File

@ -0,0 +1,25 @@
default: all
top_srcdir = .
include $(top_srcdir)/Makefile.win32.common
all: pixman test
pixman:
@$(MAKE) -C pixman -f Makefile.win32
test:
@$(MAKE) -C test -f Makefile.win32
clean_r:
@$(MAKE) -C pixman -f Makefile.win32 clean
@$(MAKE) -C test -f Makefile.win32 clean
check:
@$(MAKE) -C test -f Makefile.win32 check
clean: clean_r
.PHONY: all pixman test clean check

73
Makefile.win32.common Normal file
View File

@ -0,0 +1,73 @@
LIBRARY = pixman-1
ifeq ($(shell echo ""),)
# POSIX style shell
mkdir_p = mkdir -p $1
rm = $(RM) $1
echo = echo "$1"
else
# DOS/Windows style shell
mkdir_p = if not exist $(subst /,\,$1) md $(subst /,\,$1)
echo = echo $1
rm = del $(subst /,\,$1)
endif
CC = cl
LD = link
AR = lib
PERL = perl
ifneq ($(shell echo ""),)
RM = del
endif
ifeq ($(top_builddir),)
top_builddir = $(top_srcdir)
endif
CFG_VAR = $(CFG)
ifeq ($(CFG_VAR),)
CFG_VAR = release
endif
ifeq ($(CFG_VAR),debug)
CFG_CFLAGS = -MDd -Od -Zi
CFG_LDFLAGS = -DEBUG
else
CFG_CFLAGS = -MD -O2
CFG_LDFLAGS =
endif
# Package definitions, to be used instead of those provided in config.h
PKG_CFLAGS = -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
BASE_CFLAGS = -nologo -I. -I$(top_srcdir) -I$(top_srcdir)/pixman
PIXMAN_CFLAGS = $(BASE_CFLAGS) $(PKG_CFLAGS) $(CFG_CFLAGS) $(CFLAGS)
PIXMAN_LDFLAGS = -nologo $(CFG_LDFLAGS) $(LDFLAGS)
PIXMAN_ARFLAGS = -nologo $(LDFLAGS)
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
ifneq ($(CFG),)
@echo "Invalid specified configuration option: "$(CFG)"."
@echo
@echo "Possible choices for configuration are 'release' and 'debug'"
@exit 1
endif
@echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
endif
endif
$(CFG_VAR):
@$(call mkdir_p,$@)
$(CFG_VAR)/%.obj: %.c $(libpixman_headers) | $(CFG_VAR)
$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
clean: inform $(CFG_VAR)
-$(call rm,$(CFG_VAR)/*.exe $(CFG_VAR)/*.ilk $(CFG_VAR)/*.lib $(CFG_VAR)/*.obj $(CFG_VAR)/*.pdb)
.PHONY: inform clean

80
README
View File

@ -1,20 +1,14 @@
Pixman
======
Pixman is a library that provides low-level pixel manipulation Pixman is a library that provides low-level pixel manipulation
features such as image compositing and trapezoid rasterization. features such as image compositing and trapezoid rasterization.
Questions should be directed to the pixman mailing list: Questions, bug reports and patches should be directed to the pixman
mailing list:
https://lists.freedesktop.org/mailman/listinfo/pixman http://lists.freedesktop.org/mailman/listinfo/pixman
You can also file bugs at You can also file bugs at
https://gitlab.freedesktop.org/pixman/pixman/-/issues/new https://bugs.freedesktop.org/enter_bug.cgi?product=pixman
or submit improvements in form of a Merge Request via
https://gitlab.freedesktop.org/pixman/pixman/-/merge_requests
For real time discussions about pixman, feel free to join the IRC For real time discussions about pixman, feel free to join the IRC
channels #cairo and #xorg-devel on the FreeNode IRC network. channels #cairo and #xorg-devel on the FreeNode IRC network.
@ -27,66 +21,54 @@ In order to contribute to pixman, you will need a working knowledge of
the git version control system. For a quick getting started guide, the git version control system. For a quick getting started guide,
there is the "Everyday Git With 20 Commands Or So guide" there is the "Everyday Git With 20 Commands Or So guide"
https://www.kernel.org/pub/software/scm/git/docs/everyday.html http://www.kernel.org/pub/software/scm/git/docs/everyday.html
from the Git homepage. For more in depth git documentation, see the from the Git homepage. For more in depth git documentation, see the
resources on the Git community documentation page: resources on the Git community documentation page:
https://git-scm.com/documentation http://git-scm.com/documentation
Pixman uses the infrastructure from the freedesktop.org umbrella Pixman uses the infrastructure from the freedesktop.org umbrella
project. For instructions about how to use the git service on project. For instructions about how to use the git service on
freedesktop.org, see: freedesktop.org, see:
https://www.freedesktop.org/wiki/Infrastructure/git/Developers http://www.freedesktop.org/wiki/Infrastructure/git/Developers
The Pixman master repository can be found at: The Pixman master repository can be found at:
https://gitlab.freedesktop.org/pixman/pixman git://anongit.freedesktop.org/git/pixman
and browsed on the web here:
http://cgit.freedesktop.org/pixman/
Sending patches Sending patches
--------------- ---------------
Patches should be submitted in form of Merge Requests via Gitlab. The general workflow for sending patches is to first make sure that
git can send mail on your system. Then,
You will first need to create a fork of the main pixman repository at - create a branch off of master in your local git repository
https://gitlab.freedesktop.org/pixman/pixman - make your changes as one or more commits
via the Fork button on the top right. Once that is done you can add your - use the
personal repository as a remote to your local pixman development git checkout:
git remote add my-gitlab git@gitlab.freedesktop.org:YOURUSERNAME/pixman.git git send-email
git fetch my-gitlab command to send the patch series to pixman@lists.freedesktop.org.
Make sure to have added ssh keys to your gitlab profile at
https://gitlab.freedesktop.org/profile/keys
Once that is set up, the general workflow for sending patches is to create a
new local branch with your improvements and once it's ready push it to your
personal pixman fork:
git checkout -b fix-some-bug
...
git push my-gitlab
The output of the `git push` command will include a link that allows you to
create a Merge Request against the official pixman repository.
Whenever you make changes to your branch (add new commits or fix up commits)
you push them back to your personal pixman fork:
git push -f my-gitlab
If there is an open Merge Request Gitlab will automatically pick up the
changes from your branch and pixman developers can review them anew.
In order for your patches to be accepted, please consider the In order for your patches to be accepted, please consider the
following guidelines: following guidelines:
- This link:
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#patch-series
describes how what a good patch series is, and to create one with
git.
- At each point in the series, pixman should compile and the test - At each point in the series, pixman should compile and the test
suite should pass. suite should pass.
@ -97,7 +79,7 @@ following guidelines:
You can run the test suite with You can run the test suite with
meson test -C builddir make check
It will take around two minutes to run on a modern PC. It will take around two minutes to run on a modern PC.
@ -119,7 +101,7 @@ following guidelines:
- If review comments were incorporated, a brief version - If review comments were incorporated, a brief version
history describing what those changes were. history describing what those changes were.
- For big patch series, write an introductory post with an overall - For big patch series, send an introductory email with an overall
description of the patch series, including benchmarks and description of the patch series, including benchmarks and
motivation. Each commit message should still be descriptive and motivation. Each commit message should still be descriptive and
include enough information to understand why this particular commit include enough information to understand why this particular commit
@ -129,6 +111,6 @@ Pixman has high standards for code quality and so almost everybody
should expect to have the first versions of their patches rejected. should expect to have the first versions of their patches rejected.
If you think that the reviewers are wrong about something, or that the If you think that the reviewers are wrong about something, or that the
guidelines above are wrong, feel free to discuss the issue. The purpose guidelines above are wrong, feel free to discuss the issue on the
of the guidelines and code review is to ensure high code quality; it is list. The purpose of the guidelines and code review is to ensure high
not an exercise in compliance. code quality; it is not an exercise in compliance.

View File

@ -10,11 +10,12 @@ Here are the steps to follow to create a new pixman release:
git log master...origin (no output; note: *3* dots) git log master...origin (no output; note: *3* dots)
2) Increment the version in meson.build. 2) Increment pixman_(major|minor|micro) in configure.ac and meson.build
according to the directions in those files.
3) Make sure that new version works, including 3) Make sure that new version works, including
- meson test passes - make distcheck passes
- the X server still works with the new pixman version - the X server still works with the new pixman version
installed installed

View File

@ -1,5 +0,0 @@
.text
.arch armv8-a
.altmacro
prfm pldl2strm, [x0]
xtn v0.8b, v0.8h

14
autogen.sh Executable file
View File

@ -0,0 +1,14 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
if test -z "$NOCONFIGURE"; then
$srcdir/configure "$@"
fi

1161
configure.ac Normal file

File diff suppressed because it is too large Load Diff

6
contrib/ci.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
set -ex
./autogen.sh
make -sj4 check

47
debian/changelog vendored
View File

@ -1,50 +1,3 @@
pixman (0.44.0-4) UNRELEASED; urgency=medium
* Team upload.
* debian/copyright: Convert to machine-readable format
-- Dylan Aïssi <daissi@debian.org> Thu, 31 Jul 2025 22:16:23 +0200
pixman (0.44.0-3) unstable; urgency=medium
* Replace timeout bump patch by using a multiplier option instead.
Thanks, Aurelien Jarno! (Closes: #1086999)
-- Timo Aaltonen <tjaalton@debian.org> Sat, 09 Nov 2024 11:02:55 +0200
pixman (0.44.0-2) unstable; urgency=medium
* patches: Increase test timeout 120->240s. (Closes: #1086999)
-- Timo Aaltonen <tjaalton@debian.org> Fri, 08 Nov 2024 09:58:04 +0200
pixman (0.44.0-1) unstable; urgency=medium
* New upstream release.
* patches: Refresh patch.
* control, rules: Build with meson.
* symbols: Updated.
* control: Migrate to pkgconf.
* rules: Drop obsolete dbgsym-migration.
-- Timo Aaltonen <tjaalton@debian.org> Thu, 07 Nov 2024 16:48:29 +0200
pixman (0.42.2-1) unstable; urgency=medium
* New upstream release.
* d/p/Avoid-integer-overflow-leading-to-out-of-bounds-writ.diff:
- Removed, fixed upstream.
-- Emilio Pozuelo Monfort <pochu@debian.org> Fri, 11 Nov 2022 13:42:25 +0100
pixman (0.40.0-1.1) unstable; urgency=medium
* Non-maintainer upload.
* Avoid integer overflow leading to out-of-bounds write (CVE-2022-44638)
(Closes: #1023427)
-- Salvatore Bonaccorso <carnil@debian.org> Thu, 03 Nov 2022 23:07:46 +0100
pixman (0.40.0-1) unstable; urgency=medium pixman (0.40.0-1) unstable; urgency=medium
* New upstream release. (Closes: #958298, #832579, #838650) * New upstream release. (Closes: #958298, #832579, #838650)

3
debian/control vendored
View File

@ -5,8 +5,7 @@ Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Uploaders: Andreas Boll <aboll@debian.org> Uploaders: Andreas Boll <aboll@debian.org>
Build-Depends: Build-Depends:
debhelper-compat (= 13), debhelper-compat (= 13),
meson, pkg-config,
pkgconf,
quilt, quilt,
Standards-Version: 4.2.1 Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/xorg-team/lib/pixman.git Vcs-Git: https://salsa.debian.org/xorg-team/lib/pixman.git

89
debian/copyright vendored
View File

@ -1,48 +1,47 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ This package was downloaded from
Upstream-Name: pixman https://xorg.freedesktop.org/releases/individual/lib/
Source: https://gitlab.freedesktop.org/pixman/pixman
License: Expat
Files: * Debian packaging by Julien Cristau <jcristau@debian.org>, 18 May 2007.
Copyright: 1987-1998 The Open Group
1987-1989 Digital Equipment Corporation
1999-2008 Keith Packard
2000 SuSE, Inc.
2000 Keith Packard, member of The XFree86 Project, Inc.
2004-2010 Red Hat, Inc.
2004 Nicholas Miell
2005 Lars Knoll & Zack Rusin, Trolltech
2005 Trolltech AS
2007 Luca Barbato
2008 Aaron Plattner, NVIDIA Corporation
2008 Rodrigo Kumpera
2008 André Tupinambá
2008 Mozilla Corporation
2008 Frederic Plourde
2009, Oracle and/or its affiliates. All rights reserved.
2009-2010 Nokia Corporation
License: Expat
Files: debian/* The following is the MIT license, agreed upon by most contributors.
Copyright: 2007 Julien Cristau <jcristau@debian.org> Copyright holders of new code should use this license statement where
License: Expat possible. They may also add themselves to the list below.
License: Expat /*
Permission is hereby granted, free of charge, to any person obtaining a * Copyright 1987, 1988, 1989, 1998 The Open Group
copy of this software and associated documentation files (the "Software"), * Copyright 1987, 1988, 1989 Digital Equipment Corporation
to deal in the Software without restriction, including without limitation * Copyright 1999, 2004, 2008 Keith Packard
the rights to use, copy, modify, merge, publish, distribute, sublicense, * Copyright 2000 SuSE, Inc.
and/or sell copies of the Software, and to permit persons to whom the * Copyright 2000 Keith Packard, member of The XFree86 Project, Inc.
Software is furnished to do so, subject to the following conditions: * Copyright 2004, 2005, 2007, 2008, 2009, 2010 Red Hat, Inc.
. * Copyright 2004 Nicholas Miell
The above copyright notice and this permission notice (including the next * Copyright 2005 Lars Knoll & Zack Rusin, Trolltech
paragraph) shall be included in all copies or substantial portions of the * Copyright 2005 Trolltech AS
Software. * Copyright 2007 Luca Barbato
. * Copyright 2008 Aaron Plattner, NVIDIA Corporation
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * Copyright 2008 Rodrigo Kumpera
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * Copyright 2008 André Tupinambá
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * Copyright 2008 Mozilla Corporation
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * Copyright 2008 Frederic Plourde
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * Copyright 2009, Oracle and/or its affiliates. All rights reserved.
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * Copyright 2009, 2010 Nokia Corporation
DEALINGS IN THE SOFTWARE. *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

View File

@ -80,7 +80,6 @@ libpixman-1.so.0 libpixman-1-0 #MINVER#
pixman_region32_contains_point@Base 0.11.2 pixman_region32_contains_point@Base 0.11.2
pixman_region32_contains_rectangle@Base 0.11.2 pixman_region32_contains_rectangle@Base 0.11.2
pixman_region32_copy@Base 0.11.2 pixman_region32_copy@Base 0.11.2
pixman_region32_empty@Base 0.44.0
pixman_region32_equal@Base 0.11.2 pixman_region32_equal@Base 0.11.2
pixman_region32_extents@Base 0.11.2 pixman_region32_extents@Base 0.11.2
pixman_region32_fini@Base 0.11.2 pixman_region32_fini@Base 0.11.2
@ -105,7 +104,6 @@ libpixman-1.so.0 libpixman-1-0 #MINVER#
pixman_region_contains_point@Base 0 pixman_region_contains_point@Base 0
pixman_region_contains_rectangle@Base 0 pixman_region_contains_rectangle@Base 0
pixman_region_copy@Base 0 pixman_region_copy@Base 0
pixman_region_empty@Base 0.44.0
pixman_region_equal@Base 0 pixman_region_equal@Base 0
pixman_region_extents@Base 0 pixman_region_extents@Base 0
pixman_region_fini@Base 0 pixman_region_fini@Base 0

View File

@ -1,3 +1,4 @@
usr/lib/*/libpixman-1.so usr/lib/*/libpixman-1.so
usr/lib/*/libpixman-1.a
usr/lib/*/pkgconfig usr/lib/*/pkgconfig
usr/include/pixman-1 usr/include/pixman-1

View File

@ -1,8 +1,10 @@
--- a/test/alpha-loop.c Index: pixman/test/alpha-loop.c
+++ b/test/alpha-loop.c ===================================================================
@@ -22,7 +22,7 @@ main (int argc, char **argv) --- pixman.orig/test/alpha-loop.c 2013-07-26 14:26:43.905457549 +0200
d = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4); +++ pixman/test/alpha-loop.c 2013-08-03 10:21:53.498601016 +0200
s = pixman_image_create_bits (PIXMAN_a2r10g10b10, WIDTH, HEIGHT, src, WIDTH * 4); @@ -21,7 +21,7 @@
pixman_image_t *d = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, dest, WIDTH * 4);
pixman_image_t *s = pixman_image_create_bits (PIXMAN_a2r10g10b10, WIDTH, HEIGHT, src, WIDTH * 4);
- fail_after (5, "Infinite loop detected: 5 seconds without progress\n"); - fail_after (5, "Infinite loop detected: 5 seconds without progress\n");
+ fail_after (50, "Infinite loop detected: 50 seconds without progress\n"); + fail_after (50, "Infinite loop detected: 50 seconds without progress\n");

11
debian/rules vendored
View File

@ -9,8 +9,8 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
override_dh_auto_configure: override_dh_auto_configure:
# also avoid loongson2f optimizations on mipsel, see 0.26.0-3 # also avoid loongson2f optimizations on mipsel, see 0.26.0-3
# changelog entry: # changelog entry:
LS_CFLAGS=" " dh_auto_configure -- \ LS_CFLAGS=" " dh_auto_configure -- --disable-gtk \
-Dgtk=disabled --disable-arm-iwmmxt
# Install in debian/tmp to retain control through dh_install: # Install in debian/tmp to retain control through dh_install:
override_dh_auto_install: override_dh_auto_install:
@ -21,12 +21,17 @@ override_dh_install:
find debian/tmp -name '*.la' -delete find debian/tmp -name '*.la' -delete
dh_install dh_install
# Debug package:
override_dh_strip:
dh_strip -p$(PACKAGE) --dbgsym-migration="$(PACKAGE)-dbg (<< 0.34.0-2~)"
dh_strip -N$(PACKAGE)
# Shlibs: # Shlibs:
override_dh_makeshlibs: override_dh_makeshlibs:
dh_makeshlibs -p$(PACKAGE) --add-udeb $(PACKAGE)-udeb -V"$(PACKAGE) (>= $(SHLIBS))" -- -c4 dh_makeshlibs -p$(PACKAGE) --add-udeb $(PACKAGE)-udeb -V"$(PACKAGE) (>= $(SHLIBS))" -- -c4
override_dh_auto_test: override_dh_auto_test:
dh_auto_test -- --verbose --timeout-multiplier 3 dh_auto_test -- VERBOSE=1
%: %:
dh $@ --with quilt --builddirectory=build/ dh $@ --with quilt --builddirectory=build/

60
demos/Makefile.am Normal file
View File

@ -0,0 +1,60 @@
EXTRA_DIST = \
parrot.c \
parrot.jpg \
scale.ui \
dither.ui \
meson.build \
$(NULL)
if HAVE_GTK
AM_CFLAGS = $(OPENMP_CFLAGS)
AM_LDFLAGS = $(OPENMP_CFLAGS)
LDADD = $(top_builddir)/pixman/libpixman-1.la -lm $(GTK_LIBS) $(PNG_LIBS)
AM_CPPFLAGS = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(GTK_CFLAGS) $(PNG_CFLAGS)
GTK_UTILS = gtk-utils.c gtk-utils.h ../test/utils.c ../test/utils.h \
../test/utils-prng.c ../test/utils-prng.h
DEMOS = \
clip-test \
clip-in \
composite-test \
gradient-test \
radial-test \
linear-gradient \
conical-test \
alpha-test \
screen-test \
convolution-test \
trap-test \
tri-test \
quad2quad \
checkerboard \
srgb-trap-test \
srgb-test \
scale \
dither
gradient_test_SOURCES = gradient-test.c $(GTK_UTILS)
alpha_test_SOURCES = alpha-test.c $(GTK_UTILS)
composite_test_SOURCES = composite-test.c $(GTK_UTILS)
clip_test_SOURCES = clip-test.c $(GTK_UTILS)
clip_in_SOURCES = clip-in.c $(GTK_UTILS)
trap_test_SOURCES = trap-test.c $(GTK_UTILS)
screen_test_SOURCES = screen-test.c $(GTK_UTILS)
convolution_test_SOURCES = convolution-test.c $(GTK_UTILS)
radial_test_SOURCES = radial-test.c $(GTK_UTILS)
linear_gradient_SOURCES = linear-gradient.c $(GTK_UTILS)
conical_test_SOURCES = conical-test.c $(GTK_UTILS)
tri_test_SOURCES = tri-test.c $(GTK_UTILS)
checkerboard_SOURCES = checkerboard.c $(GTK_UTILS)
srgb_test_SOURCES = srgb-test.c $(GTK_UTILS)
srgb_trap_test_SOURCES = srgb-trap-test.c $(GTK_UTILS)
scale_SOURCES = scale.c $(GTK_UTILS)
dither_SOURCES = dither.c $(GTK_UTILS)
noinst_PROGRAMS = $(DEMOS)
endif

View File

@ -1,4 +1,4 @@
#include "utils.h" #include "../test/utils.h"
#include "gtk-utils.h" #include "gtk-utils.h"
#define SIZE 128 #define SIZE 128

View File

@ -23,12 +23,12 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "pixman-config.h" #include "config.h"
#endif #endif
#include <math.h> #include <math.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
#include "utils.h" #include "../test/utils.h"
#include "gtk-utils.h" #include "gtk-utils.h"
#define WIDTH 1024 #define WIDTH 1024
@ -103,46 +103,48 @@ rescale (GtkWidget *may_be_null, app_t *app)
} }
static gboolean static gboolean
on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
{ {
app_t *app = user_data; app_t *app = data;
GdkRectangle area; GdkRectangle *area = &event->expose.area;
cairo_surface_t *surface; cairo_surface_t *surface;
pixman_image_t *tmp, *final; pixman_image_t *tmp, *final;
cairo_t *cr;
uint32_t *pixels; uint32_t *pixels;
gdk_cairo_get_clip_rectangle(cr, &area);
tmp = pixman_image_create_bits ( tmp = pixman_image_create_bits (
app->format, area.width, area.height, NULL, 0); app->format, area->width, area->height, NULL, 0);
pixman_image_set_dither (tmp, app->dither); pixman_image_set_dither (tmp, app->dither);
pixman_image_composite ( pixman_image_composite (
PIXMAN_OP_SRC, PIXMAN_OP_SRC,
app->original, NULL, tmp, app->original, NULL, tmp,
area.x, area.y, 0, 0, 0, 0, area->x, area->y, 0, 0, 0, 0,
app->width - area.x, app->width - area->x,
app->height - area.y); app->height - area->y);
pixels = calloc (1, area.width * area.height * 4); pixels = calloc (1, area->width * area->height * 4);
final = pixman_image_create_bits ( final = pixman_image_create_bits (
PIXMAN_a8r8g8b8, area.width, area.height, pixels, area.width * 4); PIXMAN_a8r8g8b8, area->width, area->height, pixels, area->width * 4);
pixman_image_composite ( pixman_image_composite (
PIXMAN_OP_SRC, PIXMAN_OP_SRC,
tmp, NULL, final, tmp, NULL, final,
area.x, area.y, 0, 0, 0, 0, area->x, area->y, 0, 0, 0, 0,
app->width - area.x, app->width - area->x,
app->height - area.y); app->height - area->y);
surface = cairo_image_surface_create_for_data ( surface = cairo_image_surface_create_for_data (
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32, (uint8_t *)pixels, CAIRO_FORMAT_ARGB32,
area.width, area.height, area.width * 4); area->width, area->height, area->width * 4);
cairo_set_source_surface (cr, surface, area.x, area.y); cr = gdk_cairo_create (da->window);
cairo_set_source_surface (cr, surface, area->x, area->y);
cairo_paint (cr); cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_destroy (surface); cairo_surface_destroy (surface);
free (pixels); free (pixels);
pixman_image_unref (final); pixman_image_unref (final);
@ -209,7 +211,7 @@ app_new (pixman_image_t *original)
g_error ("Could not read file dither.ui: %s", err->message); g_error ("Could not read file dither.ui: %s", err->message);
widget = get_widget (app, "drawing_area"); widget = get_widget (app, "drawing_area");
g_signal_connect (widget, "draw", G_CALLBACK (on_draw), app); g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
set_up_combo_box (app, "target_format_combo_box", set_up_combo_box (app, "target_format_combo_box",
G_N_ELEMENTS (formats), formats); G_N_ELEMENTS (formats), formats);

View File

@ -1,8 +1,6 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#ifdef HAVE_CONFIG_H #include <config.h>
#include <pixman-config.h> #include "../test/utils.h"
#endif
#include "utils.h"
#include "gtk-utils.h" #include "gtk-utils.h"
pixman_image_t * pixman_image_t *
@ -95,14 +93,15 @@ pixbuf_from_argb32 (uint32_t *bits,
} }
static gboolean static gboolean
on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
{ {
pixman_image_t *pimage = user_data; pixman_image_t *pimage = data;
int width = pixman_image_get_width (pimage); int width = pixman_image_get_width (pimage);
int height = pixman_image_get_height (pimage); int height = pixman_image_get_height (pimage);
int stride = pixman_image_get_stride (pimage); int stride = pixman_image_get_stride (pimage);
cairo_surface_t *cimage; cairo_surface_t *cimage;
cairo_format_t format; cairo_format_t format;
cairo_t *cr;
if (pixman_image_get_format (pimage) == PIXMAN_x8r8g8b8) if (pixman_image_get_format (pimage) == PIXMAN_x8r8g8b8)
format = CAIRO_FORMAT_RGB24; format = CAIRO_FORMAT_RGB24;
@ -112,11 +111,14 @@ on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
cimage = cairo_image_surface_create_for_data ( cimage = cairo_image_surface_create_for_data (
(uint8_t *)pixman_image_get_data (pimage), (uint8_t *)pixman_image_get_data (pimage),
format, width, height, stride); format, width, height, stride);
cr = gdk_cairo_create (widget->window);
cairo_rectangle (cr, 0, 0, width, height); cairo_rectangle (cr, 0, 0, width, height);
cairo_set_source_surface (cr, cimage, 0, 0); cairo_set_source_surface (cr, cimage, 0, 0);
cairo_fill (cr); cairo_fill (cr);
cairo_destroy (cr);
cairo_surface_destroy (cimage); cairo_surface_destroy (cimage);
return TRUE; return TRUE;
@ -168,7 +170,7 @@ show_image (pixman_image_t *image)
break; break;
} }
g_signal_connect (window, "draw", G_CALLBACK (on_draw), copy); g_signal_connect (window, "expose_event", G_CALLBACK (on_expose), copy);
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL); g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (window); gtk_widget_show (window);

View File

@ -1,4 +1,4 @@
#include "utils.h" #include "../test/utils.h"
#include "gtk-utils.h" #include "gtk-utils.h"
#define WIDTH 1024 #define WIDTH 1024

View File

@ -47,7 +47,7 @@ if dep_gtk.found()
libdemo = static_library( libdemo = static_library(
'demo', 'demo',
['gtk-utils.c', config_h, version_h], ['gtk-utils.c', config_h, version_h],
dependencies : [libtestutils_dep, dep_gtk, dep_glib, dep_png, dep_m, dep_openmp], dependencies : [dep_gtk, dep_glib, dep_png, dep_m, dep_openmp],
include_directories : inc_pixman, include_directories : inc_pixman,
) )
@ -57,8 +57,8 @@ if dep_gtk.found()
d, d,
[d + '.c', config_h, version_h], [d + '.c', config_h, version_h],
c_args : extra_demo_cflags, c_args : extra_demo_cflags,
link_with : [libdemo], link_with : [libdemo, libtestutils],
dependencies : [idep_pixman, libtestutils_dep, dep_glib, dep_gtk, dep_openmp, dep_png], dependencies : [dep_glib, dep_gtk, dep_openmp, idep_pixman],
) )
endforeach endforeach
endif endif

View File

@ -1,4 +1,4 @@
#include "utils.h" #include "../test/utils.h"
#include "gtk-utils.h" #include "gtk-utils.h"
#define NUM_GRADIENTS 9 #define NUM_GRADIENTS 9

View File

@ -24,7 +24,7 @@
* Author: Soren Sandmann <soren.sandmann@gmail.com> * Author: Soren Sandmann <soren.sandmann@gmail.com>
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "pixman-config.h" #include "config.h"
#endif #endif
#include <math.h> #include <math.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -278,37 +278,39 @@ rescale (GtkWidget *may_be_null, app_t *app)
} }
static gboolean static gboolean
on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data) on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
{ {
app_t *app = user_data; app_t *app = data;
GdkRectangle area; GdkRectangle *area = &event->expose.area;
cairo_surface_t *surface; cairo_surface_t *surface;
pixman_image_t *tmp; pixman_image_t *tmp;
cairo_t *cr;
uint32_t *pixels; uint32_t *pixels;
gdk_cairo_get_clip_rectangle(cr, &area); pixels = calloc (1, area->width * area->height * 4);
pixels = calloc (1, area.width * area.height * 4);
tmp = pixman_image_create_bits ( tmp = pixman_image_create_bits (
PIXMAN_a8r8g8b8, area.width, area.height, pixels, area.width * 4); PIXMAN_a8r8g8b8, area->width, area->height, pixels, area->width * 4);
if (area.x < app->scaled_width && area.y < app->scaled_height) if (area->x < app->scaled_width && area->y < app->scaled_height)
{ {
pixman_image_composite ( pixman_image_composite (
PIXMAN_OP_SRC, PIXMAN_OP_SRC,
app->original, NULL, tmp, app->original, NULL, tmp,
area.x, area.y, 0, 0, 0, 0, area->x, area->y, 0, 0, 0, 0,
app->scaled_width - area.x, app->scaled_height - area.y); app->scaled_width - area->x, app->scaled_height - area->y);
} }
surface = cairo_image_surface_create_for_data ( surface = cairo_image_surface_create_for_data (
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32, (uint8_t *)pixels, CAIRO_FORMAT_ARGB32,
area.width, area.height, area.width * 4); area->width, area->height, area->width * 4);
cairo_set_source_surface (cr, surface, area.x, area.y); cr = gdk_cairo_create (da->window);
cairo_set_source_surface (cr, surface, area->x, area->y);
cairo_paint (cr); cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_destroy (surface); cairo_surface_destroy (surface);
free (pixels); free (pixels);
pixman_image_unref (tmp); pixman_image_unref (tmp);
@ -398,7 +400,7 @@ app_new (pixman_image_t *original)
gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL); gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL);
widget = get_widget (app, "drawing_area"); widget = get_widget (app, "drawing_area");
g_signal_connect (widget, "draw", G_CALLBACK (on_draw), app); g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
set_up_filter_box (app, "reconstruct_x_combo_box"); set_up_filter_box (app, "reconstruct_x_combo_box");
set_up_filter_box (app, "reconstruct_y_combo_box"); set_up_filter_box (app, "reconstruct_y_combo_box");

View File

@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "utils.h" #include "../test/utils.h"
#include "gtk-utils.h" #include "gtk-utils.h"
int int

View File

@ -21,10 +21,10 @@
project( project(
'pixman', 'pixman',
['c'], ['c'],
version : '0.44.0', version : '0.40.0',
license : 'MIT', license : 'MIT',
meson_version : '>= 0.52.0', meson_version : '>= 0.50.0',
default_options : ['c_std=gnu99', 'buildtype=debugoptimized'], default_options : ['buildtype=debugoptimized'],
) )
config = configuration_data() config = configuration_data()
@ -37,12 +37,6 @@ add_project_arguments(
'-fno-strict-aliasing', '-fno-strict-aliasing',
'-fvisibility=hidden', '-fvisibility=hidden',
'-Wundef', '-Wundef',
# -ftrapping-math is the default for gcc, but -fno-trapping-math is the
# default for clang. The FLOAT_IS_ZERO macro is used to guard against
# floating-point exceptions, however with -fno-trapping-math, the compiler
# can reorder floating-point operations so that they occur before the guard.
# Note, this function is ignored in clang < 10.0.0.
'-ftrapping-math'
]), ]),
language : ['c'] language : ['c']
) )
@ -243,41 +237,6 @@ if not use_vmx.disabled()
endif endif
endif endif
if cc.compiles('''
__asm__ (
".func meson_test"
".endfunc"
);''',
name : 'test for ASM .func directive')
config.set('ASM_HAVE_FUNC_DIRECTIVE', 1)
endif
if cc.compiles('''
__asm__ (
".syntax unified\n"
);''',
name : 'test for ASM .syntax unified directive')
config.set('ASM_HAVE_SYNTAX_UNIFIED', 1)
endif
if cc.links('''
#include <stdint.h>
__asm__ (
" .global _testlabel\n"
"_testlabel:\n"
);
int testlabel();
int main(int argc, char* argv[]) {
return testlabel();
}''',
name : 'test for ASM leading underscore')
config.set('ASM_LEADING_UNDERSCORE', 1)
endif
if have_vmx if have_vmx
config.set10('USE_VMX', true) config.set10('USE_VMX', true)
elif use_vmx.enabled() elif use_vmx.enabled()
@ -316,27 +275,52 @@ elif use_neon.enabled()
error('NEON Support unavailable, but required') error('NEON Support unavailable, but required')
endif endif
use_a64neon = get_option('a64-neon') use_iwmmxt = get_option('iwmmxt')
have_a64neon = false have_iwmmxt = false
if not use_a64neon.disabled() iwmmxt_flags = ['-flax-vector-conversions', '-Winline']
if host_machine.cpu_family() == 'aarch64' if not use_iwmmxt.disabled()
if cc.compiles(files('a64-neon-test.S'), name : 'NEON A64 Intrinsic Support') if get_option('iwmmxt2')
have_a64neon = true iwmmxt_flags += '-march=iwmmxt2'
else
iwmmxt_flags += '-march=iwmmxt'
endif
if host_machine.cpu_family() == 'arm'
if cc.compiles('''
#ifndef __IWMMXT__
#error "IWMMXT not enabled (with -march=iwmmxt)"
#endif
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))
#error "Need GCC >= 4.8 for IWMMXT intrinsics"
#endif
#include <mmintrin.h>
int main () {
union {
__m64 v;
char c[8];
} a = { .c = {1, 2, 3, 4, 5, 6, 7, 8} };
int b = 4;
__m64 c = _mm_srli_si64 (a.v, b);
}
''',
args : iwmmxt_flags,
name : 'IWMMXT Intrinsic Support')
have_iwmmxt = true
endif endif
endif endif
endif endif
if have_a64neon if have_iwmmxt
config.set10('USE_ARM_A64_NEON', true) config.set10('USE_ARM_IWMMXT', true)
elif use_a64neon.enabled() elif use_iwmmxt.enabled()
error('A64 NEON Support unavailable, but required') error('IWMMXT Support unavailable, but required')
endif endif
use_mips_dspr2 = get_option('mips-dspr2') use_mips_dspr2 = get_option('mips-dspr2')
have_mips_dspr2 = false have_mips_dspr2 = false
mips_dspr2_flags = ['-mdspr2'] mips_dspr2_flags = ['-mdspr2']
if not use_mips_dspr2.disabled() if not use_mips_dspr2.disabled()
if host_machine.cpu_family().startswith('mips') if host_machine.cpu_family() == 'mips32'
if cc.compiles(''' if cc.compiles('''
#if !(defined(__mips__) && __mips_isa_rev >= 2) #if !(defined(__mips__) && __mips_isa_rev >= 2)
#error MIPS DSPr2 is currently only available on MIPS32r2 platforms. #error MIPS DSPr2 is currently only available on MIPS32r2 platforms.
@ -352,7 +336,7 @@ if not use_mips_dspr2.disabled()
); );
return c; return c;
}''', }''',
args : mips_dspr2_flags, args : mipds_dspr2_flags,
name : 'DSPr2 Intrinsic Support') name : 'DSPr2 Intrinsic Support')
have_mips_dspr2 = true have_mips_dspr2 = true
endif endif
@ -365,28 +349,6 @@ elif use_mips_dspr2.enabled()
error('MIPS DSPr2 Support unavailable, but required') error('MIPS DSPr2 Support unavailable, but required')
endif endif
use_rvv = get_option('rvv')
have_rvv = false
rvv_flags = ['-march=rv64gcv']
if not use_rvv.disabled()
if host_machine.cpu_family() == 'riscv64'
if cc.compiles('''
#include <riscv_vector.h>
int main() { vfloat32m1_t tmp; return 0; }
''',
args : rvv_flags,
name : 'RISC-V Vector Intrinsic Support')
have_rvv = true
endif
endif
endif
if have_rvv
config.set10('USE_RVV', true)
elif use_rvv.enabled()
error('RISC-V Vector Support unavailable, but required')
endif
use_gnu_asm = get_option('gnu-inline-asm') use_gnu_asm = get_option('gnu-inline-asm')
if not use_gnu_asm.disabled() if not use_gnu_asm.disabled()
if cc.compiles(''' if cc.compiles('''
@ -428,8 +390,10 @@ else
dep_openmp = null_dep dep_openmp = null_dep
endif endif
dep_gtk = dependency('gtk+-3.0', required : get_option('gtk').enabled() and get_option('demos').enabled()) dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk'))
dep_glib = dependency('glib-2.0', required : get_option('gtk').enabled() and get_option('demos').enabled()) dep_glib = dependency('glib-2.0', required : get_option('gtk'))
dep_pixman = dependency('pixman-1', required : get_option('gtk'),
version : '>= ' + meson.project_version())
dep_png = null_dep dep_png = null_dep
if not get_option('libpng').disabled() if not get_option('libpng').disabled()
@ -473,9 +437,6 @@ if dep_threads.found() and cc.has_header('pthread.h')
else else
pthreads_found = true pthreads_found = true
endif endif
else
# Avoid linking with -pthread if we don't actually have pthreads
dep_threads = null_dep
endif endif
if pthreads_found if pthreads_found
@ -511,25 +472,15 @@ foreach h : ['sys/mman.h', 'fenv.h', 'unistd.h']
endif endif
endforeach endforeach
use_tls = get_option('tls') # gcc on Windows only warns that __declspec(thread) isn't supported,
have_tls = '' # passing -Werror=attributes makes it fail.
if not use_tls.disabled() if (host_machine.system() == 'windows' and
# gcc on Windows only warns that __declspec(thread) isn't supported, cc.compiles('int __declspec(thread) foo;',
# passing -Werror=attributes makes it fail. args : cc.get_supported_arguments(['-Werror=attributes']),
if (host_machine.system() == 'windows' and name : 'TLS via __declspec(thread)'))
cc.compiles('int __declspec(thread) foo;', config.set('TLS', '__declspec(thread)')
args : cc.get_supported_arguments(['-Werror=attributes']), elif cc.compiles('int __thread foo;', name : 'TLS via __thread')
name : 'TLS via __declspec(thread)')) config.set('TLS', '__thread')
have_tls = '__declspec(thread)'
elif cc.compiles('int __thread foo;', name : 'TLS via __thread')
have_tls = '__thread'
endif
endif
if have_tls != ''
config.set('TLS', have_tls)
elif use_tls.enabled()
error('Compiler TLS Support unavailable, but required')
endif endif
if cc.links(''' if cc.links('''
@ -541,15 +492,6 @@ if cc.links('''
config.set('TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR', 1) config.set('TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR', 1)
endif endif
if cc.links('''
static int x = 1;
static void __attribute__((destructor)) destructor_function () { x = 0; }
int main (void) { return x; }
''',
name : '__attribute__((destructor))')
config.set('TOOLCHAIN_SUPPORTS_ATTRIBUTE_DESTRUCTOR', 1)
endif
if cc.links( if cc.links(
' __float128 a = 1.0Q, b = 2.0Q; int main (void) { return a + b; }', ' __float128 a = 1.0Q, b = 2.0Q; int main (void) { return a + b; }',
name : 'Has float128 support') name : 'Has float128 support')
@ -586,24 +528,15 @@ version_conf.set('PIXMAN_VERSION_MICRO', split[2])
add_project_arguments('-DHAVE_CONFIG_H', language : ['c']) add_project_arguments('-DHAVE_CONFIG_H', language : ['c'])
subdir('pixman') subdir('pixman')
subdir('test')
if not get_option('tests').disabled() or not get_option('demos').disabled() subdir('demos')
subdir(join_paths('test', 'utils'))
endif
if not get_option('demos').disabled()
subdir('demos')
endif
if not get_option('tests').disabled()
subdir('test')
endif
pkg = import('pkgconfig') pkg = import('pkgconfig')
pkg.generate(libpixman, pkg.generate(
name : 'Pixman', name : 'Pixman',
filebase : 'pixman-1', filebase : 'pixman-1',
description : 'The pixman library (version 1)', description : 'The pixman library (version 1)',
libraries : libpixman,
subdirs: 'pixman-1', subdirs: 'pixman-1',
version : meson.project_version(), version : meson.project_version(),
) )

View File

@ -54,39 +54,30 @@ option(
description : 'Use ARM NEON intrinsic optimized paths', description : 'Use ARM NEON intrinsic optimized paths',
) )
option( option(
'a64-neon', 'iwmmxt',
type : 'feature', type : 'feature',
description : 'Use ARM A64 NEON intrinsic optimized paths', description : 'Use ARM IWMMXT intrinsic optimized paths',
)
option(
'iwmmxt2',
type : 'boolean',
value : true,
description : 'Use ARM IWMMXT2 intrinsic instead of IWMMXT',
) )
option( option(
'mips-dspr2', 'mips-dspr2',
type : 'feature', type : 'feature',
description : 'Use MIPS32 DSPr2 intrinsic optimized paths', description : 'Use MIPS32 DSPr2 intrinsic optimized paths',
) )
option(
'rvv',
type : 'feature',
description : 'Use RISC-V Vector extension',
)
option( option(
'gnu-inline-asm', 'gnu-inline-asm',
type : 'feature', type : 'feature',
description : 'Use GNU style inline assembler', description : 'Use GNU style inline assembler',
) )
option(
'tls',
type : 'feature',
description : 'Use compiler support for thread-local storage',
)
option(
'cpu-features-path',
type : 'string',
description : 'Path to platform-specific cpu-features.[ch] for systems that do not provide it (e.g. Android)',
)
option( option(
'openmp', 'openmp',
type : 'feature', type : 'feature',
description : 'Enable OpenMP for tests', description : 'Enable openmp support',
) )
option( option(
'timers', 'timers',
@ -103,20 +94,10 @@ option(
option( option(
'gtk', 'gtk',
type : 'feature', type : 'feature',
description : 'Enable demos using GTK', description : 'Enable tests using GTK',
) )
option( option(
'libpng', 'libpng',
type : 'feature', type : 'feature',
description : 'Use libpng in tests' description : 'Use libpng'
)
option(
'tests',
type : 'feature',
description : 'Build tests'
)
option(
'demos',
type : 'feature',
description : 'Build demos'
) )

View File

@ -0,0 +1,5 @@
Name: Pixman
Description: The pixman library (version 1)
Version: @PACKAGE_VERSION@
Cflags: -I${pc_top_builddir}/${pcfiledir}/pixman
Libs: ${pc_top_builddir}/${pcfiledir}/pixman/libpixman-1.la

11
pixman-1.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: Pixman
Description: The pixman library (version 1)
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}/pixman-1
Libs: -L${libdir} -lpixman-1

143
pixman/Makefile.am Normal file
View File

@ -0,0 +1,143 @@
include $(top_srcdir)/pixman/Makefile.sources
lib_LTLIBRARIES = libpixman-1.la
libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined @PTHREAD_LDFLAGS@
libpixman_1_la_LIBADD = @PTHREAD_LIBS@ -lm
libpixman_1_la_SOURCES = $(libpixman_sources) $(libpixman_headers)
libpixmanincludedir = $(includedir)/pixman-1
libpixmaninclude_HEADERS = pixman.h pixman-version.h
noinst_LTLIBRARIES =
EXTRA_DIST = \
Makefile.win32 \
dither/make-blue-noise.c \
pixman-region.c \
solaris-hwcap.mapfile \
meson.build \
$(NULL)
# mmx code
if USE_X86_MMX
noinst_LTLIBRARIES += libpixman-mmx.la
libpixman_mmx_la_SOURCES = \
pixman-mmx.c
libpixman_mmx_la_CFLAGS = $(MMX_CFLAGS)
libpixman_1_la_LDFLAGS += $(MMX_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-mmx.la
ASM_CFLAGS_mmx=$(MMX_CFLAGS)
endif
# vmx code
if USE_VMX
noinst_LTLIBRARIES += libpixman-vmx.la
libpixman_vmx_la_SOURCES = \
pixman-vmx.c \
pixman-combine32.h
libpixman_vmx_la_CFLAGS = $(VMX_CFLAGS)
libpixman_1_la_LIBADD += libpixman-vmx.la
ASM_CFLAGS_vmx=$(VMX_CFLAGS)
endif
# sse2 code
if USE_SSE2
noinst_LTLIBRARIES += libpixman-sse2.la
libpixman_sse2_la_SOURCES = \
pixman-sse2.c
libpixman_sse2_la_CFLAGS = $(SSE2_CFLAGS)
libpixman_1_la_LDFLAGS += $(SSE2_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-sse2.la
ASM_CFLAGS_sse2=$(SSE2_CFLAGS)
endif
# ssse3 code
if USE_SSSE3
noinst_LTLIBRARIES += libpixman-ssse3.la
libpixman_ssse3_la_SOURCES = \
pixman-ssse3.c
libpixman_ssse3_la_CFLAGS = $(SSSE3_CFLAGS)
libpixman_1_la_LDFLAGS += $(SSSE3_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-ssse3.la
ASM_CFLAGS_ssse3=$(SSSE3_CFLAGS)
endif
# arm simd code
if USE_ARM_SIMD
noinst_LTLIBRARIES += libpixman-arm-simd.la
libpixman_arm_simd_la_SOURCES = \
pixman-arm-simd.c \
pixman-arm-common.h \
pixman-arm-simd-asm.S \
pixman-arm-simd-asm-scaled.S \
pixman-arm-asm.h \
pixman-arm-simd-asm.h
libpixman_1_la_LIBADD += libpixman-arm-simd.la
ASM_CFLAGS_arm_simd=
endif
# arm neon code
if USE_ARM_NEON
noinst_LTLIBRARIES += libpixman-arm-neon.la
libpixman_arm_neon_la_SOURCES = \
pixman-arm-neon.c \
pixman-arm-common.h \
pixman-arm-neon-asm.S \
pixman-arm-neon-asm-bilinear.S \
pixman-arm-asm.h \
pixman-arm-neon-asm.h
libpixman_1_la_LIBADD += libpixman-arm-neon.la
ASM_CFLAGS_arm_neon=
endif
# iwmmxt code
if USE_ARM_IWMMXT
libpixman_iwmmxt_la_SOURCES = pixman-mmx.c
noinst_LTLIBRARIES += libpixman-iwmmxt.la
libpixman_1_la_LIBADD += libpixman-iwmmxt.la
libpixman_iwmmxt_la-pixman-mmx.lo: pixman-mmx.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $(IWMMXT_CFLAGS) -MT libpixman_iwmmxt_la-pixman-mmx.lo -MD -MP -MF $(DEPDIR)/libpixman_iwmmxt_la-pixman-mmx.Tpo -c -o libpixman_iwmmxt_la-pixman-mmx.lo `test -f 'pixman-mmx.c' || echo '$(srcdir)/'`pixman-mmx.c
$(AM_V_at)$(am__mv) $(DEPDIR)/libpixman_iwmmxt_la-pixman-mmx.Tpo $(DEPDIR)/libpixman_iwmmxt_la-pixman-mmx.Plo
libpixman_iwmmxt_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
libpixman_iwmmxt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(CFLAGS) $(IWMMXT_CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
libpixman-iwmmxt.la: libpixman_iwmmxt_la-pixman-mmx.lo $(libpixman_iwmmxt_la_DEPENDENCIES)
$(AM_V_CCLD)$(libpixman_iwmmxt_la_LINK) libpixman_iwmmxt_la-pixman-mmx.lo $(libpixman_iwmmxt_la_LIBADD) $(LIBS)
endif
# mips dspr2 code
if USE_MIPS_DSPR2
noinst_LTLIBRARIES += libpixman-mips-dspr2.la
libpixman_mips_dspr2_la_SOURCES = \
pixman-mips-dspr2.c \
pixman-mips-dspr2.h \
pixman-mips-dspr2-asm.S \
pixman-mips-dspr2-asm.h \
pixman-mips-memcpy-asm.S
libpixman_1_la_LIBADD += libpixman-mips-dspr2.la
ASM_CFLAGS_mips_dspr2=
endif
# loongson code
if USE_LOONGSON_MMI
noinst_LTLIBRARIES += libpixman-loongson-mmi.la
libpixman_loongson_mmi_la_SOURCES = pixman-mmx.c loongson-mmintrin.h
libpixman_loongson_mmi_la_CFLAGS = $(LS_CFLAGS)
libpixman_1_la_LDFLAGS += $(LS_LDFLAGS)
libpixman_1_la_LIBADD += libpixman-loongson-mmi.la
endif
.c.s : $(libpixmaninclude_HEADERS)
$(CC) $(CFLAGS) $(ASM_CFLAGS_$(@:pixman-%.s=%)) $(ASM_CFLAGS_$(@:pixman-arm-%.s=arm_%)) -DHAVE_CONFIG_H -I$(srcdir) -I$(builddir) -I$(top_builddir) -S -o $@ $<

43
pixman/Makefile.sources Normal file
View File

@ -0,0 +1,43 @@
libpixman_sources = \
pixman.c \
pixman-access.c \
pixman-access-accessors.c \
pixman-bits-image.c \
pixman-combine32.c \
pixman-combine-float.c \
pixman-conical-gradient.c \
pixman-filter.c \
pixman-x86.c \
pixman-mips.c \
pixman-arm.c \
pixman-ppc.c \
pixman-edge.c \
pixman-edge-accessors.c \
pixman-fast-path.c \
pixman-glyph.c \
pixman-general.c \
pixman-gradient-walker.c \
pixman-image.c \
pixman-implementation.c \
pixman-linear-gradient.c \
pixman-matrix.c \
pixman-noop.c \
pixman-radial-gradient.c \
pixman-region16.c \
pixman-region32.c \
pixman-solid-fill.c \
pixman-timer.c \
pixman-trap.c \
pixman-utils.c \
$(NULL)
libpixman_headers = \
dither/blue-noise-64x64.h \
pixman.h \
pixman-accessor.h \
pixman-combine32.h \
pixman-compiler.h \
pixman-edge-imp.h \
pixman-inlines.h \
pixman-private.h \
$(NULL)

93
pixman/Makefile.win32 Normal file
View File

@ -0,0 +1,93 @@
default: all
top_srcdir = ..
include $(top_srcdir)/pixman/Makefile.sources
include $(top_srcdir)/Makefile.win32.common
MMX_VAR = $(MMX)
ifeq ($(MMX_VAR),)
MMX_VAR=on
endif
SSE2_VAR = $(SSE2)
ifeq ($(SSE2_VAR),)
SSE2_VAR=on
endif
SSSE3_VAR = $(SSSE3)
ifeq ($(SSSE3_VAR),)
SSSE3_VAR=on
endif
MMX_CFLAGS = -DUSE_X86_MMX -w14710 -w14714
SSE2_CFLAGS = -DUSE_SSE2
SSSE3_CFLAGS = -DUSE_SSSE3
# MMX compilation flags
ifeq ($(MMX_VAR),on)
PIXMAN_CFLAGS += $(MMX_CFLAGS)
libpixman_sources += pixman-mmx.c
endif
# SSE2 compilation flags
ifeq ($(SSE2_VAR),on)
PIXMAN_CFLAGS += $(SSE2_CFLAGS)
libpixman_sources += pixman-sse2.c
endif
# SSSE3 compilation flags
ifeq ($(SSSE3_VAR),on)
PIXMAN_CFLAGS += $(SSSE3_CFLAGS)
libpixman_sources += pixman-ssse3.c
endif
OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libpixman_sources))
# targets
all: inform informMMX informSSE2 informSSSE3 $(CFG_VAR)/$(LIBRARY).lib
informMMX:
ifneq ($(MMX),off)
ifneq ($(MMX),on)
ifneq ($(MMX),)
@echo "Invalid specified MMX option : "$(MMX_VAR)"."
@echo
@echo "Possible choices for MMX are 'on' or 'off'"
@exit 1
endif
@echo "Setting MMX flag to default value 'on'... (use MMX=on or MMX=off)"
endif
endif
informSSE2:
ifneq ($(SSE2),off)
ifneq ($(SSE2),on)
ifneq ($(SSE2),)
@echo "Invalid specified SSE option : "$(SSE2)"."
@echo
@echo "Possible choices for SSE2 are 'on' or 'off'"
@exit 1
endif
@echo "Setting SSE2 flag to default value 'on'... (use SSE2=on or SSE2=off)"
endif
endif
informSSSE3:
ifneq ($(SSSE3),off)
ifneq ($(SSSE3),on)
ifneq ($(SSSE3),)
@echo "Invalid specified SSE option : "$(SSSE3)"."
@echo
@echo "Possible choices for SSSE3 are 'on' or 'off'"
@exit 1
endif
@echo "Setting SSSE3 flag to default value 'on'... (use SSSE3=on or SSSE3=off)"
endif
endif
# pixman linking
$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
.PHONY: all informMMX informSSE2 informSSSE3

View File

@ -73,7 +73,7 @@ print <<"PROLOG";
#include <stdint.h> #include <stdint.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <pixman-config.h> #include <config.h>
#endif #endif
#include "pixman-private.h" #include "pixman-private.h"

View File

@ -20,7 +20,7 @@
config_h = configure_file( config_h = configure_file(
configuration : config, configuration : config,
output : 'pixman-config.h' output : 'config.h'
) )
version_h = configure_file( version_h = configure_file(
@ -31,20 +31,21 @@ version_h = configure_file(
) )
libpixman_extra_cargs = [] libpixman_extra_cargs = []
default_library = get_option('default_library') if cc.has_function_attribute('dllexport')
if default_library != 'static' and cc.has_function_attribute('dllexport')
libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)'] libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)']
endif endif
pixman_simd_libs = [] pixman_simd_libs = []
simds = [ simds = [
# the mmx library can be compiled with mmx on x86/x86_64 or loongson # the mmx library can be compiled with mmx on x86/x86_64, iwmmxt on
# mmi on loongson mips systems. The libraries will all have the same # some arm cores, or loongson mmi on loongson mips systems. The
# name, "pixman-mmx", but there is no chance of more than one version # libraries will all have the same name, "pixman-mmx", but there is
# being built in the same build because no system could have mmx and # no chance of more than one version being built in the same build
# mmi, and it simplifies the build logic to give them the same name. # because no system could have mmx, iwmmxt, and mmi, and it
# simplifies the build logic to give them the same name.
['mmx', have_mmx, mmx_flags, []], ['mmx', have_mmx, mmx_flags, []],
['mmx', have_loongson_mmi, loongson_mmi_flags, []], ['mmx', have_loongson_mmi, loongson_mmi_flags, []],
['mmx', have_iwmmxt, iwmmxt_flags, []],
['sse2', have_sse2, sse2_flags, []], ['sse2', have_sse2, sse2_flags, []],
['ssse3', have_ssse3, ssse3_flags, []], ['ssse3', have_ssse3, ssse3_flags, []],
@ -53,11 +54,8 @@ simds = [
['pixman-arm-simd-asm.S', 'pixman-arm-simd-asm-scaled.S']], ['pixman-arm-simd-asm.S', 'pixman-arm-simd-asm-scaled.S']],
['arm-neon', have_neon, [], ['arm-neon', have_neon, [],
['pixman-arm-neon-asm.S', 'pixman-arm-neon-asm-bilinear.S']], ['pixman-arm-neon-asm.S', 'pixman-arm-neon-asm-bilinear.S']],
['arm-neon', have_a64neon, [],
['pixman-arma64-neon-asm.S', 'pixman-arma64-neon-asm-bilinear.S']],
['mips-dspr2', have_mips_dspr2, mips_dspr2_flags, ['mips-dspr2', have_mips_dspr2, mips_dspr2_flags,
['pixman-mips-dspr2-asm.S', 'pixman-mips-memcpy-asm.S']], ['pixman-mips-dspr2-asm.S', 'pixman-mips-memcpy-asm.S']],
['rvv', have_rvv, rvv_flags, []],
] ]
foreach simd : simds foreach simd : simds
@ -75,15 +73,18 @@ pixman_files = files(
'pixman.c', 'pixman.c',
'pixman-access.c', 'pixman-access.c',
'pixman-access-accessors.c', 'pixman-access-accessors.c',
'pixman-arm.c',
'pixman-bits-image.c', 'pixman-bits-image.c',
'pixman-combine32.c', 'pixman-combine32.c',
'pixman-combine-float.c', 'pixman-combine-float.c',
'pixman-conical-gradient.c', 'pixman-conical-gradient.c',
'pixman-filter.c',
'pixman-x86.c',
'pixman-mips.c',
'pixman-arm.c',
'pixman-ppc.c',
'pixman-edge.c', 'pixman-edge.c',
'pixman-edge-accessors.c', 'pixman-edge-accessors.c',
'pixman-fast-path.c', 'pixman-fast-path.c',
'pixman-filter.c',
'pixman-glyph.c', 'pixman-glyph.c',
'pixman-general.c', 'pixman-general.c',
'pixman-gradient-walker.c', 'pixman-gradient-walker.c',
@ -91,40 +92,29 @@ pixman_files = files(
'pixman-implementation.c', 'pixman-implementation.c',
'pixman-linear-gradient.c', 'pixman-linear-gradient.c',
'pixman-matrix.c', 'pixman-matrix.c',
'pixman-mips.c',
'pixman-noop.c', 'pixman-noop.c',
'pixman-ppc.c',
'pixman-radial-gradient.c', 'pixman-radial-gradient.c',
'pixman-region16.c', 'pixman-region16.c',
'pixman-region32.c', 'pixman-region32.c',
'pixman-riscv.c',
'pixman-solid-fill.c', 'pixman-solid-fill.c',
'pixman-timer.c', 'pixman-timer.c',
'pixman-trap.c', 'pixman-trap.c',
'pixman-utils.c', 'pixman-utils.c',
'pixman-x86.c',
) )
# Android cpu-features # We cannot use 'link_with' or 'link_whole' because meson wont do the right
cpu_features_path = get_option('cpu-features-path') # thing for static archives.
cpu_features_sources = [] _obs = []
cpu_features_inc = [] foreach l : pixman_simd_libs
if cpu_features_path != '' _obs += l.extract_all_objects()
message('Using cpu-features.[ch] from ' + cpu_features_path) endforeach
cpu_features_sources = files(
cpu_features_path / 'cpu-features.h',
cpu_features_path / 'cpu-features.c',
)
cpu_features_inc = include_directories(cpu_features_path)
endif
libpixman = library( libpixman = library(
'pixman-1', 'pixman-1',
[pixman_files, config_h, version_h, cpu_features_sources], [pixman_files, config_h, version_h],
link_with: pixman_simd_libs, objects : _obs,
c_args : libpixman_extra_cargs, c_args : libpixman_extra_cargs,
dependencies : [dep_m, dep_threads], dependencies : [dep_m, dep_threads],
include_directories : cpu_features_inc,
version : meson.project_version(), version : meson.project_version(),
install : true, install : true,
) )
@ -136,8 +126,4 @@ idep_pixman = declare_dependency(
include_directories : inc_pixman, include_directories : inc_pixman,
) )
if meson.version().version_compare('>= 0.54.0')
meson.override_dependency('pixman-1', idep_pixman)
endif
install_headers('pixman.h', subdir : 'pixman-1') install_headers('pixman.h', subdir : 'pixman-1')

View File

@ -25,7 +25,7 @@
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <pixman-config.h> #include <config.h>
#endif #endif
#include <stdlib.h> #include <stdlib.h>
@ -465,7 +465,7 @@ convert_and_store_pixel (bits_image_t * image,
image, bits, offset, PIXMAN_ ## format); \ image, bits, offset, PIXMAN_ ## format); \
} \ } \
\ \
static const void *const __dummy__ ## format MAYBE_UNUSED static const void *const __dummy__ ## format
MAKE_ACCESSORS(a8r8g8b8); MAKE_ACCESSORS(a8r8g8b8);
MAKE_ACCESSORS(x8r8g8b8); MAKE_ACCESSORS(x8r8g8b8);
@ -610,32 +610,6 @@ fetch_scanline_a8r8g8b8_sRGB_float (bits_image_t * image,
} }
} }
static void
fetch_scanline_r8g8b8_sRGB_float (bits_image_t * image,
int x,
int y,
int width,
uint32_t * b,
const uint32_t *mask)
{
const uint8_t *bits = (uint8_t *)(image->bits + y * image->rowstride);
argb_t *buffer = (argb_t *)b;
int i;
for (i = x; i < width; ++i)
{
uint32_t p = FETCH_24 (image, bits, i);
argb_t *argb = buffer;
argb->a = 1.0f;
argb->r = to_linear[(p >> 16) & 0xff];
argb->g = to_linear[(p >> 8) & 0xff];
argb->b = to_linear[(p >> 0) & 0xff];
buffer++;
}
}
/* Expects a float buffer */ /* Expects a float buffer */
static void static void
fetch_scanline_a2r10g10b10_float (bits_image_t * image, fetch_scanline_a2r10g10b10_float (bits_image_t * image,
@ -1007,24 +981,6 @@ fetch_pixel_a8r8g8b8_sRGB_float (bits_image_t *image,
return argb; return argb;
} }
static argb_t
fetch_pixel_r8g8b8_sRGB_float (bits_image_t *image,
int offset,
int line)
{
uint8_t *bits = (uint8_t *)(image->bits + line * image->rowstride);
uint32_t p = FETCH_24 (image, bits, offset);
argb_t argb;
argb.a = 1.0f;
argb.r = to_linear[(p >> 16) & 0xff];
argb.g = to_linear[(p >> 8) & 0xff];
argb.b = to_linear[(p >> 0) & 0xff];
return argb;
}
static uint32_t static uint32_t
fetch_pixel_yuy2 (bits_image_t *image, fetch_pixel_yuy2 (bits_image_t *image,
int offset, int offset,
@ -1249,31 +1205,6 @@ store_scanline_a8r8g8b8_sRGB_float (bits_image_t * image,
} }
} }
static void
store_scanline_r8g8b8_sRGB_float (bits_image_t * image,
int x,
int y,
int width,
const uint32_t *v)
{
uint8_t *bits = (uint8_t *)(image->bits + image->rowstride * y) + 3 * x;
argb_t *values = (argb_t *)v;
int i;
for (i = 0; i < width; ++i)
{
uint32_t r, g, b, rgb;
r = to_srgb (values[i].r);
g = to_srgb (values[i].g);
b = to_srgb (values[i].b);
rgb = (r << 16) | (g << 8) | b;
STORE_24 (image, bits, i, rgb);
}
}
/* /*
* Contracts a floating point image to 32bpp and then stores it using a * Contracts a floating point image to 32bpp and then stores it using a
* regular 32-bit store proc. Despite the type, this function expects an * regular 32-bit store proc. Despite the type, this function expects an
@ -1352,37 +1283,6 @@ fetch_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
} }
} }
static void
fetch_scanline_r8g8b8_32_sRGB (bits_image_t *image,
int x,
int y,
int width,
uint32_t *buffer,
const uint32_t *mask)
{
const uint8_t *bits = (uint8_t *)(image->bits + y * image->rowstride) + 3 * x;
uint32_t tmp;
int i;
for (i = 0; i < width; ++i)
{
uint32_t a, r, g, b;
tmp = FETCH_24 (image, bits, i);
a = 0xff;
r = (tmp >> 16) & 0xff;
g = (tmp >> 8) & 0xff;
b = (tmp >> 0) & 0xff;
r = to_linear[r] * 255.0f + 0.5f;
g = to_linear[g] * 255.0f + 0.5f;
b = to_linear[b] * 255.0f + 0.5f;
*buffer++ = (a << 24) | (r << 16) | (g << 8) | (b << 0);
}
}
static uint32_t static uint32_t
fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image, fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image,
int offset, int offset,
@ -1404,27 +1304,6 @@ fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image,
return (a << 24) | (r << 16) | (g << 8) | (b << 0); return (a << 24) | (r << 16) | (g << 8) | (b << 0);
} }
static uint32_t
fetch_pixel_r8g8b8_32_sRGB (bits_image_t *image,
int offset,
int line)
{
uint8_t *bits = (uint8_t *)(image->bits + line * image->rowstride);
uint32_t tmp = FETCH_24 (image, bits, offset);
uint32_t a, r, g, b;
a = 0xff;
r = (tmp >> 16) & 0xff;
g = (tmp >> 8) & 0xff;
b = (tmp >> 0) & 0xff;
r = to_linear[r] * 255.0f + 0.5f;
g = to_linear[g] * 255.0f + 0.5f;
b = to_linear[b] * 255.0f + 0.5f;
return (a << 24) | (r << 16) | (g << 8) | (b << 0);
}
static void static void
store_scanline_a8r8g8b8_32_sRGB (bits_image_t *image, store_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
int x, int x,
@ -1457,36 +1336,6 @@ store_scanline_a8r8g8b8_32_sRGB (bits_image_t *image,
} }
} }
static void
store_scanline_r8g8b8_32_sRGB (bits_image_t *image,
int x,
int y,
int width,
const uint32_t *v)
{
uint8_t *bits = (uint8_t *)(image->bits + image->rowstride * y) + 3 * x;
uint64_t *values = (uint64_t *)v;
uint64_t tmp;
int i;
for (i = 0; i < width; ++i)
{
uint32_t r, g, b;
tmp = values[i];
r = (tmp >> 16) & 0xff;
g = (tmp >> 8) & 0xff;
b = (tmp >> 0) & 0xff;
r = to_srgb (r * (1/255.0f));
g = to_srgb (g * (1/255.0f));
b = to_srgb (b * (1/255.0f));
STORE_24 (image, bits, i, (r << 16) | (g << 8) | (b << 0));
}
}
static argb_t static argb_t
fetch_pixel_generic_float (bits_image_t *image, fetch_pixel_generic_float (bits_image_t *image,
int offset, int offset,
@ -1560,11 +1409,6 @@ static const format_info_t accessors[] =
fetch_pixel_a8r8g8b8_32_sRGB, fetch_pixel_a8r8g8b8_sRGB_float, fetch_pixel_a8r8g8b8_32_sRGB, fetch_pixel_a8r8g8b8_sRGB_float,
store_scanline_a8r8g8b8_32_sRGB, store_scanline_a8r8g8b8_sRGB_float, store_scanline_a8r8g8b8_32_sRGB, store_scanline_a8r8g8b8_sRGB_float,
}, },
{ PIXMAN_r8g8b8_sRGB,
fetch_scanline_r8g8b8_32_sRGB, fetch_scanline_r8g8b8_sRGB_float,
fetch_pixel_r8g8b8_32_sRGB, fetch_pixel_r8g8b8_sRGB_float,
store_scanline_r8g8b8_32_sRGB, store_scanline_r8g8b8_sRGB_float,
},
/* 24bpp formats */ /* 24bpp formats */
FORMAT_INFO (r8g8b8), FORMAT_INFO (r8g8b8),

View File

@ -25,86 +25,13 @@
* *
*/ */
#ifndef PIXMAN_ARM_ASM_H
#define PIXMAN_ARM_ASM_H
#include "pixman-config.h"
/*
* References:
* - https://developer.arm.com/documentation/101028/0012/5--Feature-test-macros
* - https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst
*/
#if defined(__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1
#define BTI_C hint 34 /* bti c: for calls, IE bl instructions */
#define GNU_PROPERTY_AARCH64_BTI 1 /* bit 0 GNU Notes is for BTI support */
#else
#define BTI_C
#define GNU_PROPERTY_AARCH64_BTI 0
#endif
#if defined(__ARM_FEATURE_PAC_DEFAULT)
#if __ARM_FEATURE_PAC_DEFAULT & 1
#define SIGN_LR hint 25 /* paciasp: sign with the A key */
#define VERIFY_LR hint 29 /* autiasp: verify with the b key */
#elif __ARM_FEATURE_PAC_DEFAULT & 2
#define SIGN_LR hint 27 /* pacibsp: sign with the b key */
#define VERIFY_LR hint 31 /* autibsp: verify with the b key */
#endif
#define GNU_PROPERTY_AARCH64_POINTER_AUTH 2 /* bit 1 GNU Notes is for PAC support */
#else
#define SIGN_LR BTI_C
#define VERIFY_LR
#define GNU_PROPERTY_AARCH64_POINTER_AUTH 0
#endif
/* Add the BTI support to GNU Notes section for ASM files */
#if GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_POINTER_AUTH != 0
.pushsection .note.gnu.property, "a"; /* Start a new allocatable section */
.balign 8; /* align it on a byte boundry */
.long 4; /* size of "GNU\0" */
.long 0x10; /* size of descriptor */
.long 0x5; /* NT_GNU_PROPERTY_TYPE_0 */
.asciz "GNU";
.long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */
.long 4; /* Four bytes of data */
.long (GNU_PROPERTY_AARCH64_BTI|GNU_PROPERTY_AARCH64_POINTER_AUTH); /* BTI or PAC is enabled */
.long 0; /* padding for 8 byte alignment */
.popsection; /* end the section */
#endif
/* Supplementary macro for setting function attributes */ /* Supplementary macro for setting function attributes */
.macro pixman_asm_function_impl fname
#ifdef ASM_HAVE_FUNC_DIRECTIVE
.func \fname
#endif
.global \fname
#ifdef __ELF__
.hidden \fname
.type \fname, %function
#endif
\fname:
SIGN_LR
.endm
.macro pixman_asm_function fname .macro pixman_asm_function fname
#ifdef ASM_LEADING_UNDERSCORE .func fname
pixman_asm_function_impl _\fname .global fname
#else #ifdef __ELF__
pixman_asm_function_impl \fname .hidden fname
.type fname, %function
#endif #endif
fname:
.endm .endm
.macro pixman_syntax_unified
#ifdef ASM_HAVE_SYNTAX_UNIFIED
.syntax unified
#endif
.endm
.macro pixman_end_asm_function
#ifdef ASM_HAVE_FUNC_DIRECTIVE
.endfunc
#endif
.endm
#endif /* PIXMAN_ARM_ASM_H */

View File

@ -68,8 +68,6 @@
#include "pixman-arm-asm.h" #include "pixman-arm-asm.h"
#include "pixman-arm-neon-asm.h" #include "pixman-arm-neon-asm.h"
pixman_syntax_unified
/* /*
* Bilinear macros from pixman-arm-neon-asm.S * Bilinear macros from pixman-arm-neon-asm.S
*/ */
@ -84,28 +82,28 @@ pixman_syntax_unified
mov TMP1, X, asr #16 mov TMP1, X, asr #16
add X, X, UX add X, X, UX
add TMP1, TOP, TMP1, asl #2 add TMP1, TOP, TMP1, asl #2
vld1.32 {\reg1}, [TMP1], STRIDE vld1.32 {reg1}, [TMP1], STRIDE
vld1.32 {\reg2}, [TMP1] vld1.32 {reg2}, [TMP1]
.endm .endm
.macro bilinear_load_0565 reg1, reg2, tmp .macro bilinear_load_0565 reg1, reg2, tmp
mov TMP1, X, asr #16 mov TMP1, X, asr #16
add X, X, UX add X, X, UX
add TMP1, TOP, TMP1, asl #1 add TMP1, TOP, TMP1, asl #1
vld1.32 {\reg2[0]}, [TMP1], STRIDE vld1.32 {reg2[0]}, [TMP1], STRIDE
vld1.32 {\reg2[1]}, [TMP1] vld1.32 {reg2[1]}, [TMP1]
convert_four_0565_to_x888_packed \reg2, \reg1, \reg2, \tmp convert_four_0565_to_x888_packed reg2, reg1, reg2, tmp
.endm .endm
.macro bilinear_load_and_vertical_interpolate_two_8888 \ .macro bilinear_load_and_vertical_interpolate_two_8888 \
acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2 acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2
bilinear_load_8888 \reg1, \reg2, \tmp1 bilinear_load_8888 reg1, reg2, tmp1
vmull.u8 \acc1, \reg1, d28 vmull.u8 acc1, reg1, d28
vmlal.u8 \acc1, \reg2, d29 vmlal.u8 acc1, reg2, d29
bilinear_load_8888 \reg3, \reg4, \tmp2 bilinear_load_8888 reg3, reg4, tmp2
vmull.u8 \acc2, \reg3, d28 vmull.u8 acc2, reg3, d28
vmlal.u8 \acc2, \reg4, d29 vmlal.u8 acc2, reg4, d29
.endm .endm
.macro bilinear_load_and_vertical_interpolate_four_8888 \ .macro bilinear_load_and_vertical_interpolate_four_8888 \
@ -113,9 +111,9 @@ pixman_syntax_unified
yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \ bilinear_load_and_vertical_interpolate_two_8888 \
\xacc1, \xacc2, \xreg1, \xreg2, \xreg3, \xreg4, \xacc2lo, \xacc2hi xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \ bilinear_load_and_vertical_interpolate_two_8888 \
\yacc1, \yacc2, \yreg1, \yreg2, \yreg3, \yreg4, \yacc2lo, \yacc2hi yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
.endm .endm
.macro bilinear_load_and_vertical_interpolate_two_0565 \ .macro bilinear_load_and_vertical_interpolate_two_0565 \
@ -127,19 +125,19 @@ pixman_syntax_unified
mov TMP2, X, asr #16 mov TMP2, X, asr #16
add X, X, UX add X, X, UX
add TMP2, TOP, TMP2, asl #1 add TMP2, TOP, TMP2, asl #1
vld1.32 {\acc2lo[0]}, [TMP1], STRIDE vld1.32 {acc2lo[0]}, [TMP1], STRIDE
vld1.32 {\acc2hi[0]}, [TMP2], STRIDE vld1.32 {acc2hi[0]}, [TMP2], STRIDE
vld1.32 {\acc2lo[1]}, [TMP1] vld1.32 {acc2lo[1]}, [TMP1]
vld1.32 {\acc2hi[1]}, [TMP2] vld1.32 {acc2hi[1]}, [TMP2]
convert_0565_to_x888 \acc2, \reg3, \reg2, \reg1 convert_0565_to_x888 acc2, reg3, reg2, reg1
vzip.u8 \reg1, \reg3 vzip.u8 reg1, reg3
vzip.u8 \reg2, \reg4 vzip.u8 reg2, reg4
vzip.u8 \reg3, \reg4 vzip.u8 reg3, reg4
vzip.u8 \reg1, \reg2 vzip.u8 reg1, reg2
vmull.u8 \acc1, \reg1, d28 vmull.u8 acc1, reg1, d28
vmlal.u8 \acc1, \reg2, d29 vmlal.u8 acc1, reg2, d29
vmull.u8 \acc2, \reg3, d28 vmull.u8 acc2, reg3, d28
vmlal.u8 \acc2, \reg4, d29 vmlal.u8 acc2, reg4, d29
.endm .endm
.macro bilinear_load_and_vertical_interpolate_four_0565 \ .macro bilinear_load_and_vertical_interpolate_four_0565 \
@ -152,46 +150,46 @@ pixman_syntax_unified
mov TMP2, X, asr #16 mov TMP2, X, asr #16
add X, X, UX add X, X, UX
add TMP2, TOP, TMP2, asl #1 add TMP2, TOP, TMP2, asl #1
vld1.32 {\xacc2lo[0]}, [TMP1], STRIDE vld1.32 {xacc2lo[0]}, [TMP1], STRIDE
vld1.32 {\xacc2hi[0]}, [TMP2], STRIDE vld1.32 {xacc2hi[0]}, [TMP2], STRIDE
vld1.32 {\xacc2lo[1]}, [TMP1] vld1.32 {xacc2lo[1]}, [TMP1]
vld1.32 {\xacc2hi[1]}, [TMP2] vld1.32 {xacc2hi[1]}, [TMP2]
convert_0565_to_x888 \xacc2, \xreg3, \xreg2, \xreg1 convert_0565_to_x888 xacc2, xreg3, xreg2, xreg1
mov TMP1, X, asr #16 mov TMP1, X, asr #16
add X, X, UX add X, X, UX
add TMP1, TOP, TMP1, asl #1 add TMP1, TOP, TMP1, asl #1
mov TMP2, X, asr #16 mov TMP2, X, asr #16
add X, X, UX add X, X, UX
add TMP2, TOP, TMP2, asl #1 add TMP2, TOP, TMP2, asl #1
vld1.32 {\yacc2lo[0]}, [TMP1], STRIDE vld1.32 {yacc2lo[0]}, [TMP1], STRIDE
vzip.u8 \xreg1, \xreg3 vzip.u8 xreg1, xreg3
vld1.32 {\yacc2hi[0]}, [TMP2], STRIDE vld1.32 {yacc2hi[0]}, [TMP2], STRIDE
vzip.u8 \xreg2, \xreg4 vzip.u8 xreg2, xreg4
vld1.32 {\yacc2lo[1]}, [TMP1] vld1.32 {yacc2lo[1]}, [TMP1]
vzip.u8 \xreg3, \xreg4 vzip.u8 xreg3, xreg4
vld1.32 {\yacc2hi[1]}, [TMP2] vld1.32 {yacc2hi[1]}, [TMP2]
vzip.u8 \xreg1, \xreg2 vzip.u8 xreg1, xreg2
convert_0565_to_x888 \yacc2, \yreg3, \yreg2, \yreg1 convert_0565_to_x888 yacc2, yreg3, yreg2, yreg1
vmull.u8 \xacc1, \xreg1, d28 vmull.u8 xacc1, xreg1, d28
vzip.u8 \yreg1, \yreg3 vzip.u8 yreg1, yreg3
vmlal.u8 \xacc1, \xreg2, d29 vmlal.u8 xacc1, xreg2, d29
vzip.u8 \yreg2, \yreg4 vzip.u8 yreg2, yreg4
vmull.u8 \xacc2, \xreg3, d28 vmull.u8 xacc2, xreg3, d28
vzip.u8 \yreg3, \yreg4 vzip.u8 yreg3, yreg4
vmlal.u8 \xacc2, \xreg4, d29 vmlal.u8 xacc2, xreg4, d29
vzip.u8 \yreg1, \yreg2 vzip.u8 yreg1, yreg2
vmull.u8 \yacc1, \yreg1, d28 vmull.u8 yacc1, yreg1, d28
vmlal.u8 \yacc1, \yreg2, d29 vmlal.u8 yacc1, yreg2, d29
vmull.u8 \yacc2, \yreg3, d28 vmull.u8 yacc2, yreg3, d28
vmlal.u8 \yacc2, \yreg4, d29 vmlal.u8 yacc2, yreg4, d29
.endm .endm
.macro bilinear_store_8888 numpix, tmp1, tmp2 .macro bilinear_store_8888 numpix, tmp1, tmp2
.if \numpix == 4 .if numpix == 4
vst1.32 {d0, d1}, [OUT]! vst1.32 {d0, d1}, [OUT]!
.elseif \numpix == 2 .elseif numpix == 2
vst1.32 {d0}, [OUT]! vst1.32 {d0}, [OUT]!
.elseif \numpix == 1 .elseif numpix == 1
vst1.32 {d0[0]}, [OUT, :32]! vst1.32 {d0[0]}, [OUT, :32]!
.else .else
.error bilinear_store_8888 numpix is unsupported .error bilinear_store_8888 numpix is unsupported
@ -203,12 +201,12 @@ pixman_syntax_unified
vuzp.u8 d2, d3 vuzp.u8 d2, d3
vuzp.u8 d1, d3 vuzp.u8 d1, d3
vuzp.u8 d0, d2 vuzp.u8 d0, d2
convert_8888_to_0565 d2, d1, d0, q1, \tmp1, \tmp2 convert_8888_to_0565 d2, d1, d0, q1, tmp1, tmp2
.if \numpix == 4 .if numpix == 4
vst1.16 {d2}, [OUT]! vst1.16 {d2}, [OUT]!
.elseif \numpix == 2 .elseif numpix == 2
vst1.32 {d2[0]}, [OUT]! vst1.32 {d2[0]}, [OUT]!
.elseif \numpix == 1 .elseif numpix == 1
vst1.16 {d2[0]}, [OUT]! vst1.16 {d2[0]}, [OUT]!
.else .else
.error bilinear_store_0565 numpix is unsupported .error bilinear_store_0565 numpix is unsupported
@ -224,20 +222,20 @@ pixman_syntax_unified
.endm .endm
.macro bilinear_load_mask_8 numpix, mask .macro bilinear_load_mask_8 numpix, mask
.if \numpix == 4 .if numpix == 4
vld1.32 {\mask[0]}, [MASK]! vld1.32 {mask[0]}, [MASK]!
.elseif \numpix == 2 .elseif numpix == 2
vld1.16 {\mask[0]}, [MASK]! vld1.16 {mask[0]}, [MASK]!
.elseif \numpix == 1 .elseif numpix == 1
vld1.8 {\mask[0]}, [MASK]! vld1.8 {mask[0]}, [MASK]!
.else .else
.error bilinear_load_mask_8 \numpix is unsupported .error bilinear_load_mask_8 numpix is unsupported
.endif .endif
pld [MASK, #prefetch_offset] pld [MASK, #prefetch_offset]
.endm .endm
.macro bilinear_load_mask mask_fmt, numpix, mask .macro bilinear_load_mask mask_fmt, numpix, mask
bilinear_load_mask_\()\mask_fmt \numpix, \mask bilinear_load_mask_&mask_fmt numpix, mask
.endm .endm
@ -252,28 +250,28 @@ pixman_syntax_unified
.endm .endm
.macro bilinear_load_dst_8888 numpix, dst0, dst1, dst01 .macro bilinear_load_dst_8888 numpix, dst0, dst1, dst01
.if \numpix == 4 .if numpix == 4
vld1.32 {\dst0, \dst1}, [OUT] vld1.32 {dst0, dst1}, [OUT]
.elseif \numpix == 2 .elseif numpix == 2
vld1.32 {\dst0}, [OUT] vld1.32 {dst0}, [OUT]
.elseif \numpix == 1 .elseif numpix == 1
vld1.32 {\dst0[0]}, [OUT] vld1.32 {dst0[0]}, [OUT]
.else .else
.error bilinear_load_dst_8888 \numpix is unsupported .error bilinear_load_dst_8888 numpix is unsupported
.endif .endif
pld [OUT, #(prefetch_offset * 4)] pld [OUT, #(prefetch_offset * 4)]
.endm .endm
.macro bilinear_load_dst_8888_over numpix, dst0, dst1, dst01 .macro bilinear_load_dst_8888_over numpix, dst0, dst1, dst01
bilinear_load_dst_8888 \numpix, \dst0, \dst1, \dst01 bilinear_load_dst_8888 numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_load_dst_8888_add numpix, dst0, dst1, dst01 .macro bilinear_load_dst_8888_add numpix, dst0, dst1, dst01
bilinear_load_dst_8888 \numpix, \dst0, \dst1, \dst01 bilinear_load_dst_8888 numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_load_dst dst_fmt, op, numpix, dst0, dst1, dst01 .macro bilinear_load_dst dst_fmt, op, numpix, dst0, dst1, dst01
bilinear_load_dst_\()\dst_fmt\()_\()\op \numpix, \dst0, \dst1, \dst01 bilinear_load_dst_&dst_fmt&_&op numpix, dst0, dst1, dst01
.endm .endm
/* /*
@ -292,19 +290,19 @@ pixman_syntax_unified
.endm .endm
.macro bilinear_duplicate_mask_8 numpix, mask .macro bilinear_duplicate_mask_8 numpix, mask
.if \numpix == 4 .if numpix == 4
vdup.32 \mask, \mask[0] vdup.32 mask, mask[0]
.elseif \numpix == 2 .elseif numpix == 2
vdup.16 \mask, \mask[0] vdup.16 mask, mask[0]
.elseif \numpix == 1 .elseif numpix == 1
vdup.8 \mask, \mask[0] vdup.8 mask, mask[0]
.else .else
.error bilinear_duplicate_mask_8 is unsupported .error bilinear_duplicate_mask_8 is unsupported
.endif .endif
.endm .endm
.macro bilinear_duplicate_mask mask_fmt, numpix, mask .macro bilinear_duplicate_mask mask_fmt, numpix, mask
bilinear_duplicate_mask_\()\mask_fmt \numpix, \mask bilinear_duplicate_mask_&mask_fmt numpix, mask
.endm .endm
/* /*
@ -312,10 +310,10 @@ pixman_syntax_unified
* Interleave should be done when maks is enabled or operator is 'over'. * Interleave should be done when maks is enabled or operator is 'over'.
*/ */
.macro bilinear_interleave src0, src1, dst0, dst1 .macro bilinear_interleave src0, src1, dst0, dst1
vuzp.8 \src0, \src1 vuzp.8 src0, src1
vuzp.8 \dst0, \dst1 vuzp.8 dst0, dst1
vuzp.8 \src0, \src1 vuzp.8 src0, src1
vuzp.8 \dst0, \dst1 vuzp.8 dst0, dst1
.endm .endm
.macro bilinear_interleave_src_dst_x_src \ .macro bilinear_interleave_src_dst_x_src \
@ -325,7 +323,7 @@ pixman_syntax_unified
.macro bilinear_interleave_src_dst_x_over \ .macro bilinear_interleave_src_dst_x_over \
numpix, src0, src1, src01, dst0, dst1, dst01 numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave \src0, \src1, \dst0, \dst1 bilinear_interleave src0, src1, dst0, dst1
.endm .endm
.macro bilinear_interleave_src_dst_x_add \ .macro bilinear_interleave_src_dst_x_add \
@ -335,26 +333,26 @@ pixman_syntax_unified
.macro bilinear_interleave_src_dst_8_src \ .macro bilinear_interleave_src_dst_8_src \
numpix, src0, src1, src01, dst0, dst1, dst01 numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave \src0, \src1, \dst0, \dst1 bilinear_interleave src0, src1, dst0, dst1
.endm .endm
.macro bilinear_interleave_src_dst_8_over \ .macro bilinear_interleave_src_dst_8_over \
numpix, src0, src1, src01, dst0, dst1, dst01 numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave \src0, \src1, \dst0, \dst1 bilinear_interleave src0, src1, dst0, dst1
.endm .endm
.macro bilinear_interleave_src_dst_8_add \ .macro bilinear_interleave_src_dst_8_add \
numpix, src0, src1, src01, dst0, dst1, dst01 numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave \src0, \src1, \dst0, \dst1 bilinear_interleave src0, src1, dst0, dst1
.endm .endm
.macro bilinear_interleave_src_dst \ .macro bilinear_interleave_src_dst \
mask_fmt, op, numpix, src0, src1, src01, dst0, dst1, dst01 mask_fmt, op, numpix, src0, src1, src01, dst0, dst1, dst01
bilinear_interleave_src_dst_\()\mask_fmt\()_\()\op \ bilinear_interleave_src_dst_&mask_fmt&_&op \
\numpix, \src0, \src1, \src01, \dst0, \dst1, \dst01 numpix, src0, src1, src01, dst0, dst1, dst01
.endm .endm
@ -372,23 +370,23 @@ pixman_syntax_unified
numpix, src0, src1, src01, mask, \ numpix, src0, src1, src01, mask, \
tmp01, tmp23, tmp45, tmp67 tmp01, tmp23, tmp45, tmp67
vmull.u8 \tmp01, \src0, \mask vmull.u8 tmp01, src0, mask
vmull.u8 \tmp23, \src1, \mask vmull.u8 tmp23, src1, mask
/* bubbles */ /* bubbles */
vrshr.u16 \tmp45, \tmp01, #8 vrshr.u16 tmp45, tmp01, #8
vrshr.u16 \tmp67, \tmp23, #8 vrshr.u16 tmp67, tmp23, #8
/* bubbles */ /* bubbles */
vraddhn.u16 \src0, \tmp45, \tmp01 vraddhn.u16 src0, tmp45, tmp01
vraddhn.u16 \src1, \tmp67, \tmp23 vraddhn.u16 src1, tmp67, tmp23
.endm .endm
.macro bilinear_apply_mask_to_src \ .macro bilinear_apply_mask_to_src \
mask_fmt, numpix, src0, src1, src01, mask, \ mask_fmt, numpix, src0, src1, src01, mask, \
tmp01, tmp23, tmp45, tmp67 tmp01, tmp23, tmp45, tmp67
bilinear_apply_mask_to_src_\()\mask_fmt \ bilinear_apply_mask_to_src_&mask_fmt \
\numpix, \src0, \src1, \src01, \mask, \ numpix, src0, src1, src01, mask, \
\tmp01, \tmp23, \tmp45, \tmp67 tmp01, tmp23, tmp45, tmp67
.endm .endm
@ -405,79 +403,79 @@ pixman_syntax_unified
numpix, src0, src1, src01, dst0, dst1, dst01, \ numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8 tmp01, tmp23, tmp45, tmp67, tmp8
vdup.32 \tmp8, \src1[1] vdup.32 tmp8, src1[1]
/* bubbles */ /* bubbles */
vmvn.8 \tmp8, \tmp8 vmvn.8 tmp8, tmp8
/* bubbles */ /* bubbles */
vmull.u8 \tmp01, \dst0, \tmp8 vmull.u8 tmp01, dst0, tmp8
/* bubbles */ /* bubbles */
vmull.u8 \tmp23, \dst1, \tmp8 vmull.u8 tmp23, dst1, tmp8
/* bubbles */ /* bubbles */
vrshr.u16 \tmp45, \tmp01, #8 vrshr.u16 tmp45, tmp01, #8
vrshr.u16 \tmp67, \tmp23, #8 vrshr.u16 tmp67, tmp23, #8
/* bubbles */ /* bubbles */
vraddhn.u16 \dst0, \tmp45, \tmp01 vraddhn.u16 dst0, tmp45, tmp01
vraddhn.u16 \dst1, \tmp67, \tmp23 vraddhn.u16 dst1, tmp67, tmp23
/* bubbles */ /* bubbles */
vqadd.u8 \src01, \dst01, \src01 vqadd.u8 src01, dst01, src01
.endm .endm
.macro bilinear_combine_add \ .macro bilinear_combine_add \
numpix, src0, src1, src01, dst0, dst1, dst01, \ numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8 tmp01, tmp23, tmp45, tmp67, tmp8
vqadd.u8 \src01, \dst01, \src01 vqadd.u8 src01, dst01, src01
.endm .endm
.macro bilinear_combine \ .macro bilinear_combine \
op, numpix, src0, src1, src01, dst0, dst1, dst01, \ op, numpix, src0, src1, src01, dst0, dst1, dst01, \
tmp01, tmp23, tmp45, tmp67, tmp8 tmp01, tmp23, tmp45, tmp67, tmp8
bilinear_combine_\()\op \ bilinear_combine_&op \
\numpix, \src0, \src1, \src01, \dst0, \dst1, \dst01, \ numpix, src0, src1, src01, dst0, dst1, dst01, \
\tmp01, \tmp23, \tmp45, \tmp67, \tmp8 tmp01, tmp23, tmp45, tmp67, tmp8
.endm .endm
/* /*
* Macros for final deinterleaving of destination pixels if needed. * Macros for final deinterleaving of destination pixels if needed.
*/ */
.macro bilinear_deinterleave numpix, dst0, dst1, dst01 .macro bilinear_deinterleave numpix, dst0, dst1, dst01
vuzp.8 \dst0, \dst1 vuzp.8 dst0, dst1
/* bubbles */ /* bubbles */
vuzp.8 \dst0, \dst1 vuzp.8 dst0, dst1
.endm .endm
.macro bilinear_deinterleave_dst_x_src numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst_x_src numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_deinterleave_dst_x_over numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst_x_over numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 bilinear_deinterleave numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_deinterleave_dst_x_add numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst_x_add numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_deinterleave_dst_8_src numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst_8_src numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 bilinear_deinterleave numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_deinterleave_dst_8_over numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst_8_over numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 bilinear_deinterleave numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_deinterleave_dst_8_add numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst_8_add numpix, dst0, dst1, dst01
bilinear_deinterleave \numpix, \dst0, \dst1, \dst01 bilinear_deinterleave numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_deinterleave_dst mask_fmt, op, numpix, dst0, dst1, dst01 .macro bilinear_deinterleave_dst mask_fmt, op, numpix, dst0, dst1, dst01
bilinear_deinterleave_dst_\()\mask_fmt\()_\()\op \numpix, \dst0, \dst1, \dst01 bilinear_deinterleave_dst_&mask_fmt&_&op numpix, dst0, dst1, dst01
.endm .endm
.macro bilinear_interpolate_last_pixel src_fmt, mask_fmt, dst_fmt, op .macro bilinear_interpolate_last_pixel src_fmt, mask_fmt, dst_fmt, op
bilinear_load_\()\src_fmt d0, d1, d2 bilinear_load_&src_fmt d0, d1, d2
bilinear_load_mask \mask_fmt, 1, d4 bilinear_load_mask mask_fmt, 1, d4
bilinear_load_dst \dst_fmt, \op, 1, d18, d19, q9 bilinear_load_dst dst_fmt, op, 1, d18, d19, q9
vmull.u8 q1, d0, d28 vmull.u8 q1, d0, d28
vmlal.u8 q1, d1, d29 vmlal.u8 q1, d1, d29
/* 5 cycles bubble */ /* 5 cycles bubble */
@ -485,28 +483,28 @@ pixman_syntax_unified
vmlsl.u16 q0, d2, d30 vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30 vmlal.u16 q0, d3, d30
/* 5 cycles bubble */ /* 5 cycles bubble */
bilinear_duplicate_mask \mask_fmt, 1, d4 bilinear_duplicate_mask mask_fmt, 1, d4
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS) vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
/* 3 cycles bubble */ /* 3 cycles bubble */
vmovn.u16 d0, q0 vmovn.u16 d0, q0
/* 1 cycle bubble */ /* 1 cycle bubble */
bilinear_interleave_src_dst \ bilinear_interleave_src_dst \
\mask_fmt, \op, 1, d0, d1, q0, d18, d19, q9 mask_fmt, op, 1, d0, d1, q0, d18, d19, q9
bilinear_apply_mask_to_src \ bilinear_apply_mask_to_src \
\mask_fmt, 1, d0, d1, q0, d4, \ mask_fmt, 1, d0, d1, q0, d4, \
q3, q8, q10, q11 q3, q8, q10, q11
bilinear_combine \ bilinear_combine \
\op, 1, d0, d1, q0, d18, d19, q9, \ op, 1, d0, d1, q0, d18, d19, q9, \
q3, q8, q10, q11, d5 q3, q8, q10, q11, d5
bilinear_deinterleave_dst \mask_fmt, \op, 1, d0, d1, q0 bilinear_deinterleave_dst mask_fmt, op, 1, d0, d1, q0
bilinear_store_\()\dst_fmt 1, q2, q3 bilinear_store_&dst_fmt 1, q2, q3
.endm .endm
.macro bilinear_interpolate_two_pixels src_fmt, mask_fmt, dst_fmt, op .macro bilinear_interpolate_two_pixels src_fmt, mask_fmt, dst_fmt, op
bilinear_load_and_vertical_interpolate_two_\()\src_fmt \ bilinear_load_and_vertical_interpolate_two_&src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23 q1, q11, d0, d1, d20, d21, d22, d23
bilinear_load_mask \mask_fmt, 2, d4 bilinear_load_mask mask_fmt, 2, d4
bilinear_load_dst \dst_fmt, \op, 2, d18, d19, q9 bilinear_load_dst dst_fmt, op, 2, d18, d19, q9
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30 vmlsl.u16 q0, d2, d30
vmlal.u16 q0, d3, d30 vmlal.u16 q0, d3, d30
@ -515,24 +513,24 @@ pixman_syntax_unified
vmlal.u16 q10, d23, d31 vmlal.u16 q10, d23, d31
vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS) vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS) vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
bilinear_duplicate_mask \mask_fmt, 2, d4 bilinear_duplicate_mask mask_fmt, 2, d4
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS) vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13 vadd.u16 q12, q12, q13
vmovn.u16 d0, q0 vmovn.u16 d0, q0
bilinear_interleave_src_dst \ bilinear_interleave_src_dst \
\mask_fmt, \op, 2, d0, d1, q0, d18, d19, q9 mask_fmt, op, 2, d0, d1, q0, d18, d19, q9
bilinear_apply_mask_to_src \ bilinear_apply_mask_to_src \
\mask_fmt, 2, d0, d1, q0, d4, \ mask_fmt, 2, d0, d1, q0, d4, \
q3, q8, q10, q11 q3, q8, q10, q11
bilinear_combine \ bilinear_combine \
\op, 2, d0, d1, q0, d18, d19, q9, \ op, 2, d0, d1, q0, d18, d19, q9, \
q3, q8, q10, q11, d5 q3, q8, q10, q11, d5
bilinear_deinterleave_dst \mask_fmt, \op, 2, d0, d1, q0 bilinear_deinterleave_dst mask_fmt, op, 2, d0, d1, q0
bilinear_store_\()\dst_fmt 2, q2, q3 bilinear_store_&dst_fmt 2, q2, q3
.endm .endm
.macro bilinear_interpolate_four_pixels src_fmt, mask_fmt, dst_fmt, op .macro bilinear_interpolate_four_pixels src_fmt, mask_fmt, dst_fmt, op
bilinear_load_and_vertical_interpolate_four_\()\src_fmt \ bilinear_load_and_vertical_interpolate_four_&src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23 \ q1, q11, d0, d1, d20, d21, d22, d23 \
q3, q9, d4, d5, d16, d17, d18, d19 q3, q9, d4, d5, d16, d17, d18, d19
pld [TMP1, PF_OFFS] pld [TMP1, PF_OFFS]
@ -548,8 +546,8 @@ pixman_syntax_unified
vmlsl.u16 q2, d6, d30 vmlsl.u16 q2, d6, d30
vmlal.u16 q2, d7, d30 vmlal.u16 q2, d7, d30
vshll.u16 q8, d18, #BILINEAR_INTERPOLATION_BITS vshll.u16 q8, d18, #BILINEAR_INTERPOLATION_BITS
bilinear_load_mask \mask_fmt, 4, d22 bilinear_load_mask mask_fmt, 4, d22
bilinear_load_dst \dst_fmt, \op, 4, d2, d3, q1 bilinear_load_dst dst_fmt, op, 4, d2, d3, q1
pld [TMP1, PF_OFFS] pld [TMP1, PF_OFFS]
vmlsl.u16 q8, d18, d31 vmlsl.u16 q8, d18, d31
vmlal.u16 q8, d19, d31 vmlal.u16 q8, d19, d31
@ -558,21 +556,21 @@ pixman_syntax_unified
vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS) vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS) vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
vshrn.u32 d5, q8, #(2 * BILINEAR_INTERPOLATION_BITS) vshrn.u32 d5, q8, #(2 * BILINEAR_INTERPOLATION_BITS)
bilinear_duplicate_mask \mask_fmt, 4, d22 bilinear_duplicate_mask mask_fmt, 4, d22
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS) vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vmovn.u16 d0, q0 vmovn.u16 d0, q0
vmovn.u16 d1, q2 vmovn.u16 d1, q2
vadd.u16 q12, q12, q13 vadd.u16 q12, q12, q13
bilinear_interleave_src_dst \ bilinear_interleave_src_dst \
\mask_fmt, \op, 4, d0, d1, q0, d2, d3, q1 mask_fmt, op, 4, d0, d1, q0, d2, d3, q1
bilinear_apply_mask_to_src \ bilinear_apply_mask_to_src \
\mask_fmt, 4, d0, d1, q0, d22, \ mask_fmt, 4, d0, d1, q0, d22, \
q3, q8, q9, q10 q3, q8, q9, q10
bilinear_combine \ bilinear_combine \
\op, 4, d0, d1, q0, d2, d3, q1, \ op, 4, d0, d1, q0, d2, d3, q1, \
q3, q8, q9, q10, d23 q3, q8, q9, q10, d23
bilinear_deinterleave_dst \mask_fmt, \op, 4, d0, d1, q0 bilinear_deinterleave_dst mask_fmt, op, 4, d0, d1, q0
bilinear_store_\()\dst_fmt 4, q2, q3 bilinear_store_&dst_fmt 4, q2, q3
.endm .endm
.set BILINEAR_FLAG_USE_MASK, 1 .set BILINEAR_FLAG_USE_MASK, 1
@ -612,14 +610,14 @@ pixman_syntax_unified
prefetch_distance, \ prefetch_distance, \
flags flags
pixman_asm_function \fname pixman_asm_function fname
.if \pixblock_size == 8 .if pixblock_size == 8
.elseif \pixblock_size == 4 .elseif pixblock_size == 4
.else .else
.error unsupported pixblock size .error unsupported pixblock size
.endif .endif
.if ((\flags) & BILINEAR_FLAG_USE_MASK) == 0 .if ((flags) & BILINEAR_FLAG_USE_MASK) == 0
OUT .req r0 OUT .req r0
TOP .req r1 TOP .req r1
BOTTOM .req r2 BOTTOM .req r2
@ -637,7 +635,7 @@ pixman_asm_function \fname
mov ip, sp mov ip, sp
push {r4, r5, r6, r7, r8, r9} push {r4, r5, r6, r7, r8, r9}
mov PF_OFFS, #\prefetch_distance mov PF_OFFS, #prefetch_distance
ldmia ip, {WB, X, UX, WIDTH} ldmia ip, {WB, X, UX, WIDTH}
.else .else
OUT .req r0 OUT .req r0
@ -656,17 +654,17 @@ pixman_asm_function \fname
TMP4 .req r10 TMP4 .req r10
STRIDE .req r3 STRIDE .req r3
.set prefetch_offset, \prefetch_distance .set prefetch_offset, prefetch_distance
mov ip, sp mov ip, sp
push {r4, r5, r6, r7, r8, r9, r10, ip} push {r4, r5, r6, r7, r8, r9, r10, ip}
mov PF_OFFS, #\prefetch_distance mov PF_OFFS, #prefetch_distance
ldmia ip, {WT, WB, X, UX, WIDTH} ldmia ip, {WT, WB, X, UX, WIDTH}
.endif .endif
mul PF_OFFS, PF_OFFS, UX mul PF_OFFS, PF_OFFS, UX
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0 .if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpush {d8-d15} vpush {d8-d15}
.endif .endif
@ -685,11 +683,11 @@ pixman_asm_function \fname
/* ensure good destination alignment */ /* ensure good destination alignment */
cmp WIDTH, #1 cmp WIDTH, #1
blt 0f blt 0f
tst OUT, #(1 << \dst_bpp_shift) tst OUT, #(1 << dst_bpp_shift)
beq 0f beq 0f
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS) vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13 vadd.u16 q12, q12, q13
\bilinear_process_last_pixel bilinear_process_last_pixel
sub WIDTH, WIDTH, #1 sub WIDTH, WIDTH, #1
0: 0:
vadd.u16 q13, q13, q13 vadd.u16 q13, q13, q13
@ -698,53 +696,53 @@ pixman_asm_function \fname
cmp WIDTH, #2 cmp WIDTH, #2
blt 0f blt 0f
tst OUT, #(1 << (\dst_bpp_shift + 1)) tst OUT, #(1 << (dst_bpp_shift + 1))
beq 0f beq 0f
\bilinear_process_two_pixels bilinear_process_two_pixels
sub WIDTH, WIDTH, #2 sub WIDTH, WIDTH, #2
0: 0:
.if \pixblock_size == 8 .if pixblock_size == 8
cmp WIDTH, #4 cmp WIDTH, #4
blt 0f blt 0f
tst OUT, #(1 << (\dst_bpp_shift + 2)) tst OUT, #(1 << (dst_bpp_shift + 2))
beq 0f beq 0f
\bilinear_process_four_pixels bilinear_process_four_pixels
sub WIDTH, WIDTH, #4 sub WIDTH, WIDTH, #4
0: 0:
.endif .endif
subs WIDTH, WIDTH, #\pixblock_size subs WIDTH, WIDTH, #pixblock_size
blt 1f blt 1f
mov PF_OFFS, PF_OFFS, asr #(16 - \src_bpp_shift) mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift)
\bilinear_process_pixblock_head bilinear_process_pixblock_head
subs WIDTH, WIDTH, #\pixblock_size subs WIDTH, WIDTH, #pixblock_size
blt 5f blt 5f
0: 0:
\bilinear_process_pixblock_tail_head bilinear_process_pixblock_tail_head
subs WIDTH, WIDTH, #\pixblock_size subs WIDTH, WIDTH, #pixblock_size
bge 0b bge 0b
5: 5:
\bilinear_process_pixblock_tail bilinear_process_pixblock_tail
1: 1:
.if \pixblock_size == 8 .if pixblock_size == 8
tst WIDTH, #4 tst WIDTH, #4
beq 2f beq 2f
\bilinear_process_four_pixels bilinear_process_four_pixels
2: 2:
.endif .endif
/* handle the remaining trailing pixels */ /* handle the remaining trailing pixels */
tst WIDTH, #2 tst WIDTH, #2
beq 2f beq 2f
\bilinear_process_two_pixels bilinear_process_two_pixels
2: 2:
tst WIDTH, #1 tst WIDTH, #1
beq 3f beq 3f
\bilinear_process_last_pixel bilinear_process_last_pixel
3: 3:
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0 .if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpop {d8-d15} vpop {d8-d15}
.endif .endif
.if ((\flags) & BILINEAR_FLAG_USE_MASK) == 0 .if ((flags) & BILINEAR_FLAG_USE_MASK) == 0
pop {r4, r5, r6, r7, r8, r9} pop {r4, r5, r6, r7, r8, r9}
.else .else
pop {r4, r5, r6, r7, r8, r9, r10, ip} pop {r4, r5, r6, r7, r8, r9, r10, ip}
@ -764,11 +762,11 @@ pixman_asm_function \fname
.unreq TMP3 .unreq TMP3
.unreq TMP4 .unreq TMP4
.unreq STRIDE .unreq STRIDE
.if ((\flags) & BILINEAR_FLAG_USE_MASK) != 0 .if ((flags) & BILINEAR_FLAG_USE_MASK) != 0
.unreq MASK .unreq MASK
.endif .endif
pixman_end_asm_function .endfunc
.endm .endm

View File

@ -53,8 +53,6 @@
#include "pixman-arm-asm.h" #include "pixman-arm-asm.h"
#include "pixman-arm-neon-asm.h" #include "pixman-arm-neon-asm.h"
pixman_syntax_unified
/* Global configuration options and preferences */ /* Global configuration options and preferences */
/* /*
@ -262,13 +260,13 @@
vshrn.u16 d7, q2, #3 vshrn.u16 d7, q2, #3
vsli.u16 q2, q2, #5 vsli.u16 q2, q2, #5
vshll.u8 q14, d16, #8 vshll.u8 q14, d16, #8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
vshll.u8 q8, d19, #8 vshll.u8 q8, d19, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
vsri.u8 d6, d6, #5 vsri.u8 d6, d6, #5
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
vmvn.8 d3, d3 vmvn.8 d3, d3
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vsri.u8 d7, d7, #6 vsri.u8 d7, d7, #6
vshrn.u16 d30, q2, #2 vshrn.u16 d30, q2, #2
vmull.u8 q10, d3, d6 vmull.u8 q10, d3, d6
@ -277,18 +275,18 @@
vmull.u8 q12, d3, d30 vmull.u8 q12, d3, d30
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vsri.u16 q14, q8, #5 vsri.u16 q14, q8, #5
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vshll.u8 q9, d18, #8 vshll.u8 q9, d18, #8
vrshr.u16 q13, q10, #8 vrshr.u16 q13, q10, #8
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vrshr.u16 q3, q11, #8 vrshr.u16 q3, q11, #8
vrshr.u16 q15, q12, #8 vrshr.u16 q15, q12, #8
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vsri.u16 q14, q9, #11 vsri.u16 q14, q9, #11
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vraddhn.u16 d20, q10, q13 vraddhn.u16 d20, q10, q13
vraddhn.u16 d23, q11, q3 vraddhn.u16 d23, q11, q3
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vraddhn.u16 d22, q12, q15 vraddhn.u16 d22, q12, q15
vst1.16 {d28, d29}, [DST_W, :128]! vst1.16 {d28, d29}, [DST_W, :128]!
.endm .endm
@ -436,20 +434,20 @@ generate_composite_function \
.macro pixman_composite_src_8888_0565_process_pixblock_tail_head .macro pixman_composite_src_8888_0565_process_pixblock_tail_head
vsri.u16 q14, q8, #5 vsri.u16 q14, q8, #5
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
fetch_src_pixblock fetch_src_pixblock
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vsri.u16 q14, q9, #11 vsri.u16 q14, q9, #11
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
vshll.u8 q8, d1, #8 vshll.u8 q8, d1, #8
vst1.16 {d28, d29}, [DST_W, :128]! vst1.16 {d28, d29}, [DST_W, :128]!
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vshll.u8 q14, d2, #8 vshll.u8 q14, d2, #8
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vshll.u8 q9, d0, #8 vshll.u8 q9, d0, #8
.endm .endm
@ -511,20 +509,20 @@ generate_composite_function \
.macro pixman_composite_add_8_8_process_pixblock_tail_head .macro pixman_composite_add_8_8_process_pixblock_tail_head
fetch_src_pixblock fetch_src_pixblock
PF add, PF_X, PF_X, #32 PF add PF_X, PF_X, #32
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
vld1.8 {d4, d5, d6, d7}, [DST_R, :128]! vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
PF addne, PF_X, PF_X, #32 PF addne PF_X, PF_X, #32
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vst1.8 {d28, d29, d30, d31}, [DST_W, :128]! vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vqadd.u8 q14, q0, q2 vqadd.u8 q14, q0, q2
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vqadd.u8 q15, q1, q3 vqadd.u8 q15, q1, q3
.endm .endm
@ -543,20 +541,20 @@ generate_composite_function \
.macro pixman_composite_add_8888_8888_process_pixblock_tail_head .macro pixman_composite_add_8888_8888_process_pixblock_tail_head
fetch_src_pixblock fetch_src_pixblock
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
vld1.32 {d4, d5, d6, d7}, [DST_R, :128]! vld1.32 {d4, d5, d6, d7}, [DST_R, :128]!
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vst1.32 {d28, d29, d30, d31}, [DST_W, :128]! vst1.32 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vqadd.u8 q14, q0, q2 vqadd.u8 q14, q0, q2
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vqadd.u8 q15, q1, q3 vqadd.u8 q15, q1, q3
.endm .endm
@ -606,16 +604,16 @@ generate_composite_function_single_scanline \
.macro pixman_composite_out_reverse_8888_8888_process_pixblock_tail_head .macro pixman_composite_out_reverse_8888_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]! vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vrshr.u16 q14, q8, #8 vrshr.u16 q14, q8, #8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
vrshr.u16 q15, q9, #8 vrshr.u16 q15, q9, #8
vrshr.u16 q12, q10, #8 vrshr.u16 q12, q10, #8
vrshr.u16 q13, q11, #8 vrshr.u16 q13, q11, #8
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vraddhn.u16 d28, q14, q8 vraddhn.u16 d28, q14, q8
vraddhn.u16 d29, q15, q9 vraddhn.u16 d29, q15, q9
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vraddhn.u16 d30, q12, q10 vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11 vraddhn.u16 d31, q13, q11
fetch_src_pixblock fetch_src_pixblock
@ -623,13 +621,13 @@ generate_composite_function_single_scanline \
vmvn.8 d22, d3 vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q8, d22, d4 vmull.u8 q8, d22, d4
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d22, d5 vmull.u8 q9, d22, d5
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vmull.u8 q10, d22, d6 vmull.u8 q10, d22, d6
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vmull.u8 q11, d22, d7 vmull.u8 q11, d22, d7
.endm .endm
@ -658,16 +656,16 @@ generate_composite_function_single_scanline \
.macro pixman_composite_over_8888_8888_process_pixblock_tail_head .macro pixman_composite_over_8888_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]! vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vrshr.u16 q14, q8, #8 vrshr.u16 q14, q8, #8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
vrshr.u16 q15, q9, #8 vrshr.u16 q15, q9, #8
vrshr.u16 q12, q10, #8 vrshr.u16 q12, q10, #8
vrshr.u16 q13, q11, #8 vrshr.u16 q13, q11, #8
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vraddhn.u16 d28, q14, q8 vraddhn.u16 d28, q14, q8
vraddhn.u16 d29, q15, q9 vraddhn.u16 d29, q15, q9
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vraddhn.u16 d30, q12, q10 vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11 vraddhn.u16 d31, q13, q11
vqadd.u8 q14, q0, q14 vqadd.u8 q14, q0, q14
@ -677,13 +675,13 @@ generate_composite_function_single_scanline \
vmvn.8 d22, d3 vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q8, d22, d4 vmull.u8 q8, d22, d4
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d22, d5 vmull.u8 q9, d22, d5
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
vmull.u8 q10, d22, d6 vmull.u8 q10, d22, d6
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vmull.u8 q11, d22, d7 vmull.u8 q11, d22, d7
.endm .endm
@ -744,20 +742,20 @@ generate_composite_function_single_scanline \
vraddhn.u16 d31, q3, q11 vraddhn.u16 d31, q3, q11
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]! vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vqadd.u8 q14, q0, q14 vqadd.u8 q14, q0, q14
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0x0F PF tst PF_CTL, #0x0F
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vqadd.u8 q15, q1, q15 vqadd.u8 q15, q1, q15
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vmull.u8 q8, d24, d4 vmull.u8 q8, d24, d4
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vmull.u8 q9, d24, d5 vmull.u8 q9, d24, d5
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q10, d24, d6 vmull.u8 q10, d24, d6
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q11, d24, d7 vmull.u8 q11, d24, d7
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
.endm .endm
@ -786,16 +784,16 @@ generate_composite_function \
.macro pixman_composite_over_reverse_n_8888_process_pixblock_tail_head .macro pixman_composite_over_reverse_n_8888_process_pixblock_tail_head
vrshr.u16 q14, q8, #8 vrshr.u16 q14, q8, #8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
vrshr.u16 q15, q9, #8 vrshr.u16 q15, q9, #8
vrshr.u16 q12, q10, #8 vrshr.u16 q12, q10, #8
vrshr.u16 q13, q11, #8 vrshr.u16 q13, q11, #8
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vraddhn.u16 d28, q14, q8 vraddhn.u16 d28, q14, q8
vraddhn.u16 d29, q15, q9 vraddhn.u16 d29, q15, q9
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vraddhn.u16 d30, q12, q10 vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11 vraddhn.u16 d31, q13, q11
vqadd.u8 q14, q0, q14 vqadd.u8 q14, q0, q14
@ -804,12 +802,12 @@ generate_composite_function \
vmvn.8 d22, d3 vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q8, d22, d4 vmull.u8 q8, d22, d4
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d22, d5 vmull.u8 q9, d22, d5
vmull.u8 q10, d22, d6 vmull.u8 q10, d22, d6
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vmull.u8 q11, d22, d7 vmull.u8 q11, d22, d7
.endm .endm
@ -1247,23 +1245,23 @@ generate_composite_function \
.macro pixman_composite_src_n_8_8888_process_pixblock_tail_head .macro pixman_composite_src_n_8_8888_process_pixblock_tail_head
fetch_mask_pixblock fetch_mask_pixblock
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
vrshrn.u16 d28, q8, #8 vrshrn.u16 d28, q8, #8
PF tst, PF_CTL, #0x0F PF tst PF_CTL, #0x0F
vrshrn.u16 d29, q9, #8 vrshrn.u16 d29, q9, #8
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
vrshrn.u16 d30, q10, #8 vrshrn.u16 d30, q10, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vrshrn.u16 d31, q11, #8 vrshrn.u16 d31, q11, #8
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vmull.u8 q8, d24, d0 vmull.u8 q8, d24, d0
PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift] PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
vmull.u8 q9, d24, d1 vmull.u8 q9, d24, d1
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q10, d24, d2 vmull.u8 q10, d24, d2
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q11, d24, d3 vmull.u8 q11, d24, d3
PF ldrbge, DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]! PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
vrsra.u16 q8, q8, #8 vrsra.u16 q8, q8, #8
vrsra.u16 q9, q9, #8 vrsra.u16 q9, q9, #8
@ -1316,23 +1314,23 @@ generate_composite_function \
.macro pixman_composite_src_n_8_8_process_pixblock_tail_head .macro pixman_composite_src_n_8_8_process_pixblock_tail_head
fetch_mask_pixblock fetch_mask_pixblock
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
vrshrn.u16 d28, q0, #8 vrshrn.u16 d28, q0, #8
PF tst, PF_CTL, #0x0F PF tst PF_CTL, #0x0F
vrshrn.u16 d29, q1, #8 vrshrn.u16 d29, q1, #8
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
vrshrn.u16 d30, q2, #8 vrshrn.u16 d30, q2, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vrshrn.u16 d31, q3, #8 vrshrn.u16 d31, q3, #8
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vmull.u8 q0, d24, d16 vmull.u8 q0, d24, d16
PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift] PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
vmull.u8 q1, d25, d16 vmull.u8 q1, d25, d16
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q2, d26, d16 vmull.u8 q2, d26, d16
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q3, d27, d16 vmull.u8 q3, d27, d16
PF ldrbge, DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]! PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
vst1.8 {d28, d29, d30, d31}, [DST_W, :128]! vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
vrsra.u16 q0, q0, #8 vrsra.u16 q0, q0, #8
vrsra.u16 q1, q1, #8 vrsra.u16 q1, q1, #8
@ -1410,27 +1408,27 @@ generate_composite_function \
vrshr.u16 q15, q9, #8 vrshr.u16 q15, q9, #8
fetch_mask_pixblock fetch_mask_pixblock
vrshr.u16 q6, q10, #8 vrshr.u16 q6, q10, #8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
vrshr.u16 q7, q11, #8 vrshr.u16 q7, q11, #8
PF tst, PF_CTL, #0x0F PF tst PF_CTL, #0x0F
vraddhn.u16 d28, q14, q8 vraddhn.u16 d28, q14, q8
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
vraddhn.u16 d29, q15, q9 vraddhn.u16 d29, q15, q9
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vraddhn.u16 d30, q6, q10 vraddhn.u16 d30, q6, q10
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
vraddhn.u16 d31, q7, q11 vraddhn.u16 d31, q7, q11
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
vmull.u8 q6, d24, d8 vmull.u8 q6, d24, d8
PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift] PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift]
vmull.u8 q7, d24, d9 vmull.u8 q7, d24, d9
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
vmull.u8 q8, d24, d10 vmull.u8 q8, d24, d10
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
vmull.u8 q9, d24, d11 vmull.u8 q9, d24, d11
PF ldrbge, DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]!
vqadd.u8 q14, q0, q14 vqadd.u8 q14, q0, q14
PF ldrbge, DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]! PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]!
vqadd.u8 q15, q1, q15 vqadd.u8 q15, q1, q15
vrshr.u16 q10, q6, #8 vrshr.u16 q10, q6, #8
vrshr.u16 q11, q7, #8 vrshr.u16 q11, q7, #8
@ -2427,21 +2425,21 @@ generate_composite_function \
vrshr.u16 q13, q10, #8 vrshr.u16 q13, q10, #8
fetch_src_pixblock fetch_src_pixblock
vraddhn.u16 d30, q11, q8 vraddhn.u16 d30, q11, q8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vraddhn.u16 d29, q12, q9 vraddhn.u16 d29, q12, q9
vraddhn.u16 d28, q13, q10 vraddhn.u16 d28, q13, q10
vmull.u8 q8, d3, d0 vmull.u8 q8, d3, d0
vmull.u8 q9, d3, d1 vmull.u8 q9, d3, d1
vmull.u8 q10, d3, d2 vmull.u8 q10, d3, d2
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
.endm .endm
generate_composite_function \ generate_composite_function \
@ -2484,21 +2482,21 @@ generate_composite_function \
vrshr.u16 q13, q10, #8 vrshr.u16 q13, q10, #8
fetch_src_pixblock fetch_src_pixblock
vraddhn.u16 d28, q11, q8 vraddhn.u16 d28, q11, q8
PF add, PF_X, PF_X, #8 PF add PF_X, PF_X, #8
PF tst, PF_CTL, #0xF PF tst PF_CTL, #0xF
PF addne, PF_X, PF_X, #8 PF addne PF_X, PF_X, #8
PF subne, PF_CTL, PF_CTL, #1 PF subne PF_CTL, PF_CTL, #1
vraddhn.u16 d29, q12, q9 vraddhn.u16 d29, q12, q9
vraddhn.u16 d30, q13, q10 vraddhn.u16 d30, q13, q10
vmull.u8 q8, d3, d0 vmull.u8 q8, d3, d0
vmull.u8 q9, d3, d1 vmull.u8 q9, d3, d1
vmull.u8 q10, d3, d2 vmull.u8 q10, d3, d2
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]! vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp, PF_X, ORIG_W PF cmp PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF subge, PF_X, PF_X, ORIG_W PF subge PF_X, PF_X, ORIG_W
PF subsge, PF_CTL, PF_CTL, #0x10 PF subges PF_CTL, PF_CTL, #0x10
PF ldrbge, DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]!
.endm .endm
generate_composite_function \ generate_composite_function \
@ -2843,28 +2841,28 @@ generate_composite_function_nearest_scanline \
mov TMP1, X, asr #16 mov TMP1, X, asr #16
add X, X, UX add X, X, UX
add TMP1, TOP, TMP1, asl #2 add TMP1, TOP, TMP1, asl #2
vld1.32 {\reg1}, [TMP1], STRIDE vld1.32 {reg1}, [TMP1], STRIDE
vld1.32 {\reg2}, [TMP1] vld1.32 {reg2}, [TMP1]
.endm .endm
.macro bilinear_load_0565 reg1, reg2, tmp .macro bilinear_load_0565 reg1, reg2, tmp
mov TMP1, X, asr #16 mov TMP1, X, asr #16
add X, X, UX add X, X, UX
add TMP1, TOP, TMP1, asl #1 add TMP1, TOP, TMP1, asl #1
vld1.32 {\reg2[0]}, [TMP1], STRIDE vld1.32 {reg2[0]}, [TMP1], STRIDE
vld1.32 {\reg2[1]}, [TMP1] vld1.32 {reg2[1]}, [TMP1]
convert_four_0565_to_x888_packed \reg2, \reg1, \reg2, \tmp convert_four_0565_to_x888_packed reg2, reg1, reg2, tmp
.endm .endm
.macro bilinear_load_and_vertical_interpolate_two_8888 \ .macro bilinear_load_and_vertical_interpolate_two_8888 \
acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2 acc1, acc2, reg1, reg2, reg3, reg4, tmp1, tmp2
bilinear_load_8888 \reg1, \reg2, \tmp1 bilinear_load_8888 reg1, reg2, tmp1
vmull.u8 \acc1, \reg1, d28 vmull.u8 acc1, reg1, d28
vmlal.u8 \acc1, \reg2, d29 vmlal.u8 acc1, reg2, d29
bilinear_load_8888 \reg3, \reg4, \tmp2 bilinear_load_8888 reg3, reg4, tmp2
vmull.u8 \acc2, \reg3, d28 vmull.u8 acc2, reg3, d28
vmlal.u8 \acc2, \reg4, d29 vmlal.u8 acc2, reg4, d29
.endm .endm
.macro bilinear_load_and_vertical_interpolate_four_8888 \ .macro bilinear_load_and_vertical_interpolate_four_8888 \
@ -2872,9 +2870,9 @@ generate_composite_function_nearest_scanline \
yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \ bilinear_load_and_vertical_interpolate_two_8888 \
\xacc1, \xacc2, \xreg1, \xreg2, \xreg3, \xreg4, \xacc2lo, \xacc2hi xacc1, xacc2, xreg1, xreg2, xreg3, xreg4, xacc2lo, xacc2hi
bilinear_load_and_vertical_interpolate_two_8888 \ bilinear_load_and_vertical_interpolate_two_8888 \
\yacc1, \yacc2, \yreg1, \yreg2, \yreg3, \yreg4, \yacc2lo, \yacc2hi yacc1, yacc2, yreg1, yreg2, yreg3, yreg4, yacc2lo, yacc2hi
.endm .endm
.macro bilinear_load_and_vertical_interpolate_two_0565 \ .macro bilinear_load_and_vertical_interpolate_two_0565 \
@ -2886,19 +2884,19 @@ generate_composite_function_nearest_scanline \
mov TMP2, X, asr #16 mov TMP2, X, asr #16
add X, X, UX add X, X, UX
add TMP2, TOP, TMP2, asl #1 add TMP2, TOP, TMP2, asl #1
vld1.32 {\acc2lo[0]}, [TMP1], STRIDE vld1.32 {acc2lo[0]}, [TMP1], STRIDE
vld1.32 {\acc2hi[0]}, [TMP2], STRIDE vld1.32 {acc2hi[0]}, [TMP2], STRIDE
vld1.32 {\acc2lo[1]}, [TMP1] vld1.32 {acc2lo[1]}, [TMP1]
vld1.32 {\acc2hi[1]}, [TMP2] vld1.32 {acc2hi[1]}, [TMP2]
convert_0565_to_x888 \acc2, \reg3, \reg2, \reg1 convert_0565_to_x888 acc2, reg3, reg2, reg1
vzip.u8 \reg1, \reg3 vzip.u8 reg1, reg3
vzip.u8 \reg2, \reg4 vzip.u8 reg2, reg4
vzip.u8 \reg3, \reg4 vzip.u8 reg3, reg4
vzip.u8 \reg1, \reg2 vzip.u8 reg1, reg2
vmull.u8 \acc1, \reg1, d28 vmull.u8 acc1, reg1, d28
vmlal.u8 \acc1, \reg2, d29 vmlal.u8 acc1, reg2, d29
vmull.u8 \acc2, \reg3, d28 vmull.u8 acc2, reg3, d28
vmlal.u8 \acc2, \reg4, d29 vmlal.u8 acc2, reg4, d29
.endm .endm
.macro bilinear_load_and_vertical_interpolate_four_0565 \ .macro bilinear_load_and_vertical_interpolate_four_0565 \
@ -2911,49 +2909,49 @@ generate_composite_function_nearest_scanline \
mov TMP2, X, asr #16 mov TMP2, X, asr #16
add X, X, UX add X, X, UX
add TMP2, TOP, TMP2, asl #1 add TMP2, TOP, TMP2, asl #1
vld1.32 {\xacc2lo[0]}, [TMP1], STRIDE vld1.32 {xacc2lo[0]}, [TMP1], STRIDE
vld1.32 {\xacc2hi[0]}, [TMP2], STRIDE vld1.32 {xacc2hi[0]}, [TMP2], STRIDE
vld1.32 {\xacc2lo[1]}, [TMP1] vld1.32 {xacc2lo[1]}, [TMP1]
vld1.32 {\xacc2hi[1]}, [TMP2] vld1.32 {xacc2hi[1]}, [TMP2]
convert_0565_to_x888 \xacc2, \xreg3, \xreg2, \xreg1 convert_0565_to_x888 xacc2, xreg3, xreg2, xreg1
mov TMP1, X, asr #16 mov TMP1, X, asr #16
add X, X, UX add X, X, UX
add TMP1, TOP, TMP1, asl #1 add TMP1, TOP, TMP1, asl #1
mov TMP2, X, asr #16 mov TMP2, X, asr #16
add X, X, UX add X, X, UX
add TMP2, TOP, TMP2, asl #1 add TMP2, TOP, TMP2, asl #1
vld1.32 {\yacc2lo[0]}, [TMP1], STRIDE vld1.32 {yacc2lo[0]}, [TMP1], STRIDE
vzip.u8 \xreg1, \xreg3 vzip.u8 xreg1, xreg3
vld1.32 {\yacc2hi[0]}, [TMP2], STRIDE vld1.32 {yacc2hi[0]}, [TMP2], STRIDE
vzip.u8 \xreg2, \xreg4 vzip.u8 xreg2, xreg4
vld1.32 {\yacc2lo[1]}, [TMP1] vld1.32 {yacc2lo[1]}, [TMP1]
vzip.u8 \xreg3, \xreg4 vzip.u8 xreg3, xreg4
vld1.32 {\yacc2hi[1]}, [TMP2] vld1.32 {yacc2hi[1]}, [TMP2]
vzip.u8 \xreg1, \xreg2 vzip.u8 xreg1, xreg2
convert_0565_to_x888 \yacc2, \yreg3, \yreg2, \yreg1 convert_0565_to_x888 yacc2, yreg3, yreg2, yreg1
vmull.u8 \xacc1, \xreg1, d28 vmull.u8 xacc1, xreg1, d28
vzip.u8 \yreg1, \yreg3 vzip.u8 yreg1, yreg3
vmlal.u8 \xacc1, \xreg2, d29 vmlal.u8 xacc1, xreg2, d29
vzip.u8 \yreg2, \yreg4 vzip.u8 yreg2, yreg4
vmull.u8 \xacc2, \xreg3, d28 vmull.u8 xacc2, xreg3, d28
vzip.u8 \yreg3, \yreg4 vzip.u8 yreg3, yreg4
vmlal.u8 \xacc2, \xreg4, d29 vmlal.u8 xacc2, xreg4, d29
vzip.u8 \yreg1, \yreg2 vzip.u8 yreg1, yreg2
vmull.u8 \yacc1, \yreg1, d28 vmull.u8 yacc1, yreg1, d28
vmlal.u8 \yacc1, \yreg2, d29 vmlal.u8 yacc1, yreg2, d29
vmull.u8 \yacc2, \yreg3, d28 vmull.u8 yacc2, yreg3, d28
vmlal.u8 \yacc2, \yreg4, d29 vmlal.u8 yacc2, yreg4, d29
.endm .endm
.macro bilinear_store_8888 numpix, tmp1, tmp2 .macro bilinear_store_8888 numpix, tmp1, tmp2
.if \numpix == 4 .if numpix == 4
vst1.32 {d0, d1}, [OUT, :128]! vst1.32 {d0, d1}, [OUT, :128]!
.elseif \numpix == 2 .elseif numpix == 2
vst1.32 {d0}, [OUT, :64]! vst1.32 {d0}, [OUT, :64]!
.elseif \numpix == 1 .elseif numpix == 1
vst1.32 {d0[0]}, [OUT, :32]! vst1.32 {d0[0]}, [OUT, :32]!
.else .else
.error bilinear_store_8888 \numpix is unsupported .error bilinear_store_8888 numpix is unsupported
.endif .endif
.endm .endm
@ -2962,20 +2960,20 @@ generate_composite_function_nearest_scanline \
vuzp.u8 d2, d3 vuzp.u8 d2, d3
vuzp.u8 d1, d3 vuzp.u8 d1, d3
vuzp.u8 d0, d2 vuzp.u8 d0, d2
convert_8888_to_0565 d2, d1, d0, q1, \tmp1, \tmp2 convert_8888_to_0565 d2, d1, d0, q1, tmp1, tmp2
.if \numpix == 4 .if numpix == 4
vst1.16 {d2}, [OUT, :64]! vst1.16 {d2}, [OUT, :64]!
.elseif \numpix == 2 .elseif numpix == 2
vst1.32 {d2[0]}, [OUT, :32]! vst1.32 {d2[0]}, [OUT, :32]!
.elseif \numpix == 1 .elseif numpix == 1
vst1.16 {d2[0]}, [OUT, :16]! vst1.16 {d2[0]}, [OUT, :16]!
.else .else
.error bilinear_store_0565 \numpix is unsupported .error bilinear_store_0565 numpix is unsupported
.endif .endif
.endm .endm
.macro bilinear_interpolate_last_pixel src_fmt, dst_fmt .macro bilinear_interpolate_last_pixel src_fmt, dst_fmt
bilinear_load_\()\src_fmt d0, d1, d2 bilinear_load_&src_fmt d0, d1, d2
vmull.u8 q1, d0, d28 vmull.u8 q1, d0, d28
vmlal.u8 q1, d1, d29 vmlal.u8 q1, d1, d29
/* 5 cycles bubble */ /* 5 cycles bubble */
@ -2987,11 +2985,11 @@ generate_composite_function_nearest_scanline \
/* 3 cycles bubble */ /* 3 cycles bubble */
vmovn.u16 d0, q0 vmovn.u16 d0, q0
/* 1 cycle bubble */ /* 1 cycle bubble */
bilinear_store_\()\dst_fmt 1, q2, q3 bilinear_store_&dst_fmt 1, q2, q3
.endm .endm
.macro bilinear_interpolate_two_pixels src_fmt, dst_fmt .macro bilinear_interpolate_two_pixels src_fmt, dst_fmt
bilinear_load_and_vertical_interpolate_two_\()\src_fmt \ bilinear_load_and_vertical_interpolate_two_&src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23 q1, q11, d0, d1, d20, d21, d22, d23
vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
vmlsl.u16 q0, d2, d30 vmlsl.u16 q0, d2, d30
@ -3004,11 +3002,11 @@ generate_composite_function_nearest_scanline \
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS) vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13 vadd.u16 q12, q12, q13
vmovn.u16 d0, q0 vmovn.u16 d0, q0
bilinear_store_\()\dst_fmt 2, q2, q3 bilinear_store_&dst_fmt 2, q2, q3
.endm .endm
.macro bilinear_interpolate_four_pixels src_fmt, dst_fmt .macro bilinear_interpolate_four_pixels src_fmt, dst_fmt
bilinear_load_and_vertical_interpolate_four_\()\src_fmt \ bilinear_load_and_vertical_interpolate_four_&src_fmt \
q1, q11, d0, d1, d20, d21, d22, d23 \ q1, q11, d0, d1, d20, d21, d22, d23 \
q3, q9, d4, d5, d16, d17, d18, d19 q3, q9, d4, d5, d16, d17, d18, d19
pld [TMP1, PF_OFFS] pld [TMP1, PF_OFFS]
@ -3036,54 +3034,54 @@ generate_composite_function_nearest_scanline \
vmovn.u16 d0, q0 vmovn.u16 d0, q0
vmovn.u16 d1, q2 vmovn.u16 d1, q2
vadd.u16 q12, q12, q13 vadd.u16 q12, q12, q13
bilinear_store_\()\dst_fmt 4, q2, q3 bilinear_store_&dst_fmt 4, q2, q3
.endm .endm
.macro bilinear_interpolate_four_pixels_head src_fmt, dst_fmt .macro bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt .ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_head bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_head
.else .else
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt bilinear_interpolate_four_pixels src_fmt, dst_fmt
.endif .endif
.endm .endm
.macro bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt .macro bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt .ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_tail
.endif .endif
.endm .endm
.macro bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt .macro bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt .ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_four_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail_head bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt&_tail_head
.else .else
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt bilinear_interpolate_four_pixels src_fmt, dst_fmt
.endif .endif
.endm .endm
.macro bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt .macro bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt .ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_head bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_head
.else .else
bilinear_interpolate_four_pixels_head \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
.endif .endif
.endm .endm
.macro bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt .macro bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt .ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_tail
.else .else
bilinear_interpolate_four_pixels_tail \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt
.endif .endif
.endm .endm
.macro bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt .macro bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt
.ifdef have_bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt .ifdef have_bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt
bilinear_interpolate_eight_pixels_\()\src_fmt\()_\()\dst_fmt\()_tail_head bilinear_interpolate_eight_pixels_&src_fmt&_&dst_fmt&_tail_head
.else .else
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
.endif .endif
.endm .endm
@ -3108,7 +3106,7 @@ generate_composite_function_nearest_scanline \
src_bpp_shift, dst_bpp_shift, \ src_bpp_shift, dst_bpp_shift, \
prefetch_distance, flags prefetch_distance, flags
pixman_asm_function \fname pixman_asm_function fname
OUT .req r0 OUT .req r0
TOP .req r1 TOP .req r1
BOTTOM .req r2 BOTTOM .req r2
@ -3126,11 +3124,11 @@ pixman_asm_function \fname
mov ip, sp mov ip, sp
push {r4, r5, r6, r7, r8, r9} push {r4, r5, r6, r7, r8, r9}
mov PF_OFFS, #\prefetch_distance mov PF_OFFS, #prefetch_distance
ldmia ip, {WB, X, UX, WIDTH} ldmia ip, {WB, X, UX, WIDTH}
mul PF_OFFS, PF_OFFS, UX mul PF_OFFS, PF_OFFS, UX
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0 .if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpush {d8-d15} vpush {d8-d15}
.endif .endif
@ -3149,11 +3147,11 @@ pixman_asm_function \fname
/* ensure good destination alignment */ /* ensure good destination alignment */
cmp WIDTH, #1 cmp WIDTH, #1
blt 0f blt 0f
tst OUT, #(1 << \dst_bpp_shift) tst OUT, #(1 << dst_bpp_shift)
beq 0f beq 0f
vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS) vshr.u16 q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
vadd.u16 q12, q12, q13 vadd.u16 q12, q12, q13
bilinear_interpolate_last_pixel \src_fmt, \dst_fmt bilinear_interpolate_last_pixel src_fmt, dst_fmt
sub WIDTH, WIDTH, #1 sub WIDTH, WIDTH, #1
0: 0:
vadd.u16 q13, q13, q13 vadd.u16 q13, q13, q13
@ -3162,64 +3160,64 @@ pixman_asm_function \fname
cmp WIDTH, #2 cmp WIDTH, #2
blt 0f blt 0f
tst OUT, #(1 << (\dst_bpp_shift + 1)) tst OUT, #(1 << (dst_bpp_shift + 1))
beq 0f beq 0f
bilinear_interpolate_two_pixels \src_fmt, \dst_fmt bilinear_interpolate_two_pixels src_fmt, dst_fmt
sub WIDTH, WIDTH, #2 sub WIDTH, WIDTH, #2
0: 0:
.if ((\flags) & BILINEAR_FLAG_UNROLL_8) != 0 .if ((flags) & BILINEAR_FLAG_UNROLL_8) != 0
/*********** 8 pixels per iteration *****************/ /*********** 8 pixels per iteration *****************/
cmp WIDTH, #4 cmp WIDTH, #4
blt 0f blt 0f
tst OUT, #(1 << (\dst_bpp_shift + 2)) tst OUT, #(1 << (dst_bpp_shift + 2))
beq 0f beq 0f
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt bilinear_interpolate_four_pixels src_fmt, dst_fmt
sub WIDTH, WIDTH, #4 sub WIDTH, WIDTH, #4
0: 0:
subs WIDTH, WIDTH, #8 subs WIDTH, WIDTH, #8
blt 1f blt 1f
mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift) mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift)
bilinear_interpolate_eight_pixels_head \src_fmt, \dst_fmt bilinear_interpolate_eight_pixels_head src_fmt, dst_fmt
subs WIDTH, WIDTH, #8 subs WIDTH, WIDTH, #8
blt 5f blt 5f
0: 0:
bilinear_interpolate_eight_pixels_tail_head \src_fmt, \dst_fmt bilinear_interpolate_eight_pixels_tail_head src_fmt, dst_fmt
subs WIDTH, WIDTH, #8 subs WIDTH, WIDTH, #8
bge 0b bge 0b
5: 5:
bilinear_interpolate_eight_pixels_tail \src_fmt, \dst_fmt bilinear_interpolate_eight_pixels_tail src_fmt, dst_fmt
1: 1:
tst WIDTH, #4 tst WIDTH, #4
beq 2f beq 2f
bilinear_interpolate_four_pixels \src_fmt, \dst_fmt bilinear_interpolate_four_pixels src_fmt, dst_fmt
2: 2:
.else .else
/*********** 4 pixels per iteration *****************/ /*********** 4 pixels per iteration *****************/
subs WIDTH, WIDTH, #4 subs WIDTH, WIDTH, #4
blt 1f blt 1f
mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift) mov PF_OFFS, PF_OFFS, asr #(16 - src_bpp_shift)
bilinear_interpolate_four_pixels_head \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
subs WIDTH, WIDTH, #4 subs WIDTH, WIDTH, #4
blt 5f blt 5f
0: 0:
bilinear_interpolate_four_pixels_tail_head \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_tail_head src_fmt, dst_fmt
subs WIDTH, WIDTH, #4 subs WIDTH, WIDTH, #4
bge 0b bge 0b
5: 5:
bilinear_interpolate_four_pixels_tail \src_fmt, \dst_fmt bilinear_interpolate_four_pixels_tail src_fmt, dst_fmt
1: 1:
/****************************************************/ /****************************************************/
.endif .endif
/* handle the remaining trailing pixels */ /* handle the remaining trailing pixels */
tst WIDTH, #2 tst WIDTH, #2
beq 2f beq 2f
bilinear_interpolate_two_pixels \src_fmt, \dst_fmt bilinear_interpolate_two_pixels src_fmt, dst_fmt
2: 2:
tst WIDTH, #1 tst WIDTH, #1
beq 3f beq 3f
bilinear_interpolate_last_pixel \src_fmt, \dst_fmt bilinear_interpolate_last_pixel src_fmt, dst_fmt
3: 3:
.if ((\flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0 .if ((flags) & BILINEAR_FLAG_USE_ALL_NEON_REGS) != 0
vpop {d8-d15} vpop {d8-d15}
.endif .endif
pop {r4, r5, r6, r7, r8, r9} pop {r4, r5, r6, r7, r8, r9}
@ -3238,7 +3236,7 @@ pixman_asm_function \fname
.unreq TMP3 .unreq TMP3
.unreq TMP4 .unreq TMP4
.unreq STRIDE .unreq STRIDE
pixman_end_asm_function .endfunc
.endm .endm

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <pixman-config.h> #include <config.h>
#endif #endif
#include <string.h> #include <string.h>
@ -194,7 +194,7 @@ arm_neon_fill (pixman_implementation_t *imp,
uint32_t _xor) uint32_t _xor)
{ {
/* stride is always multiple of 32bit units in pixman */ /* stride is always multiple of 32bit units in pixman */
int32_t byte_stride = stride * sizeof(uint32_t); uint32_t byte_stride = stride * sizeof(uint32_t);
switch (bpp) switch (bpp)
{ {
@ -331,7 +331,6 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, a8, b5g6r5, neon_composite_over_8888_8_0565), PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, a8, b5g6r5, neon_composite_over_8888_8_0565),
PIXMAN_STD_FAST_PATH (OVER, r5g6b5, a8, r5g6b5, neon_composite_over_0565_8_0565), PIXMAN_STD_FAST_PATH (OVER, r5g6b5, a8, r5g6b5, neon_composite_over_0565_8_0565),
PIXMAN_STD_FAST_PATH (OVER, b5g6r5, a8, b5g6r5, neon_composite_over_0565_8_0565), PIXMAN_STD_FAST_PATH (OVER, b5g6r5, a8, b5g6r5, neon_composite_over_0565_8_0565),
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, x8r8g8b8, neon_composite_over_8888_8888_8888),
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, a8r8g8b8, neon_composite_over_8888_8888_8888), PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, a8r8g8b8, neon_composite_over_8888_8888_8888),
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, r5g6b5, neon_composite_over_8888_0565), PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, r5g6b5, neon_composite_over_8888_0565),
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, neon_composite_over_8888_0565), PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, neon_composite_over_8888_0565),
@ -342,33 +341,17 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER, x8r8g8b8, null, a8r8g8b8, neon_composite_src_x888_8888), PIXMAN_STD_FAST_PATH (OVER, x8r8g8b8, null, a8r8g8b8, neon_composite_src_x888_8888),
PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, null, a8b8g8r8, neon_composite_src_x888_8888), PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, null, a8b8g8r8, neon_composite_src_x888_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8, neon_composite_add_n_8_8), PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8, neon_composite_add_n_8_8),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, x8r8g8b8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8r8g8b8, neon_composite_add_n_8_8888), PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8r8g8b8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, x8b8g8r8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8b8g8r8, neon_composite_add_n_8_8888), PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8b8g8r8, neon_composite_add_n_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8, a8, a8, neon_composite_add_8_8_8), PIXMAN_STD_FAST_PATH (ADD, a8, a8, a8, neon_composite_add_8_8_8),
PIXMAN_STD_FAST_PATH (ADD, r5g6b5, a8, r5g6b5, neon_composite_add_0565_8_0565), PIXMAN_STD_FAST_PATH (ADD, r5g6b5, a8, r5g6b5, neon_composite_add_0565_8_0565),
PIXMAN_STD_FAST_PATH (ADD, b5g6r5, a8, b5g6r5, neon_composite_add_0565_8_0565), PIXMAN_STD_FAST_PATH (ADD, b5g6r5, a8, b5g6r5, neon_composite_add_0565_8_0565),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, a8, x8r8g8b8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8, x8r8g8b8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, x8b8g8r8, a8, x8b8g8r8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, a8, x8b8g8r8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8, a8r8g8b8, neon_composite_add_8888_8_8888), PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8, a8r8g8b8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, a8, a8b8g8r8, neon_composite_add_8888_8_8888), PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, a8, a8b8g8r8, neon_composite_add_8888_8_8888),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, a8r8g8b8, x8r8g8b8, neon_composite_add_8888_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, x8r8g8b8, neon_composite_add_8888_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, a8r8g8b8, neon_composite_add_8888_8888_8888), PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, a8r8g8b8, neon_composite_add_8888_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, solid, x8r8g8b8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, solid, x8r8g8b8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, x8b8g8r8, solid, x8b8g8r8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, solid, x8b8g8r8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, solid, a8r8g8b8, neon_composite_add_8888_n_8888), PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, solid, a8r8g8b8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, solid, a8b8g8r8, neon_composite_add_8888_n_8888), PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, solid, a8b8g8r8, neon_composite_add_8888_n_8888),
PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, neon_composite_add_8_8), PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, neon_composite_add_8_8),
PIXMAN_STD_FAST_PATH (ADD, x8r8g8b8, null, x8r8g8b8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, x8r8g8b8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, x8b8g8r8, null, x8b8g8r8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, x8b8g8r8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, neon_composite_add_8888_8888), PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, neon_composite_add_8888_8888), PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, neon_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (IN, solid, null, a8, neon_composite_in_n_8), PIXMAN_STD_FAST_PATH (IN, solid, null, a8, neon_composite_in_n_8),
@ -376,9 +359,7 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8b8g8r8, neon_composite_over_reverse_n_8888), PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8b8g8r8, neon_composite_over_reverse_n_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, r5g6b5, neon_composite_out_reverse_8_0565), PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, r5g6b5, neon_composite_out_reverse_8_0565),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, b5g6r5, neon_composite_out_reverse_8_0565), PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, b5g6r5, neon_composite_out_reverse_8_0565),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, x8r8g8b8, neon_composite_out_reverse_8_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, a8r8g8b8, neon_composite_out_reverse_8_8888), PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, a8r8g8b8, neon_composite_out_reverse_8_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, x8b8g8r8, neon_composite_out_reverse_8_8888),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, a8b8g8r8, neon_composite_out_reverse_8_8888), PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, a8b8g8r8, neon_composite_out_reverse_8_8888),
SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, neon_8888_8888), SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, neon_8888_8888),
@ -423,7 +404,6 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, neon_8888_8888), SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, neon_8888_8888),
SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, neon_8888_8888), SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, neon_8888_8888),
SIMPLE_BILINEAR_FAST_PATH (ADD, x8r8g8b8, x8r8g8b8, neon_8888_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, a8r8g8b8, neon_8888_8_8888), SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, a8r8g8b8, neon_8888_8_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, x8r8g8b8, neon_8888_8_8888), SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, x8r8g8b8, neon_8888_8_8888),
@ -440,7 +420,6 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, neon_8888_8_8888), SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, neon_8888_8_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, neon_8888_8_8888), SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, neon_8888_8_8888),
SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, x8r8g8b8, x8r8g8b8, neon_8888_8_8888),
{ PIXMAN_OP_NONE }, { PIXMAN_OP_NONE },
}; };

Some files were not shown because too many files have changed in this diff Show More