[PATCH 1/6] aarch64: Add ucmp_*_carryinC patterns for all usub_*_carryinC

2020-03-18 Thread Richard Henderson via Gcc-patches
Use xzr for the output when we only require the flags output. This will be used shortly for TImode comparisons. * config/aarch64/aarch64.md (ucmp3_carryinC): New. (*ucmp3_carryinC_z1): New. (*ucmp3_carryinC_z2): New. (*ucmp3_carryinC): New. --- gcc/config/aarch64/a

[PATCH 0/6] aarch64: Implement TImode comparisons

2020-03-18 Thread Richard Henderson via Gcc-patches
This is attacking case 3 of PR 94174. The existing ccmp optimization happens at the gimple level, which means that rtl expansion of TImode stuff cannot take advantage. But we can to even better than the existing ccmp optimization. This expansion is similar size to our current branchful expansio

[PATCH 5/6] aarch64: Improve nzcv argument to ccmp

2020-03-18 Thread Richard Henderson via Gcc-patches
Currently we use %k to interpret an aarch64_cond_code value. This interpretation is done via an array, aarch64_nzcv_codes. The rtl is neither hindered nor harmed by using the proper nzcv value itself, so index the array earlier than later. This makes it easier to compare the rtl to the assembly. I

[PATCH 4/6] aarch64: Simplify @ccmp operands

2020-03-18 Thread Richard Henderson via Gcc-patches
The first two arguments were "reversed", in that operand 0 was not the output, but the input cc_reg. Remove operand 0 entirely, since we can get the input cc_reg from within the operand 3 comparison expression. This moves the output operand to index 0. * config/aarch64/aarch64.md (@ccmpc

[PATCH 2/6] aarch64: Adjust result of aarch64_gen_compare_reg

2020-03-18 Thread Richard Henderson via Gcc-patches
Return the entire comparison expression, not just the cc_reg. This will allow the routine to adjust the comparison code as needed for TImode comparisons. Note that some users were passing e.g. EQ to aarch64_gen_compare_reg and then using gen_rtx_NE. Pass the proper code in the first place.

[PATCH 6/6] aarch64: Implement TImode comparisons

2020-03-18 Thread Richard Henderson via Gcc-patches
Use ccmp to perform all TImode comparisons branchless. * config/aarch64/aarch64.c (aarch64_gen_compare_reg): Expand all of the comparisons for TImode, not just NE. * config/aarch64/aarch64.md (cbranchti4, cstoreti4): New. --- gcc/config/aarch64/aarch64.c | 182 +++

<    1   2