aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-12-02 11:32:19 +0100
committerJakub Jelinek <jakub@redhat.com>2020-12-02 11:40:47 +0100
commit037fe26ee1ac18581bf0ad646d48591c97d10bd3 (patch)
treea6f69e57d3e6391e15795c1382babe8437afd09b /gcc/expr.c
parent337d6362458ab033d3bfe287dda37f9da5577406 (diff)
downloadgcc-037fe26ee1ac18581bf0ad646d48591c97d10bd3.zip
gcc-037fe26ee1ac18581bf0ad646d48591c97d10bd3.tar.gz
gcc-037fe26ee1ac18581bf0ad646d48591c97d10bd3.tar.bz2
expansion: Further improve double-word modulo, division and divmod [PR97459]
The following patch implements what Thomas wrote about, in particular that we can handle also double-word divison by the constants for which the earlier patch optimized modulo (if it would be otherwise a library call) and that we can also easily handle such constants shifted to the left. Unfortunately, seems CSE isn't able to optimize away the two almost identical sequences (one to compute remainder, one to compute quotient), probably because of the ADD_OVERFLOW introduced jumps, so the patch also adjusts expand_DIVMOD. 2020-12-02 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/97459 * optabs.h (expand_doubleword_divmod): Declare. * optabs.c (expand_doubleword_divmod): New function. (expand_binop): Use it. * internal-fn.c (expand_DIVMOD): Likewise. * gcc.target/i386/pr97282.c (foo): Use 123456 divisor instead of 10. * gcc.dg/pr97459-1.c (TESTS): Add tests for 10, 12 and 6144. * gcc.dg/pr97459-2.c (TESTS): Likewise. * gcc.dg/pr97459-3.c: New test. * gcc.dg/pr97459-4.c: New test. * gcc.dg/pr97459-5.c: New test. * gcc.dg/pr97459-6.c: New test.
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions