GCC modified for the FreeChainXenon project
Find a file
Tamar Christina a89ac9011e AArch64: Add SVE2 implementation for pow2 bitmask division
In plenty of image and video processing code it's common to modify pixel values
by a widening operation and then scale them back into range by dividing by 255.

This patch adds an named function to allow us to emit an optimized sequence
when doing an unsigned division that is equivalent to:

   x = y / (2 ^ (bitsize (y)/2)-1)

For SVE2 this means we generate for:

void draw_bitmap1(uint8_t* restrict pixel, uint8_t level, int n)
{
  for (int i = 0; i < (n & -16); i+=1)
    pixel[i] = (pixel[i] * level) / 0xff;
}

the following:

        mov     z3.b, #1
.L3:
        ld1b    z0.h, p0/z, [x0, x3]
        mul     z0.h, p1/m, z0.h, z2.h
        addhnb  z1.b, z0.h, z3.h
        addhnb  z0.b, z0.h, z1.h
        st1b    z0.h, p0, [x0, x3]
        inch    x3
        whilelo p0.h, w3, w2
        b.any   .L3

instead of:

.L3:
        ld1b    z0.h, p1/z, [x0, x3]
        mul     z0.h, p0/m, z0.h, z1.h
        umulh   z0.h, p0/m, z0.h, z2.h
        lsr     z0.h, z0.h, #7
        st1b    z0.h, p1, [x0, x3]
        inch    x3
        whilelo p1.h, w3, w2
        b.any   .L3

Which results in significantly faster code.

gcc/ChangeLog:

	* config/aarch64/aarch64-sve2.md (@aarch64_bitmask_udiv<mode>3): New.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/sve2/div-by-bitmask_1.c: New test.
2022-11-14 17:41:33 +00:00
c++tools Daily bump. 2022-03-19 00:16:22 +00:00
config Revert "sphinx: support Sphinx in build system" 2022-11-14 09:35:06 +01:00
contrib gcc-changelog: temporarily disable check_line_start 2022-11-14 03:52:14 +01:00
fixincludes Daily bump. 2022-10-08 00:17:29 +00:00
gcc AArch64: Add SVE2 implementation for pow2 bitmask division 2022-11-14 17:41:33 +00:00
gnattools Daily bump. 2022-09-01 00:17:39 +00:00
gotools Daily bump. 2022-08-31 00:16:45 +00:00
include Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
INSTALL
intl
libada Daily bump. 2022-08-26 00:16:21 +00:00
libatomic Daily bump. 2022-10-20 00:17:52 +00:00
libbacktrace Daily bump. 2022-10-13 00:17:37 +00:00
libcc1 Daily bump. 2022-11-02 00:17:38 +00:00
libcody Daily bump. 2022-06-04 00:16:27 +00:00
libcpp Daily bump. 2022-11-06 11:05:22 +00:00
libdecnumber Daily bump. 2022-10-08 00:17:29 +00:00
libffi Daily bump. 2022-10-13 00:17:37 +00:00
libgcc Daily bump. 2022-11-06 11:05:22 +00:00
libgfortran Daily bump. 2022-10-13 00:17:37 +00:00
libgo runtime: use _libgo_off_t_type when calling C mmap 2022-10-27 17:12:57 -07:00
libgomp Revert "sphinx: copy files from texi2rst-generated repository" 2022-11-14 09:35:07 +01:00
libiberty Revert "sphinx: copy files from texi2rst-generated repository" 2022-11-14 09:35:07 +01:00
libitm Revert "sphinx: copy files from texi2rst-generated repository" 2022-11-14 09:35:07 +01:00
libobjc Daily bump. 2022-10-21 00:17:52 +00:00
libphobos Daily bump. 2022-11-06 11:05:22 +00:00
libquadmath Revert "sphinx: copy files from texi2rst-generated repository" 2022-11-14 09:35:07 +01:00
libsanitizer Daily bump. 2022-10-20 00:17:52 +00:00
libssp Daily bump. 2022-10-13 00:17:37 +00:00
libstdc++-v3 libstdc++: Fix installation of python files for debug lib 2022-11-14 15:59:50 +00:00
libvtv Daily bump. 2022-11-01 00:19:02 +00:00
lto-plugin Daily bump. 2022-10-13 00:17:37 +00:00
maintainer-scripts Revert "sphinx: add update_web_docs_git.py script" 2022-11-14 09:35:05 +01:00
zlib Daily bump. 2022-10-13 00:17:37 +00:00
.dir-locals.el
.gitattributes
.gitignore .gitignore: do not ignore config.h 2022-07-19 17:07:04 +03:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2022-11-14 00:17:08 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Revert "sphinx: support Sphinx in build system" 2022-11-14 09:35:06 +01:00
configure.ac Revert "sphinx: support Sphinx in build system" 2022-11-14 09:35:06 +01:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 Generic configury support for shared libs on VxWorks 2022-10-11 07:31:07 +00:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS Update email address 2022-10-31 11:15:45 +00:00
Makefile.def Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
Makefile.in Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
Makefile.tpl Makefile.def: drop remnants of unused libelf 2022-08-18 09:37:09 +01:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.