]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: unaligned VSX in memcpy/memmove expansion
authorAaron Sawdey <acsawdey@linux.ibm.com>
Sat, 8 Aug 2020 00:02:20 +0000 (19:02 -0500)
committerAaron Sawdey <acsawdey@linux.ibm.com>
Tue, 18 Aug 2020 19:16:45 +0000 (14:16 -0500)
commitafd9716398302920ac28a13d745424ff871e528b
tree2987f4f7f621504b0748559bf4422caf3e4d230e
parentea95ba8d582e967cdbfce95993e9bb6ad769c047
rs6000: unaligned VSX in memcpy/memmove expansion

This patch adds a few new instructions to inline expansion of
memcpy/memmove. Generation of all these are controlled by
the option -mblock-ops-unaligned-vsx which is set on by default if the
target has TARGET_EFFICIENT_UNALIGNED_VSX.
 * unaligned vsx load/store (V2DImode)
 * unaligned vsx pair load/store (POImode) which is also controlled
   by -mblock-ops-vector-pair in case it is not wanted at some point.
   The default for -mblock-ops-vector-pair is for it to be on if the
   target has TARGET_MMA and TARGET_EFFICIENT_UNALIGNED_VSX. This is
   redundant, but nice for the future to clearly specify what is
   required.
 * unaligned vsx lxvl/stxvl but generally only to do the remainder
   of a copy/move we stated with some vsx loads/stores, and also prefer
   to use lb/lh/lw/ld if the remainder is 1/2/4/8 bytes.

Testing of this is actually accomplished by gcc.dg/memcmp-1.c which does
two memcpy() for each memcmp(). If the memcpy() calls don't do the right
thing then the memcmp() will fail unexpectedly.

gcc/ChangeLog:

* config/rs6000/rs6000-string.c (gen_lxvl_stxvl_move):
Helper function.
(expand_block_move): Add lxvl/stxvl, vector pair, and
unaligned VSX.
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Default value for -mblock-ops-vector-pair.
* config/rs6000/rs6000.opt: Add -mblock-ops-vector-pair.
gcc/config/rs6000/rs6000-string.c
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.opt