diff options
author | Tamar Christina <tamar.christina@arm.com> | 2022-08-04 16:37:25 +0100 |
---|---|---|
committer | Tamar Christina <tamar.christina@arm.com> | 2022-08-04 16:37:25 +0100 |
commit | be58bf98e98bb431ed26ca8be84586075fe8be82 (patch) | |
tree | ad4ec4fca41b13fde7fee492566f545b6672916a /gcc/value-range.h | |
parent | c832ec4c3ec4853ad89ff3b0dbf6e9454e75e8cc (diff) | |
download | gcc-be58bf98e98bb431ed26ca8be84586075fe8be82.zip gcc-be58bf98e98bb431ed26ca8be84586075fe8be82.tar.gz gcc-be58bf98e98bb431ed26ca8be84586075fe8be82.tar.bz2 |
middle-end: Simplify subtract where both arguments are being bitwise inverted.
This adds a match.pd rule that drops the bitwwise nots when both arguments to a
subtract is inverted. i.e. for:
float g(float a, float b)
{
return ~(int)a - ~(int)b;
}
we instead generate
float g(float a, float b)
{
return (int)b - (int)a;
}
We already do a limited version of this from the fold_binary fold functions but
this makes a more general version in match.pd that applies more often.
gcc/ChangeLog:
* match.pd: New bit_not rule.
gcc/testsuite/ChangeLog:
* gcc.dg/subnot.c: New test.
Diffstat (limited to 'gcc/value-range.h')
0 files changed, 0 insertions, 0 deletions