Bug 67322 - [Aarch64] Exploit Wide Add operations when appropriate
Summary: [Aarch64] Exploit Wide Add operations when appropriate
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-23 03:05 UTC by Michael Collison
Modified: 2015-12-07 00:31 UTC (History)
0 users

See Also:
Host:
Target: aarch64
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Collison 2015-08-23 03:05:42 UTC
Wide add operations are not always being generated for mixed mode adds as shown by the following test case:

int wadd_test(int len, void * dummy, short * __restrict x)
{
  len = len & ~31;
  int result = 0;
  __asm volatile ("");
  for (int i = 0; i < len; i++)
    result += x[i];
  return result;
}
Comment 1 Michael Collison 2015-12-07 00:28:59 UTC
Fixed via:
URL: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=230853

r230853 | collison | 2015-11-24 23:51:55 -0700 (Tue, 24 Nov 2015) | 15 lines

2015-11-24  Michael Collison  <michael.collison@linaro.org>

        * config/aarch64/aarch64-simd.md (widen_ssum, widen_usum)
        (aarch64_<ANY_EXTEND:su><ADDSUB:optab>w<mode>_internal): New patterns
        * config/aarch64/iterators.md (Vhalf, VDBLW): New mode attributes.
        * gcc.target/aarch64/saddw-1.c: New test.
        * gcc.target/aarch64/saddw-2.c: New test.
        * gcc.target/aarch64/uaddw-1.c: New test.
        * gcc.target/aarch64/uaddw-2.c: New test.
        * gcc.target/aarch64/uaddw-3.c: New test.
        * lib/target-support.exp
        (check_effective_target_vect_widen_sum_hi_to_si_pattern):
        Add aarch64 to list of support targets.
Comment 2 Michael Collison 2015-12-07 00:31:44 UTC
Resolved via:

https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=230853