diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2019-01-07 14:49:00 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2019-01-07 14:49:00 +0000 |
commit | a58fe3c5ca1f0101c4af7f0c5b860cc4d49cd4cb (patch) | |
tree | cb7d7c9f5f6a7f4146e8ecbee86803c85cbe2496 /gcc/ChangeLog | |
parent | df35e0bde1f245e8cd49c29cb4de9747257151cd (diff) | |
download | gcc-a58fe3c5ca1f0101c4af7f0c5b860cc4d49cd4cb.zip gcc-a58fe3c5ca1f0101c4af7f0c5b860cc4d49cd4cb.tar.gz gcc-a58fe3c5ca1f0101c4af7f0c5b860cc4d49cd4cb.tar.bz2 |
Investigating PR target/86891 revealed a number of issues with the way the...
Investigating PR target/86891 revealed a number of issues with the way
the AArch64 backend was handing overflow detection patterns. Firstly,
expansion for signed and unsigned types is not the same as in one form
the overflow is detected via the C flag and in the other it is done
via the V flag in the PSR. Secondly, particular care has to be taken
when describing overflow of signed types: the comparison has to be
performed conceptually on a value that cannot overflow and compared to
a value that might have overflowed.
It became apparent that some of the patterns were simply unmatchable
(they collapse to NEG in the RTL rather than subtracting from zero)
and a number of patterns were overly restrictive in terms of the
immediate constants that they supported. I've tried to address all of
these issues as well.
gcc:
PR target/86891
* config/aarch64/aarch64.c (aarch64_expand_subvti): New parameter
unsigned_p. Handle signed and unsigned overflow correction as
required.
* config/aarch64/aarch64-protos.h (aarch64_expand_subvti): Update
prototype.
* config/aarch64/aarch64.md (addv<mode>4): Use aarch64_plus_operand
for operand 2.
(add<mode>3_compareV_imm): Make this callable for expanding.
(subv<GPI:mode>4): Use register_operand for operand 1. Use
aarch64_plus_operand for operand 2.
(subv<GPI:mode>_insn): New insn pattern.
(subv<GPI:mode>_imm): Likewise.
(negv<GPI:mode>3): New expand pattern.
(negv<GPI:mode>_insn): New insn pattern.
(negv<GPI:mode>_cmp_only): Likewise.
(cmpv<GPI:mode>_insn): Likewise.
(subvti4): Use register_operand for operand 1. Update call to
aarch64_expand_subvti.
(usubvti4): Likewise.
(negvti3): New expand pattern.
(negdi_carryout): New insn pattern.
(negvdi_carryinV): New insn pattern.
(sub<mode3>_compare1_imm): Delete named insn pattern, make anonymous
version the named version.
(peepholes to convert to sub<mode3>_compare1_imm): Adjust order of
operands.
(usub<GPI:mode>3_carryinC, usub<GPI:mode>3_carryinC_z1): New insn
patterns.
(usub<GPI:mode>3_carryinC_z2, usub<GPI:mode>3_carryinC): New insn
patterns.
(sub<mode>3_carryinCV, sub<mode>3_carryinCV_z1_z2): Delete.
(sub<mode>3_carryinCV_z1, sub<mode>3_carryinCV_z2): Delete.
(sub<mode>3_carryinCV): Delete.
(sub<GPI:mode>3_carryinV): New expand pattern.
sub<mode>3_carryinV, sub<mode>3_carryinV_z2): New insn patterns.
testsuite:
* gcc.target/aarch64/subs_compare_2.c: Make '#' immediate prefix
optional in scan pattern.
From-SVN: r267650
Diffstat (limited to 'gcc/ChangeLog')
-rw-r--r-- | gcc/ChangeLog | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 472145b..0aad583 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,42 @@ +2019-01-07 Richard Earnshaw <rearnsha@arm.com> + + PR target/86891 + * config/aarch64/aarch64.c (aarch64_expand_subvti): New parameter + unsigned_p. Handle signed and unsigned overflow correction as + required. + * config/aarch64/aarch64-protos.h (aarch64_expand_subvti): Update + prototype. + * config/aarch64/aarch64.md (addv<mode>4): Use aarch64_plus_operand + for operand 2. + (add<mode>3_compareV_imm): Make this callable for expanding. + (subv<GPI:mode>4): Use register_operand for operand 1. Use + aarch64_plus_operand for operand 2. + (subv<GPI:mode>_insn): New insn pattern. + (subv<GPI:mode>_imm): Likewise. + (negv<GPI:mode>3): New expand pattern. + (negv<GPI:mode>_insn): New insn pattern. + (negv<GPI:mode>_cmp_only): Likewise. + (cmpv<GPI:mode>_insn): Likewise. + (subvti4): Use register_operand for operand 1. Update call to + aarch64_expand_subvti. + (usubvti4): Likewise. + (negvti3): New expand pattern. + (negdi_carryout): New insn pattern. + (negvdi_carryinV): New insn pattern. + (sub<mode3>_compare1_imm): Delete named insn pattern, make anonymous + version the named version. + (peepholes to convert to sub<mode3>_compare1_imm): Adjust order of + operands. + (usub<GPI:mode>3_carryinC, usub<GPI:mode>3_carryinC_z1): New insn + patterns. + (usub<GPI:mode>3_carryinC_z2, usub<GPI:mode>3_carryinC): New insn + patterns. + (sub<mode>3_carryinCV, sub<mode>3_carryinCV_z1_z2): Delete. + (sub<mode>3_carryinCV_z1, sub<mode>3_carryinCV_z2): Delete. + (sub<mode>3_carryinCV): Delete. + (sub<GPI:mode>3_carryinV): New expand pattern. + sub<mode>3_carryinV, sub<mode>3_carryinV_z2): New insn patterns. + 2019-01-07 Richard Biener <rguenther@suse.de> * tree-ssa-uncprop.c (ssa_equip_hash_traits): Remove in favor |