Ping.

https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00932.html

Thanks,
Kyrill

On 21/04/17 09:20, Kyrill Tkachov wrote:
Hi all,

Our sub<mode>3_compare1 pattern is not enough to catch cases where we subtract 
an immediate
and compare against in PARALLEL. This is due to the RTL canonicalisation rules 
that require
subtractions of immediate IMM be represented as (plus x -IMM).
So we need a bit of trickery to catch those cases and this patch does that.
It adds a new define_insn to match the plus-negatable-immediate in parallel 
with a comparison
and a peephole that will bring the two together when possible.
Otherwise it's pretty straightforward.

The testcase in the patch now generates a single SUBS-immediate instead of a 
SUB followed by a CMP.

Bootstrapped and tested on aarch64-none-linux-gnu.

Ok for GCC 8?

Thanks,
Kyrill

2017-04-21  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    * config/aarch64/aarch64.md (sub<mode>3_compare1_imm): New define_insn.
    (peephole2): New peephole2 to emit the above.
    * config/aarch64/predicates.md (aarch64_sub_immediate): New predicate.

2017-04-21  Kyrylo Tkachov  <kyrylo.tkac...@arm.com>

    * gcc.target/aarch64/subs_compare_2.c: New test.


Reply via email to