On Tue, Dec 13, 2022 at 01:21:54PM +0100, Uros Bizjak wrote:
> On Tue, Dec 13, 2022 at 10:20 AM Jakub Jelinek <ja...@redhat.com> wrote:
> >
> > Hi!
> >
> > The following patch fixes 2 issues with the *concat<half><mode>3_5 and
> > *concat<mode><dwi>3_{6,7} patterns.
> > One is that if the destination is memory rather than register, then
> > we can't use movabsq and so can't support all the possible immediates.
> > I see 3 possibilities to fix that.  One would be to use
> > x86_64_hilo_int_operand predicate instead of const_scalar_int_operand
> > and thus not match it at all during combine in such cases, but that
> > unnecessarily pessimizes also the case when it is loaded into register
> > where we can use movabsq.
> > Another one is what is implemented in the patch, use Wd constraint
> > for the integer on 64-bit if destination is memory and X (didn't find
> > more appropriate one which would accept any const_int/const_wide_int
> > and the value checking is done in the conditions) otherwise.
> 
> Perhaps you should use "n" instead of "X".

I was afraid of the PIC stuff in:
(define_constraint "n"
  "Matches a non-symbolic integer constant."
  (and (match_test "CONST_SCALAR_INT_P (op)")
       (match_test "!flag_pic || LEGITIMATE_PIC_OPERAND_P (op)")))
but now that I look at i386.cc (legitimate_pic_operand_p), you're right,
for CONST_INT and CONST_WIDE_INT it always returns true, so n is fine.

I'll retest with "n".

        Jakub

Reply via email to