This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR target/68991: Add vector_memory_operand and "Bm" constraint
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Vladimir Makarov <vmakarov at redhat dot com>
- Date: Mon, 4 Jan 2016 09:21:51 +0100
- Subject: Re: [PATCH] PR target/68991: Add vector_memory_operand and "Bm" constraint
- Authentication-results: sourceware.org; auth=none
- References: <20151230205333 dot GA1877 at gmail dot com> <CAFULd4bAa2+Jn10-wnLzTVkUWVh1KOgpCA8LM1DMUDAyNb2baA at mail dot gmail dot com> <CAMe9rOrYmTPPFE3mre7kcWEGoHJx32ogQ60J1gPryo2d593nKg at mail dot gmail dot com> <CAFULd4Y5HmdwT_N9n_ZDcj6W54tuT37Z-D+k_VYM2qentfVDyw at mail dot gmail dot com> <9193C1A5-1430-49CF-9F47-CB673218BA30 at gmail dot com> <CAMe9rOoKtKo_xV0Nn7ufNowXjfkS4XsLnifHPVTCUCCobFM8ew at mail dot gmail dot com> <CAMe9rOreR+8cxrTvw-f-WtMUVq6F_XhDJ6yYFwxjLd5orWiExw at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Jan 03, 2016 at 07:11:58PM -0800, H.J. Lu wrote:
> --- a/gcc/config/i386/predicates.md
> +++ b/gcc/config/i386/predicates.md
> @@ -951,6 +951,13 @@
> (match_test "INTEGRAL_MODE_P (GET_MODE (op))")
> (match_test "op == CONSTM1_RTX (GET_MODE (op))")))
>
> +; Return true when OP is operand acceptable for vector memory operand.
> +; Only AVX can have misaligned memory operand.
> +(define_predicate "vector_memory_operand"
> + (and (match_operand 0 "memory_operand")
> + (ior (match_test "TARGET_AVX")
> + (match_test "MEM_ALIGN (op) >= GET_MODE_ALIGNMENT (mode)"))))
Shouldn't this take into account the ssememalign attribute too?
I mean, various instructions have some ssememalign > 8, which means they
can't accept any alignment, but happily accept say >= 32-bit alignment
or >= 64-bit alignment. Though, ssememalign is an instruction attribute
and the predicates/constraints don't have access to the current instruction.
So maybe we need more constraints and more predicates, the ones you've added
for ssememalign == 0 instructions, don't change anything in instructions
with ssememalign == 8 (you've clearly changed some of them, and patch 3
shows you've tried to partially undo it afterwards, but only the constraint,
not the predicate, and only in one instruction), and use different
predicates/constraints for ssememalign == {16,32,64} instructions.
Jakub