rs6000-p8swap.c (rs6000_sum_of_two_registers_p): New function.
authorKelvin Nilsen <kelvin@gcc.gnu.org>
Sun, 14 Jan 2018 05:19:29 +0000 (05:19 +0000)
committerKelvin Nilsen <kelvin@gcc.gnu.org>
Sun, 14 Jan 2018 05:19:29 +0000 (05:19 +0000)
commita3a821c903c9fa2288712d31da2038d0297babcb
tree0814f0d7d5cbfd6b7af7fdf2aaa8949fb1b9fad3
parentffad1c54d2e4b698bab8d198a65c6183e74449a8
rs6000-p8swap.c (rs6000_sum_of_two_registers_p): New function.

gcc/ChangeLog:

2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* config/rs6000/rs6000-p8swap.c (rs6000_sum_of_two_registers_p):
New function.
(rs6000_quadword_masked_address_p): Likewise.
(quad_aligned_load_p): Likewise.
(quad_aligned_store_p): Likewise.
(const_load_sequence_p): Add comment to describe the outer-most loop.
(mimic_memory_attributes_and_flags): New function.
(rs6000_gen_stvx): Likewise.
(replace_swapped_aligned_store): Likewise.
(rs6000_gen_lvx): Likewise.
(replace_swapped_aligned_load): Likewise.
(replace_swapped_load_constant): Capitalize argument name in
comment describing this function.
(rs6000_analyze_swaps): Add a third pass to search for vector loads
and stores that access quad-word aligned addresses and replace
with stvx or lvx instructions when appropriate.
* config/rs6000/rs6000-protos.h (rs6000_sum_of_two_registers_p):
New function prototype.
(rs6000_quadword_masked_address_p): Likewise.
(rs6000_gen_lvx): Likewise.
(rs6000_gen_stvx): Likewise.
* config/rs6000/vsx.md (*vsx_le_perm_load_<mode>): For modes
VSX_D (V2DF, V2DI), modify this split to select lvx instruction
when memory address is aligned.
(*vsx_le_perm_load_<mode>): For modes VSX_W (V4SF, V4SI), modify
this split to select lvx instruction when memory address is aligned.
(*vsx_le_perm_load_v8hi): Modify this split to select lvx
instruction when memory address is aligned.
(*vsx_le_perm_load_v16qi): Likewise.
(four unnamed splitters): Modify to select the stvx instruction
when memory is aligned.

gcc/testsuite/ChangeLog:

2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* gcc.target/powerpc/pr48857.c: Modify dejagnu directives to look
for lvx and stvx instead of lxvd2x and stxvd2x and require
little-endian target.  Add comments.
* gcc.target/powerpc/swaps-p8-28.c: Add functions for more
comprehensive testing.
* gcc.target/powerpc/swaps-p8-29.c: Likewise.
* gcc.target/powerpc/swaps-p8-30.c: Likewise.
* gcc.target/powerpc/swaps-p8-31.c: Likewise.
* gcc.target/powerpc/swaps-p8-32.c: Likewise.
* gcc.target/powerpc/swaps-p8-33.c: Likewise.
* gcc.target/powerpc/swaps-p8-34.c: Likewise.
* gcc.target/powerpc/swaps-p8-35.c: Likewise.
* gcc.target/powerpc/swaps-p8-36.c: Likewise.
* gcc.target/powerpc/swaps-p8-37.c: Likewise.
* gcc.target/powerpc/swaps-p8-38.c: Likewise.
* gcc.target/powerpc/swaps-p8-39.c: Likewise.
* gcc.target/powerpc/swaps-p8-40.c: Likewise.
* gcc.target/powerpc/swaps-p8-41.c: Likewise.
* gcc.target/powerpc/swaps-p8-42.c: Likewise.
* gcc.target/powerpc/swaps-p8-43.c: Likewise.
* gcc.target/powerpc/swaps-p8-44.c: Likewise.
* gcc.target/powerpc/swaps-p8-45.c: Likewise.
* gcc.target/powerpc/vec-extract-2.c: Add comment and remove
scan-assembler-not directives that forbid lvx and xxpermdi.
* gcc.target/powerpc/vec-extract-3.c: Likewise.
* gcc.target/powerpc/vec-extract-5.c: Likewise.
* gcc.target/powerpc/vec-extract-6.c: Likewise.
* gcc.target/powerpc/vec-extract-7.c: Likewise.
* gcc.target/powerpc/vec-extract-8.c: Likewise.
* gcc.target/powerpc/vec-extract-9.c: Likewise.
* gcc.target/powerpc/vsx-vector-6-le.c: Change
scan-assembler-times directives to reflect different numbers of
expected xxlnor, xxlor, xvcmpgtdp, and xxland instructions.

libcpp/ChangeLog:

2018-01-10  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* lex.c (search_line_fast): Remove illegal coercion of an
unaligned pointer value to vector pointer type and replace with
use of __builtin_vec_vsx_ld () built-in function, which operates
on unaligned pointer values.

From-SVN: r256656
34 files changed:
gcc/ChangeLog
gcc/config/rs6000/rs6000-p8swap.c
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/vsx.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr48857.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-28.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-29.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-30.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-31.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-32.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-33.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-34.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-35.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-36.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-37.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-38.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-39.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-40.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-41.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-42.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-43.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-44.c
gcc/testsuite/gcc.target/powerpc/swaps-p8-45.c
gcc/testsuite/gcc.target/powerpc/vec-extract-2.c
gcc/testsuite/gcc.target/powerpc/vec-extract-3.c
gcc/testsuite/gcc.target/powerpc/vec-extract-5.c
gcc/testsuite/gcc.target/powerpc/vec-extract-6.c
gcc/testsuite/gcc.target/powerpc/vec-extract-7.c
gcc/testsuite/gcc.target/powerpc/vec-extract-8.c
gcc/testsuite/gcc.target/powerpc/vec-extract-9.c
gcc/testsuite/gcc.target/powerpc/vsx-vector-6-le.c
libcpp/ChangeLog
libcpp/lex.c